dmitrystu / libusb_stm32

Lightweight USB device Stack for STM32 microcontrollers
Apache License 2.0
721 stars 165 forks source link

Problem in getinfo() for STM32F103 #33

Closed Squonk42 closed 5 years ago

Squonk42 commented 5 years ago

https://github.com/dmitrystu/libusb_stm32/blob/7b5e32e2ef326d80863245fcd87859db8498c879/src/usbd_stm32f103_devfs.c#L162 The logical AND should probably be replaced by a bitwise AND, such that the bit value is used as a mask on the read port input data: if (USBD_DP_PORT->IDR & _BV(USBD_DP_PIN)) return STATUS_VAL(USBD_HW_ENABLED | USBD_HW_SPEED_FS);

dmitrystu commented 5 years ago

Yes. Will be fixed ASAP