dmitrystu / libusb_stm32

Lightweight USB device Stack for STM32 microcontrollers
Apache License 2.0
696 stars 160 forks source link

Add common usb_conf.h #125

Open mrx23dot opened 1 year ago

mrx23dot commented 1 year ago

It would be a lot easier for IDEs if every configuration would be located in one header file, instead having to manually configure it in the IDE/and build chain and hunt for missing defines.

usb_conf.h

/* select target */
#define STM32F1
#define STM32F103x6
#define STM32F103xB
#define STM32F1xx
#define USBD_STM32F103

/* +whatever usb config */

Similarly to stm32f1xx_hal_conf.h

It should also be effectively included in every file that uses these macros. (possibly via usb.h) Nice and self contained solution.

xcvista commented 1 year ago

Currenly we are using -D flags on the compiler configuration for that purpose.