diff options
| author | hathach <[email protected]> | 2020-06-01 13:40:18 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-06-01 13:40:18 +0700 |
| commit | e92118635cc8055a5ca599eaf9919d99a55bf584 (patch) | |
| tree | ae4bcf845d374949fe20fecc465933dc1115caec | |
| parent | 710c54f8cbee2134334262cf872f538909b264c5 (diff) | |
adding speed detect on bus reset
| -rw-r--r-- | hw/bsp/stm32h743eval/board.mk | 2 | ||||
| -rw-r--r-- | src/device/usbd.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/hw/bsp/stm32h743eval/board.mk b/hw/bsp/stm32h743eval/board.mk index 5c6c6ea4f..cbf37a95d 100644 --- a/hw/bsp/stm32h743eval/board.mk +++ b/hw/bsp/stm32h743eval/board.mk @@ -48,7 +48,7 @@ FREERTOS_PORT = ARM_CM7/r0p1 # For flash-jlink target JLINK_DEVICE = stm32h743xi -JLINK_IF = jtag +JLINK_IF = swd # flash target using on-board stlink flash: flash-stlink diff --git a/src/device/usbd.c b/src/device/usbd.c index 275792ab9..eeb5011ec 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -40,7 +40,8 @@ //--------------------------------------------------------------------+ // Device Data //--------------------------------------------------------------------+ -typedef struct { +typedef struct +{ struct TU_ATTR_PACKED { volatile uint8_t connected : 1; @@ -53,6 +54,8 @@ typedef struct { uint8_t self_powered : 1; // configuration descriptor's attribute }; + uint8_t speed; + uint8_t itf2drv[16]; // map interface number to driver (0xff is invalid) uint8_t ep2drv[8][2]; // map endpoint to driver ( 0xff is invalid ) @@ -384,7 +387,7 @@ void tud_task (void) { case DCD_EVENT_BUS_RESET: usbd_reset(event.rhport); - // TODO DCD should report operational speed (LS/FS/HS) + _usbd_dev.speed = event.bus_reset.speed; break; case DCD_EVENT_UNPLUGGED: |
