USB keyboard with teensy 4.0(IMXRT1062DVL6) does not wake the PC.There are posts on teensy forum about usb keyboard not waking up the pc, no one did anything.
teensy 3.1/3.2(MK20DX256VLH7) has in https://github.com/PaulStoffregen/cores/blob/master/teensy3/kinetis.h:
#define USB0_CTL (*(volatile uint8_t *)0x40072094) // Control Register
#define USB_CTL_RESUME ((uint8_t)0x04) //
teensy 4.0(IMXRT1062DVL6) does not have the above in https://github.com/PaulStoffregen/cores/blob/master/teensy4/imxrt.h.
What are the equivalent registers for the IMXRT1062?
(using arduino ide) With teensy 3.2 putting this to a button press would wake up the PC when is sleeping:
tmp = USB0_CTL;
USB0_CTL |= USB_CTL_RESUME;
delay(12);
USB0_CTL = tmp;
For test I added to teensy4/imxrt.h:
#define USB0_CTL (*(volatile uint8_t *)0x40072094) // Control Register
#define USB_CTL_RESUME ((uint8_t)0x04) //
and when pressing the button to execute "tmp = USB0_CTL; USB0_CTL |= USB_CTL_RESUME; etc" code, teeny4(IMXRT1062DVL6) board restarts.
(for info on teeny4(IMXRT1062DVL6): bitRead(USB1_PORTSC1,7) shows 0 when PC is awake, and 1 when is sleeping.)
("0xA0, // bmAttributes" added in https://github.com/PaulStoffregen/cores/blob/master/teensy4/usb_desc.c)