Merge pull request #1645 from openmv/usbdbg_wait

usbdbg: Check USB IRQs when blocking on commands.
This commit is contained in:
Ibrahim Abdelkader 2022-05-25 11:51:01 +02:00 committed by GitHub
commit d8c83eb825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ void usbdbg_init()
void usbdbg_wait_for_command(uint32_t timeout) void usbdbg_wait_for_command(uint32_t timeout)
{ {
for (mp_uint_t ticks = mp_hal_ticks_ms(); ((mp_hal_ticks_ms() - ticks) < timeout) && (cmd != USBDBG_NONE); ); for (mp_uint_t ticks = mp_hal_ticks_ms(); irq_enabled && ((mp_hal_ticks_ms() - ticks) < timeout) && (cmd != USBDBG_NONE); );
} }
bool usbdbg_script_ready() bool usbdbg_script_ready()