1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/stm32l0: use STM32_FLASHSIZE to generate FLASHPAGE_NUMOF

This commit is contained in:
Vincent Dupont 2018-07-09 10:31:28 +02:00
parent 719612092b
commit f28e7a9b01

View File

@ -58,18 +58,9 @@ extern "C" {
* @name Flash page configuration
* @{
*/
#if defined(CPU_MODEL_STM32L073RZ) || defined(CPU_MODEL_STM32L072CZ) || \
defined(CPU_MODEL_STM32L053R8) || defined(CPU_MODEL_STM32L031K6)
#define FLASHPAGE_SIZE (128U)
#endif
#if defined(CPU_MODEL_STM32L073RZ) || defined(CPU_MODEL_STM32L072CZ)
#define FLASHPAGE_NUMOF (1536U)
#elif defined(CPU_MODEL_STM32L053R8)
#define FLASHPAGE_NUMOF (512U)
#elif defined(CPU_MODEL_STM32L031K6)
#define FLASHPAGE_NUMOF (256U)
#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.