stm32l0: Fix pointer/integer casting warnings.

This commit is contained in:
Gareth McMullin 2015-03-11 20:40:48 -07:00
parent 3d28c1418c
commit 1196b03d66
1 changed files with 6 additions and 19 deletions

View File

@ -159,25 +159,12 @@ namespace {
typedef uint32_t stm32lx_stub_pointer_t; typedef uint32_t stm32lx_stub_pointer_t;
struct stm32lx_nvm { #define STM32Lx_NVM_PECR(p) ((p) + 0x04)
volatile uint32_t acr; #define STM32Lx_NVM_PEKEYR(p) ((p) + 0x0C)
volatile uint32_t pecr; #define STM32Lx_NVM_PRGKEYR(p) ((p) + 0x10)
volatile uint32_t pdkeyr; #define STM32Lx_NVM_OPTKEYR(p) ((p) + 0x14)
volatile uint32_t pekeyr; #define STM32Lx_NVM_SR(p) ((p) + 0x18)
volatile uint32_t prgkeyr; #define STM32Lx_NVM_OPTR(p) ((p) + 0x1C)
volatile uint32_t optkeyr;
volatile uint32_t sr;
volatile uint32_t optr; /* or obr */
volatile uint32_t wrprot; /* or wprot1 */
};
#define STM32Lx_NVM(p) (*(struct stm32lx_nvm*) (p))
#define STM32Lx_NVM_PECR(p) ((uint32_t) &STM32Lx_NVM(p).pecr)
#define STM32Lx_NVM_PEKEYR(p) ((uint32_t) &STM32Lx_NVM(p).pekeyr)
#define STM32Lx_NVM_PRGKEYR(p) ((uint32_t) &STM32Lx_NVM(p).prgkeyr)
#define STM32Lx_NVM_OPTKEYR(p) ((uint32_t) &STM32Lx_NVM(p).optkeyr)
#define STM32Lx_NVM_SR(p) ((uint32_t) &STM32Lx_NVM(p).sr)
#define STM32Lx_NVM_OPTR(p) ((uint32_t) &STM32Lx_NVM(p).optr)
#endif #endif