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>
This commit is contained in:
Angus Gratton 2024-06-25 16:48:39 +10:00
parent 068d9bf2cf
commit f60c71d131

View file

@ -138,7 +138,8 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
#if MICROPY_HW_ENABLE_USBDEV
// Only disable the USB clock if a USB host has not configured the device
bool disable_usb = !tud_mounted();
// or if going to DORMANT mode.
bool disable_usb = !(tud_mounted() && n_args > 0);
#else
bool disable_usb = true;
#endif