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.
This commit is contained in:
Tobias Diedrich
2022-01-23 16:51:51 +01:00
parent a264ecbc27
commit 25354c4792
+6 -3
View File
@@ -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'