差异
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
#include "../main/SystemInclude.h"
|
||||
|
||||
/**
|
||||
* @brief ϵͳʱ<CDB3>ӳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @note <20><><EFBFBD><EFBFBD>оƬʱ<C6AC><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>(HSI)<29><>Ϊϵͳʱ<EFBFBD><EFBFBD>Դ
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ϵͳʱ<CDB3>ӳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @note <20><><EFBFBD><EFBFBD>оƬʱ<C6AC><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>(HSI) 16MHz <20><>Ϊϵͳʱ<CDB3><CAB1>Դ<EFBFBD><D4B4>
|
||||
* HCLK = 4MHz<48><7A>APB1/APB2 ʱ<>Ӿ<EFBFBD><D3BE><EFBFBD><EFBFBD><EFBFBD> HCLK<4C><4B>
|
||||
* @param <20><>
|
||||
* @example SystemClockConfiguration();
|
||||
*/
|
||||
void SystemClockConfiguration(void)
|
||||
{
|
||||
RCC_ClockInitTypeDef Clock_InitStructure;
|
||||
Clock_InitStructure.SYSCLKSource = RCC_SYSCLK_SRC_HSI_DIV2; // SYSCLK = 32M/2 = 16MHz
|
||||
Clock_InitStructure.AHBCLKDivider = RCC_SYSCLK_DIV2; // PCLK = SYSCLK/4 = 4MHz
|
||||
Clock_InitStructure.APB1CLKDivider = RCC_HCLK_DIV1; // PCLK1 = HCLK
|
||||
Clock_InitStructure.APB2CLKDivider = RCC_HCLK_DIV1; // PCKL2 = HCLK
|
||||
if (LHL_RCC_ClockConfig(&Clock_InitStructure, LHL_NRM_TIMEOUT) != LHL_OK)
|
||||
{
|
||||
while(1); // Error Handler
|
||||
}
|
||||
{
|
||||
RCC_ClockInitTypeDef Clock_InitStructure;
|
||||
Clock_InitStructure.SYSCLKSource = RCC_SYSCLK_SRC_HSI_DIV2; // SYSCLK = 32M/2 = 16MHz
|
||||
Clock_InitStructure.AHBCLKDivider = RCC_SYSCLK_DIV4; // PCLK = SYSCLK/4 = 4MHz
|
||||
Clock_InitStructure.APB1CLKDivider = RCC_HCLK_DIV1; // PCLK1 = HCLK
|
||||
Clock_InitStructure.APB2CLKDivider = RCC_HCLK_DIV1; // PCKL2 = HCLK
|
||||
if (LHL_RCC_ClockConfig(&Clock_InitStructure, LHL_NRM_TIMEOUT) != LHL_OK)
|
||||
{
|
||||
while(1); // Error Handler
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(MCO)<29><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @note <20><><EFBFBD><EFBFBD> P0.4 <20><><EFBFBD><EFBFBD>Ϊ ECLKOUT <20><><EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡʱ<D1A1><CAB1>Դ<EFBFBD>źţ<C5BA>
|
||||
* <20><>ǰʹ<C7B0><CAB9> PCLK1 <20><>Ϊ MCO <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Դ<EFBFBD><D4B4>
|
||||
* @param <20><>
|
||||
* @example System_MCO_Config();
|
||||
*/
|
||||
void System_MCO_Config(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
@@ -55,23 +65,15 @@ void System_MCO_Config(void)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void disable_interrupts(void)
|
||||
{
|
||||
__disable_irq();
|
||||
// __disable_irq();
|
||||
}
|
||||
|
||||
void enable_interrupts(void)
|
||||
{
|
||||
__enable_irq();
|
||||
// __enable_irq();
|
||||
}
|
||||
|
||||
void ResetSystem(void)
|
||||
|
||||
Reference in New Issue
Block a user