8000 rp2: Don't disable USB if going to DORMANT mode. · micropython/micropython@f60c71d · GitHub
[go: up one dir, main page]

Skip to content

Commit f60c71d

Browse files
committed
rp2: Don't disable USB if going to DORMANT mode.
In this mode, XOSC is stopped so can't really keep the USB PLL enabled. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 068d9bf commit f60c71d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ports/rp2/modmachine.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
138138

139139
#if MICROPY_HW_ENABLE_USBDEV
140140
// Only disable the USB clock if a USB host has not configured the device
141-
bool disable_usb = !tud_mounted();
141+
// or if going to DORMANT mode.
142+
bool disable_usb = !(tud_mounted() && n_args > 0);
142143
#else
143144
bool disable_usb = true;
144145
#endif

0 commit comments

Comments
 (0)
0