cpu/stm32l4: use flash size define to get the number of pages

This commit is contained in:
Alexandre Abadie 2019-06-26 08:46:19 +02:00
parent cef14009d9
commit ee5181dd50
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -64,13 +64,8 @@ extern "C" {
*/ */
#define FLASHPAGE_SIZE (2048U) #define FLASHPAGE_SIZE (2048U)
#if defined(CPU_MODEL_STM32L432KC) || defined(CPU_MODEL_STM32L433RC) #define FLASHPAGE_NUMOF (STM32_FLASHSIZE / FLASHPAGE_SIZE)
#define FLASHPAGE_NUMOF (128U)
#elif defined(CPU_MODEL_STM32L452RE)
#define FLASHPAGE_NUMOF (256U)
#else
#define FLASHPAGE_NUMOF (512U)
#endif
/* The minimum block size which can be written is 8B. However, the erase /* The minimum block size which can be written is 8B. However, the erase
* block is always FLASHPAGE_SIZE. * block is always FLASHPAGE_SIZE.
*/ */