Define中有定義一些環境變數如USE_STM3210E_EVAL
如使用GPIO控制上拉電阻,必須依照硬體配置修改
檔案"platform_config.h"
/* Define the STM32F10x hardware depending on the used evaluation board */
#ifdef USE_STM3210B_EVAL
#define USB_DISCONNECT GPIOD
#define USB_DISCONNECT_PIN GPIO_Pin_9
#define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOD
#define EVAL_COM1_IRQn USART1_IRQn
#elif defined (USE_STM3210E_EVAL)
#define USB_DISCONNECT GPIOB
#define USB_DISCONNECT_PIN GPIO_Pin_14
#define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOB
#define EVAL_COM1_IRQn USART1_IRQn
#elif defined (USE_STM3210C_EVAL)
#define USB_DISCONNECT 0
#define USB_DISCONNECT_PIN 0
#define RCC_APB2Periph_GPIO_DISCONNECT 0
#define EVAL_COM1_IRQn USART2_IRQn
#endif /* USE_STM3210B_EVAL */
沒有留言:
張貼留言