mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 00:17:41 +00:00
removed need for cpld mode setup for QFP100
This commit is contained in:
@@ -33,9 +33,7 @@
|
||||
namespace portapack {
|
||||
namespace cpld {
|
||||
|
||||
bool update_if_necessary(
|
||||
const Config config
|
||||
) {
|
||||
bool update_possible() {
|
||||
jtag::GPIOTarget target {
|
||||
portapack::gpio_cpld_tck,
|
||||
portapack::gpio_cpld_tms,
|
||||
@@ -65,13 +63,40 @@ bool update_if_necessary(
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool update_necessary(
|
||||
const Config config
|
||||
) {
|
||||
jtag::GPIOTarget target {
|
||||
portapack::gpio_cpld_tck,
|
||||
portapack::gpio_cpld_tms,
|
||||
portapack::gpio_cpld_tdi,
|
||||
portapack::gpio_cpld_tdo
|
||||
};
|
||||
jtag::JTAG jtag { target };
|
||||
CPLD cpld { jtag };
|
||||
|
||||
/* Verify CPLD contents against current bitstream. */
|
||||
auto ok = cpld.verify(config.block_0, config.block_1);
|
||||
return !ok;
|
||||
}
|
||||
|
||||
bool update(
|
||||
const Config config
|
||||
) {
|
||||
jtag::GPIOTarget target {
|
||||
portapack::gpio_cpld_tck,
|
||||
portapack::gpio_cpld_tms,
|
||||
portapack::gpio_cpld_tdi,
|
||||
portapack::gpio_cpld_tdo
|
||||
};
|
||||
jtag::JTAG jtag { target };
|
||||
CPLD cpld { jtag };
|
||||
|
||||
/* CPLD verifies incorrectly. Erase and program with current bitstream. */
|
||||
if( !ok ) {
|
||||
ok = cpld.program(config.block_0, config.block_1);
|
||||
}
|
||||
auto ok = cpld.program(config.block_0, config.block_1);
|
||||
|
||||
/* If programming OK, reset CPLD to user mode. Otherwise leave it in
|
||||
* passive (ISP) state.
|
||||
|
@@ -27,7 +27,13 @@
|
||||
namespace portapack {
|
||||
namespace cpld {
|
||||
|
||||
bool update_if_necessary(
|
||||
bool update_possible();
|
||||
|
||||
bool update_necessary(
|
||||
const Config config
|
||||
);
|
||||
|
||||
bool update(
|
||||
const Config config
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user