Merge pull request #11750 from aabadie/pr/cpu/stm32l1-4_flashpage_numof

cpu/stm32l{1,4}: refactor flashpage numof macros
This commit is contained in:
Francisco 2019-07-01 14:58:10 +02:00 committed by GitHub
commit bc6303fb59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 18 deletions

View File

@ -76,18 +76,9 @@ extern "C" {
* @name Flash page configuration * @name Flash page configuration
* @{ * @{
*/ */
#if defined(CPU_MODEL_STM32L152RE) || defined(CPU_MODEL_STM32L151RC) || defined(CPU_MODEL_STM32L151CB)
#define FLASHPAGE_SIZE (256U) #define FLASHPAGE_SIZE (256U)
#if defined(CPU_MODEL_STM32L152RE) #define FLASHPAGE_NUMOF (STM32_FLASHSIZE / FLASHPAGE_SIZE)
#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
/* The minimum block size which can be written is 4B. However, the erase /* The minimum block size which can be written is 4B. However, the erase
* block is always FLASHPAGE_SIZE. * block is always FLASHPAGE_SIZE.
*/ */

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.
*/ */