Bypass auto-boot when doing a nerve pinch

This commit is contained in:
Sven Willner 2020-08-05 15:37:55 +02:00
parent 793d9bc017
commit 618b79f207

View File

@ -11,6 +11,8 @@
struct ff_spi *spi; struct ff_spi *spi;
static int nerve_pinch(void);
// ICE40UP5K bitstream images (with SB_MULTIBOOT header) are // ICE40UP5K bitstream images (with SB_MULTIBOOT header) are
// 104250 bytes. The SPI flash has 4096-byte erase blocks. // 104250 bytes. The SPI flash has 4096-byte erase blocks.
// The smallest divisible boundary is 4096*26. // The smallest divisible boundary is 4096*26.
@ -27,7 +29,7 @@ void isr(void)
if (irqs & (1 << TIMER0_INTERRUPT)) { if (irqs & (1 << TIMER0_INTERRUPT)) {
timer0_ev_pending_write(timer0_ev_pending_read()); timer0_ev_pending_write(timer0_ev_pending_read());
if (dfu_getstate() == dfuIDLE) { if (dfu_getstate() == dfuIDLE && !nerve_pinch()) {
reboot(); reboot();
while (1) while (1)
; ;