From ea175caf4bbcc3b32c161dd52cb773fa8fdba707 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 28 Nov 2011 23:21:21 -0500 Subject: libmaple/flash: Add family-specific FLASH_SAFE_WAIT_STATES. This is the smallest wait state value that is safe for use when the MCU is at its fastest rate, not considering overclocking. This requires moving the FLASH_WAIT_STATE defines above the family include, so do that, and add the missing #defines (for wait states up to 7). For the STM32F1, the correct value for FLASH_SAFE_WAIT_STATES is FLASH_WAIT_STATE_2; say so in the F1-family flash.h. Signed-off-by: Marti Bolivar --- libmaple/stm32f1/include/family/flash.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libmaple/stm32f1/include/family') diff --git a/libmaple/stm32f1/include/family/flash.h b/libmaple/stm32f1/include/family/flash.h index aedb326..918a434 100644 --- a/libmaple/stm32f1/include/family/flash.h +++ b/libmaple/stm32f1/include/family/flash.h @@ -29,7 +29,8 @@ * @brief STM32F1 Flash header. * * Provides register map, base pointer, and register bit definitions - * for the Flash controller on the STM32F1 line. + * for the Flash controller on the STM32F1 line, along with + * family-specific configuration values. */ #ifndef _LIBMAPLE_STM32F1_FLASH_H_ @@ -128,6 +129,12 @@ typedef struct flash_reg_map { #define FLASH_OBR_RDPRT BIT(FLASH_OBR_RDPRT_BIT) #define FLASH_OBR_OPTERR BIT(FLASH_OBR_OPTERR_BIT) +/* + * Family-specific configuration values. + */ + +#define FLASH_SAFE_WAIT_STATES FLASH_WAIT_STATE_2 + #ifdef __cplusplus } #endif -- cgit v1.2.3