File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,14 @@ inline mchf_cpu_t MchfHW_Cpu()
5050#endif
5151
5252#if defined(STM32H7 )
53- #define GPIO_SetBits (PORT ,PINS ) { (PORT)->BSRRL = (PINS); }
54- #define GPIO_ResetBits (PORT ,PINS ) { (PORT)->BSRRH = (PINS); }
53+ inline void GPIO_SetBits (GPIO_TypeDef * PORT , uint32_t PINS ) { (PORT )-> BSRRL = (PINS ); }
54+ inline void GPIO_ResetBits (GPIO_TypeDef * PORT , uint32_t PINS ) { (PORT )-> BSRRH = (PINS ); }
5555#elif defined(STM32F7 ) || defined(STM32F4 )
56- #define GPIO_SetBits (PORT ,PINS ) { (PORT)->BSRR = (PINS); }
57- #define GPIO_ResetBits (PORT ,PINS ) { (PORT)->BSRR = (PINS) << 16U; }
56+ inline void GPIO_SetBits (GPIO_TypeDef * PORT , uint32_t PINS ) { (PORT )-> BSRR = (PINS ); }
57+ inline void GPIO_ResetBits (GPIO_TypeDef * PORT , uint32_t PINS ) { (PORT )-> BSRR = (PINS ) << 16U ; }
5858#endif
5959
60- #define GPIO_ToggleBits (PORT ,PINS ) { (PORT)->ODR ^= (PINS); }
61- #define GPIO_ReadInputDataBit (PORT ,PINS ) { ( (PORT)->IDR = (PINS); }
60+ inline void GPIO_ToggleBits (GPIO_TypeDef * PORT , uint32_t PINS ) { (PORT )-> ODR ^= (PINS ); }
61+ inline void GPIO_ReadInputDataBit (GPIO_TypeDef * PORT , uint32_t PINS ) { (PORT )-> IDR = (PINS ); }
6262
6363#endif
Original file line number Diff line number Diff line change @@ -80,12 +80,12 @@ void mchfBl_LEDInit(Led_TypeDef Led)
8080
8181void mchfBl_PinOn (Led_TypeDef Led )
8282{
83- GPIO_SetBits (GPIO_PORT [Led ],GPIO_PIN [Led ])
83+ GPIO_SetBits (GPIO_PORT [Led ],GPIO_PIN [Led ]);
8484}
8585
8686void mchfBl_PinOff (Led_TypeDef Led )
8787{
88- GPIO_ResetBits (GPIO_PORT [Led ],GPIO_PIN [Led ])
88+ GPIO_ResetBits (GPIO_PORT [Led ],GPIO_PIN [Led ]);
8989}
9090
9191void mchfBl_PinToggle (Led_TypeDef Led )
You can’t perform that action at this time.
0 commit comments