cpu/stm32l1: use flash size define to get the number of pages
This commit is contained in:
parent
b4079badf7
commit
cef14009d9
@ -76,18 +76,9 @@ extern "C" {
|
||||
* @name Flash page configuration
|
||||
* @{
|
||||
*/
|
||||
#if defined(CPU_MODEL_STM32L152RE) || defined(CPU_MODEL_STM32L151RC) || defined(CPU_MODEL_STM32L151CB)
|
||||
#define FLASHPAGE_SIZE (256U)
|
||||
#if defined(CPU_MODEL_STM32L152RE)
|
||||
#define FLASHPAGE_NUMOF (2048U) /* 512KB */
|
||||
#endif
|
||||
#if defined(CPU_MODEL_STM32L151RC)
|
||||
#define FLASHPAGE_NUMOF (1024U) /* 256KB */
|
||||
#endif
|
||||
#if defined(CPU_MODEL_STM32L151CB)
|
||||
#define FLASHPAGE_NUMOF (512U) /* 128KB */
|
||||
#endif
|
||||
#endif
|
||||
#define FLASHPAGE_NUMOF (STM32_FLASHSIZE / FLASHPAGE_SIZE)
|
||||
|
||||
/* The minimum block size which can be written is 4B. However, the erase
|
||||
* block is always FLASHPAGE_SIZE.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user