Skip to content

Commit 91854dc

Browse files
howard0sudb4ple
authored andcommitted
Fix macro to ensure a comma
1 parent 53bbc15 commit 91854dc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

mchf-eclipse/hardware/uhsdr_mcu.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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

mchf-eclipse/src/bootloader/uhsdr_boot_hw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ void mchfBl_LEDInit(Led_TypeDef Led)
8080

8181
void 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

8686
void 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

9191
void mchfBl_PinToggle(Led_TypeDef Led)

0 commit comments

Comments
 (0)