diff --git a/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h b/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h index 4c67d6b694..63125644be 100644 --- a/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h +++ b/features/unsupported/USBDevice/USBDevice/TARGET_STM/USBHAL_STM_TARGET.h @@ -15,17 +15,27 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #ifdef TARGET_STM32F303ZE #include "USBHAL_STM32F303ZE.h" #endif -#if defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F446ZE) || defined(TARGET_STM32F207ZG) \ -|| defined(TARGET_STM32F767ZI) || defined (TARGET_STM32F746ZG) || defined(TARGET_STM32F411RE) \ -|| defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) + +#if defined(TARGET_STM32F207ZG) || \ + defined(TARGET_STM32F401RE) || \ + defined(TARGET_STM32F407VG) || \ + defined(TARGET_STM32F411RE) || \ + defined(TARGET_STM32F412ZG) || \ + defined(TARGET_STM32F429ZI) || \ + defined(TARGET_STM32F446ZE) || \ + defined(TARGET_STM32F746ZG) || \ + defined(TARGET_STM32F767ZI) #include "USBHAL_STM_144_64pins.h" #endif + #ifdef TARGET_STM32L476VG #include "USBHAL_STM32L476VG.h" #endif + #ifdef TARGET_STM32F769NI #include "USBHAL_STM32F769NI.h" #endif diff --git a/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp b/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp index 4c4f44ca01..a7ef57a6ea 100644 --- a/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp +++ b/features/unsupported/USBDevice/USBDevice/USBHAL_STM32F4.cpp @@ -48,7 +48,7 @@ USBHAL::USBHAL(void) { // Enable power and clocking RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN; -#if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F429ZI) +#if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F412ZG) || defined(TARGET_STM32F429ZI) pin_function(PA_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS)); pin_function(PA_9, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLDOWN, GPIO_AF10_OTG_FS)); pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS));