Код
#define RCC_PLLSource_HSI_Div2 ((uint32_t)0x00000000)
#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_CL)
# define RCC_PLLSource_HSE_Div1 ((uint32_t)0x00010000)
# define RCC_PLLSource_HSE_Div2 ((uint32_t)0x00030000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_HSE_Div1) || \
((SOURCE) == RCC_PLLSource_HSE_Div2))
#else
# define RCC_PLLSource_PREDIV1 ((uint32_t)0x00010000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_PREDIV1))
#endif
#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_CL)
# define RCC_PLLSource_HSE_Div1 ((uint32_t)0x00010000)
# define RCC_PLLSource_HSE_Div2 ((uint32_t)0x00030000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_HSE_Div1) || \
((SOURCE) == RCC_PLLSource_HSE_Div2))
#else
# define RCC_PLLSource_PREDIV1 ((uint32_t)0x00010000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_PREDIV1))
#endif
Как ИМХО должно быть (судя по TRM модуль RCC иной лишь в connectrivity line и только в нём нет RCC_PLLSource_HSE_Div2 т.к. там имеется PLL2):
Код
#define RCC_PLLSource_HSI_Div2 ((uint32_t)0x00000000)
#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
# define RCC_PLLSource_HSE_Div1 ((uint32_t)0x00010000)
# define RCC_PLLSource_HSE_Div2 ((uint32_t)0x00030000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_HSE_Div1) || \
((SOURCE) == RCC_PLLSource_HSE_Div2))
#elif defined (STM32F10X_CL)
# define RCC_PLLSource_PREDIV1 ((uint32_t)0x00010000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_PREDIV1))
#else
# error UNKNOWN MCU_LINE!
#endif
#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
# define RCC_PLLSource_HSE_Div1 ((uint32_t)0x00010000)
# define RCC_PLLSource_HSE_Div2 ((uint32_t)0x00030000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_HSE_Div1) || \
((SOURCE) == RCC_PLLSource_HSE_Div2))
#elif defined (STM32F10X_CL)
# define RCC_PLLSource_PREDIV1 ((uint32_t)0x00010000)
# define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
((SOURCE) == RCC_PLLSource_PREDIV1))
#else
# error UNKNOWN MCU_LINE!
#endif
Это может быть нужным при использовании внешнего кварца на 16МГц (собственно я из-за этого и наткнулся на этот косяк) и при
грамотном объявлении типа линейки STM32:
STM32F10X_LD_VL
STM32F10X_MD_VL
STM32F10X_HD_VL
STM32F10X_CL