@@ -29,9 +29,6 @@ extern "C" {
2929/* Includes ------------------------------------------------------------------*/
3030#include "stm32_def.h"
3131
32- #if defined(USE_HALV2_DRIVER )
33- #error "USB library is not yet compatible with HALv2 driver."
34- #else
3532#if !defined(USB_BASE ) && !defined(USB_OTG_DEVICE_BASE )
3633#error "This board does not support USB! Select 'None' in the 'Tools->USB interface' menu"
3734#endif
@@ -40,8 +37,6 @@ extern "C" {
4037#endif
4138#if !defined(USB_BASE ) && !defined(USB_OTG_FS ) && defined(USB_OTG_HS ) && !defined(USE_USB_HS )
4239#error "This board support only USB High Speed! Select 'High Speed' or 'High Speed in Full Speed mode' in the 'Tools->USB interface' menu"
43- #endif
44-
4540#endif
4641#include <stdio.h>
4742#include <stdlib.h>
@@ -77,7 +72,7 @@ extern "C" {
7772#elif defined(STM32G0B1xx ) || defined(STM32G0C1xx )
7873#define USB_IRQn USB_UCPD1_2_IRQn
7974#define USB_IRQHandler USB_UCPD1_2_IRQHandler
80- #elif defined(STM32C0xx ) || defined(STM32H5xx ) || defined(STM32U0xx )
75+ #elif defined(STM32C0xx ) || defined(STM32C5xx ) || defined( STM32H5xx ) || defined(STM32U0xx )
8176#define USB_IRQn USB_DRD_FS_IRQn
8277#define USB_IRQHandler USB_DRD_FS_IRQHandler
8378#elif defined(STM32U5xx ) && !defined(USB_DRD_FS )
@@ -90,6 +85,13 @@ extern "C" {
9085
9186#endif /* USB_BASE */
9287
88+ #if !defined(PCD_SNG_BUF ) && defined(HAL_PCD_SNG_BUF )
89+ #define PCD_SNG_BUF HAL_PCD_SNG_BUF
90+ #endif
91+ #if !defined(PCD_DBL_BUF ) && defined(HAL_PCD_DBL_BUF )
92+ #define PCD_DBL_BUF HAL_PCD_DBL_BUF
93+ #endif
94+
9395#ifndef __HAL_PCD_GATE_PHYCLOCK
9496#define __HAL_PCD_GATE_PHYCLOCK (_DUMMY_ )
9597#endif
0 commit comments