From 25354c4792b8ab3a3b2823e9ac84b8b68f828f2d Mon Sep 17 00:00:00 2001 From: Tobias Diedrich Date: Sun, 23 Jan 2022 16:51:51 +0100 Subject: [PATCH] Always tickle watchdog in main loop Otherwise during initial setup or wakeup, nothing may happen for long enough to trigger a watchdog reset into the bootloader. --- main.s | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.s b/main.s index b8d9a87..5aeeabc 100644 --- a/main.s +++ b/main.s @@ -438,7 +438,8 @@ _mainloop: ; Tickle watchdog MOV A, #0x5a B0MOV WDTR, A -@@: + + ; Check for any events that need handling B0BTS0 FEP0SETUP ; Jump if SETUP packet rx'd JMP _usb_setup B0BTS0 FEP0OUT @@ -451,9 +452,11 @@ _mainloop: JMP _usb_sof B0BTS0 FSUSPEND JMP _usb_suspend - B0BTS1 tpIRQ + B0BTS1 tpIRQ ; Level-triggered, reset by reading data over I2C JMP _tp_update - JMP @B + + ; Rinse and repeat + JMP _mainloop _usb_suspend: MOV A, #'P'