Skip to main content
SHoll.1
Associate
March 31, 2020
Question

Multiple "expected expression before 'do'" errors

  • March 31, 2020
  • 12 replies
  • 6515 views

I'm new to STM32 and trying to bring up the STM32L053-DISCO project in STM32CubeIDE. It mostly comiles fine, but has an issue with the HAL defines, such as below:

#define __HAL_RCC_GPIOA_CLK_ENABLE()  do { \

                    __IO uint32_t tmpreg; \

                    SET_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN);\

                    /* Delay after an RCC peripheral clock enabling */ \

                    tmpreg = READ_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN);\

                    UNUSED(tmpreg); \

                   } while(0)

I really don't see why it is being flagged as an error. I'm sure this must have been seen by someone else...

Best regards,

Stephen

This topic has been closed for replies.

12 replies

Bob S
Super User
January 3, 2024

Look at the last 2 lines of code in the post just before yours.  Do you see what that person did?  Do the same.