Skip to content

Commit

Permalink
fix: 修复宏定义被覆盖的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfSweet committed Nov 8, 2023
1 parent 1e21827 commit edccd72
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions variants/AIR001/AIR001_DEV/generic_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ WEAK void SystemClock_Config(void)
#if defined(AIR001xx_HSI_4M_HCLK_4M)
#ifdef HSI_VALUE
#undef HSI_VALUE
#define HSI_VALUE 4000000U
#endif
#define HSI_VALUE 4000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* 开启HSI */
Expand Down Expand Up @@ -69,8 +69,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSI_8M_HCLK_8M)
#ifdef HSI_VALUE
#undef HSI_VALUE
#define HSI_VALUE 8000000U
#endif
#define HSI_VALUE 8000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* 开启HSI */
Expand Down Expand Up @@ -99,8 +99,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSI_16M_HCLK_16M)
#ifdef HSI_VALUE
#undef HSI_VALUE
#define HSI_VALUE 16000000U
#endif
#define HSI_VALUE 16000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* 开启HSI */
Expand Down Expand Up @@ -129,8 +129,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSI_22_12M_HCLK_22_12M)
#ifdef HSI_VALUE
#undef HSI_VALUE
#define HSI_VALUE 22120000U
#endif
#define HSI_VALUE 22120000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* 开启HSI */
Expand Down Expand Up @@ -159,8 +159,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSI_24M_HCLK_24M)
#ifdef HSI_VALUE
#undef HSI_VALUE
#define HSI_VALUE 24000000U
#endif
#define HSI_VALUE 24000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* 开启HSI */
Expand Down Expand Up @@ -189,8 +189,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSI_24M_HCLK_48M)
#ifdef HSI_VALUE
#undef HSI_VALUE
#define HSI_VALUE 24000000U
#endif
#define HSI_VALUE 24000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* 开启HSI */
Expand Down Expand Up @@ -219,8 +219,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSE_8M_HCLK_8M)
#ifdef HSE_VALUE
#undef HSE_VALUE
#define HSE_VALUE 8000000U
#endif
#define HSE_VALUE 8000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSE; /* 选择RCC振荡器为HSE */
RCC_OscInitStruct.HSIState = RCC_HSI_OFF; /* 开启HSI */
Expand Down Expand Up @@ -250,8 +250,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSE_16M_HCLK_16M)
#ifdef HSE_VALUE
#undef HSE_VALUE
#define HSE_VALUE 16000000U
#endif
#define HSE_VALUE 16000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSE; /* 选择RCC振荡器为HSE */
RCC_OscInitStruct.HSIState = RCC_HSI_OFF; /* 开启HSI */
Expand Down Expand Up @@ -281,8 +281,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSE_24M_HCLK_24M)
#ifdef HSE_VALUE
#undef HSE_VALUE
#define HSE_VALUE 24000000U
#endif
#define HSE_VALUE 24000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSE; /* 选择RCC振荡器为HSE */
RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
Expand Down Expand Up @@ -312,8 +312,8 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSE_32M_HCLK_32M)
#ifdef HSE_VALUE
#undef HSE_VALUE
#define HSE_VALUE 32000000U
#endif
#define HSE_VALUE 32000000U
/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSE; /* 选择RCC振荡器为HSE */
RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
Expand Down Expand Up @@ -343,8 +343,9 @@ WEAK void SystemClock_Config(void)
#elif defined(AIR001xx_HSE_24M_HCLK_48M)
#ifdef HSE_VALUE
#undef HSE_VALUE
#define HSE_VALUE 24000000U
#endif
#define HSE_VALUE 24000000U

/* 振荡器配置 */
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSE; /* 选择RCC振荡器为HSE */
RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
Expand Down

0 comments on commit edccd72

Please sign in to comment.