Commit d86ced18 authored by 张明扬's avatar 张明扬 🇨🇳
parents 89324ceb bed48f07
......@@ -48,6 +48,8 @@ void BackLight_Process(void)
// }
//}
//if ( LED_Turnon == 5 )
if (Common_GetIgnOnTime() >= 3000)
{
if (Line_In_Get_Status(LINE_IN_Little_Lamp))
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
......@@ -56,6 +58,11 @@ void BackLight_Process(void)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
}
else
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
}
else
......
......@@ -50,28 +50,29 @@ typedef struct
} HYS_Seg_Table_st_t;
const HYS_Seg_Table_st_t stHYSSegTableTemp[7] =
{
{0U, 470U}, // 0
{500U, 590U}, // 1
{620U, 770U}, // 2
{800U, 950U}, // 3
{980U, 1120U}, // 4
{1150U, 1990U}, // 5
{1990U, 2000U}, // 6
{0U, 4700U}, // 0
{5000U, 5900U}, // 1
{6200U, 7700U}, // 2
{8000U, 9500U}, // 3
{9800U, 11200U}, // 4
{11500U, 19900U}, // 5
{19900U, 20000U}, // 6
};
uint32_t u32CoolantDataTimeCount = 0UL;
uint32_t u32ColCurNum = 0UL; /*阻尼数显*/
uint32_t u32CoolantNum = 0UL;/*当前实际数据,与显示数值不完全一致*/
/*
u32CoolantDir:0:下行,1:上行 2:无变化
*/
uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir, uint32_t u32CoolantRemTime, uint32_t u32CoolantCurNum, uint32_t u32CoolantDesNum)
{
uint32_t u32CoolantNum = u32CoolantCurNum;
uint32_t u32CoolantNumMax = 0UL;
uint32_t u32CoolantNumMin = 0UL;
uint32_t u32CoolantSegDesNum = 0UL;
uint32_t u32CoolantCalBuf = 0UL;
uint32_t u32CoolantCalBuf1 = 0UL;
uint32_t u32CoolantCalResult = u32CoolantCurNum;
/*计算当前格对应的目标数值*/
/*当前格数对应的数值范围,目标数值是否在这个范围内,如果在就直接用目标值。如果不在就根据上下行选择该范围内的极大和极小值。*/
......@@ -138,17 +139,52 @@ uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir,
u32CoolantNum = u32CoolantSegDesNum;
}
}
u32CoolantCalResult = u32CoolantNum;
if (u32CoolantDir == 0) // down
{
// uint32_t u32CoolantCalBuf2 = 0UL;
// if (u32CoolantNum>u32CoolantCurNum)
// {
// u32CoolantCalBuf2 = u32CoolantNum-u32CoolantCurNum;
// }
// else
// {
// u32CoolantCalBuf2 = u32CoolantCurNum-u32CoolantNum;
// }
// if (u32CoolantCalBuf2>=100)
// {
// u32CoolantNum+=99UL;
// }
if ((u32CoolantNum+99)>=u32CoolantCurNum)
{
u32CoolantCalResult= u32CoolantCurNum;
}
else
{
u32CoolantCalResult= ((u32CoolantNum+99)/100*100);
}
}
}
else // 0
{
u32CoolantNum = u32CoolantSegDesNum;
u32CoolantCalResult = u32CoolantNum;
}
}
/*根据目标数值计算每个变化周期内数值变化的大小,*/
/*根据目标数值以及剩余时间,修改当前显示值*/
return u32CoolantNum;
// return u32CoolantNum;
return u32CoolantCalResult;
}
void Data_Coolant_Temp_Processing_Service(void)
......@@ -278,7 +314,7 @@ void Data_Coolant_Temp_Display ( void )
if(DataCoolantTemp_Dis.u8_CurSeg > DataCoolantTemp_Dis.u8_DestSeg )
{
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 0, (DataCoolantTemp_Dis.u8_Downtimer - DataCoolantTemp_Dis.u8_DownFlashtimer), u32ColCurNum, DataCoolantTemp.Value*10);
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 0, (DataCoolantTemp_Dis.u8_Downtimer - DataCoolantTemp_Dis.u8_DownFlashtimer), u32ColCurNum, DataCoolantTemp.Value*100);
DataCoolantTemp_Dis.u8_UpFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_DownFlashtimer++;
......@@ -290,7 +326,7 @@ void Data_Coolant_Temp_Display ( void )
}
else if (DataCoolantTemp_Dis.u8_CurSeg < DataCoolantTemp_Dis.u8_DestSeg)
{
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 1, (DataCoolantTemp_Dis.u8_Uptimer - DataCoolantTemp_Dis.u8_UpFlashtimer), u32ColCurNum, DataCoolantTemp.Value*10);
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 1, (DataCoolantTemp_Dis.u8_Uptimer - DataCoolantTemp_Dis.u8_UpFlashtimer), u32ColCurNum, DataCoolantTemp.Value*100);
DataCoolantTemp_Dis.u8_DownFlashtimer = 0;
DataCoolantTemp_Dis.u8_Holdtimer = 0;
DataCoolantTemp_Dis.u8_UpFlashtimer++;
......@@ -311,7 +347,7 @@ void Data_Coolant_Temp_Display ( void )
}
/*目标格和当前格一致时,数显如何处理*/
/*5S后更新为目标数值*/
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 2, (CoolantFlashtimer-DataCoolantTemp_Dis.u8_Holdtimer ), u32ColCurNum, DataCoolantTemp.Value*10);
u32ColCurNum = Data_Coolant_Cal_Num(DataCoolantTemp_Dis.u8_CurSeg, 2, (CoolantFlashtimer-DataCoolantTemp_Dis.u8_Holdtimer ), u32ColCurNum, DataCoolantTemp.Value*100);
}
// warning
......@@ -322,11 +358,11 @@ void Data_Coolant_Temp_Display ( void )
}
else
{
if (DataCoolantTemp.Value >= 115)
if (GET_DataCoolantSegValue() >= 115)
{
DataCoolantTemp_Dis.u8_Warnflg = 2;
}
else if (DataCoolantTemp.Value <= 112)
else if (GET_DataCoolantSegValue() <= 112)
{
DataCoolantTemp_Dis.u8_Warnflg = 0;
}
......@@ -462,7 +498,7 @@ uint16_t GET_DataCoolantTempValueDisp(void)
}
uint16_t GET_DataCoolantSegValue(void)
{
return u32ColCurNum/10;
return (u32ColCurNum)/100;
}
uint8_t GET_DataCollantTempValueValid(void)
{
......
......@@ -50,9 +50,10 @@ static void Power_KL30_Init(void)
eeprom_StoreInfo_Init();
Can_Init();
Data_TPMS_KL30_Init ();
CAN_TX_Count_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
Data_TPMS_KL30_Init ();
DFlash_init();
Data_Read_DiagPara();
......@@ -75,7 +76,7 @@ static void Power_KL30_Init(void)
Fuel_KL30_Init();
Data_Voltage_Init();
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 1260, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400);
// TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High);
......@@ -132,7 +133,7 @@ static void Power_Wakeup_Init(void)
Fuel_KL30_Init();
Data_Voltage_Init();
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 1260, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400);
// TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High);
......@@ -207,7 +208,11 @@ static void Power_Sleep_Init(void)
LED_Driver_Service();
Analog_Signal_Conv_Stop();
UART_DeInit(UART0);
//if(RTE_GPIO_Get_Level(WAKEUP_KL15_In) == 0)
{
RTE_DEEPSLEEP_Enable();
}
}
static Power_Status_em Power_Stay_ON(void)
......
#include "cgc.h"
uint8_t USE_HSE_SYSTYEM_CLOCK = SYSTYEM_CLOCK_CLOSE;
uint8_t USE_HSI_SYSTYEM_CLOCK = SYSTYEM_CLOCK_CLOSE;
uint8_t USE_LSE_SYSTYEM_CLOCK = SYSTYEM_CLOCK_CLOSE;
uint8_t USE_LSI_SYSTYEM_CLOCK = SYSTYEM_CLOCK_CLOSE;
/**
* @brief Enables or disables the PER0 peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
......@@ -127,32 +122,29 @@ void CGC_Osc_Setting(OSC_Pin_Mode_t main,OSC_Speed_Mode_t amph, OSC_Pin_Mode_t s
uint8_t tmp;
tmp = 0x00;
if(main == OSC_PORT )
if(main == OSC_OSCILLATOR)
{
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (0 << CGC_CMC_OSCSEL_Pos);
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos) | (((uint8_t)amph) << CGC_CMC_AMPH_Pos);
}
if(sub == OSC_PORT )
else if(main == OSC_PORT )
{
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (0 << CGC_CMC_OSCSELS_Pos);
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (0 << CGC_CMC_OSCSEL_Pos);
}
if(main == OSC_OSCILLATOR)
else if(main == OSC_EXCLK)
{
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos) | (1 << CGC_CMC_AMPH_Pos);
tmp |= (1 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos);
}
if(sub == OSC_OSCILLATOR)
{
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (1 << CGC_CMC_OSCSELS_Pos) | (1 << CGC_CMC_AMPHS_Pos);
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (1 << CGC_CMC_OSCSELS_Pos) | (((uint8_t)amphs) << CGC_CMC_AMPHS_Pos);
}
if(main == OSC_EXCLK)
else if(sub == OSC_PORT )
{
tmp |= (1 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos);
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (0 << CGC_CMC_OSCSELS_Pos);
}
if(sub == OSC_EXCLK)
else if(sub == OSC_EXCLK)
{
tmp |= (1 << CGC_CMC_EXCLKS_Pos) | (1 << CGC_CMC_OSCSELS_Pos);
}
......@@ -160,7 +152,7 @@ void CGC_Osc_Setting(OSC_Pin_Mode_t main,OSC_Speed_Mode_t amph, OSC_Pin_Mode_t s
CGC->CMC = tmp;
/* Set fMX */
CGC->CSC &= ~(1<<7) ; //MSTOP = 0
CGC->CSC &= ~(1 << CGC_CSC_MSTOP_Pos) ; //MSTOP = 0
if(main == OSC_OSCILLATOR)
{
......@@ -175,7 +167,7 @@ void CGC_Osc_Setting(OSC_Pin_Mode_t main,OSC_Speed_Mode_t amph, OSC_Pin_Mode_t s
}
/* Set fSUB */
CGC->CSC &= ~(1<<6) ; //XTSTOP = 0
CGC->CSC &= ~(1 << CGC_CSC_XTSTOP_Pos) ; //XTSTOP = 0
if(sub == OSC_OSCILLATOR)
{
......@@ -206,24 +198,24 @@ void CGC_Osc_Setting(OSC_Pin_Mode_t main,OSC_Speed_Mode_t amph, OSC_Pin_Mode_t s
*/
void CGC_LSEConfig(OSC_Pin_Mode_t sub, OSC_Power_Mode_t amphs)
{
/* Check the parameters */
volatile uint32_t w_count;
uint8_t tmp;
assert_param(IS_CGC_LSE_MODE(sub));
/* Check the parameters */
assert_param(IS_CGC_OSC_PIN_MODE(sub));
assert_param(IS_CGC_LSE_PWR_MODE(amphs));
tmp = 0x00;
if(sub == OSC_PORT )
{
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (0 << CGC_CMC_OSCSELS_Pos);
}
if(sub == OSC_OSCILLATOR)
{
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (1 << CGC_CMC_OSCSELS_Pos) | (amphs << CGC_CMC_AMPHS_Pos);
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (1 << CGC_CMC_OSCSELS_Pos) | (((uint8_t)amphs) << CGC_CMC_AMPHS_Pos);
}
if(sub == OSC_EXCLK)
else if(sub == OSC_PORT)
{
tmp |= (0 << CGC_CMC_EXCLKS_Pos) | (0 << CGC_CMC_OSCSELS_Pos);
}
else if(sub == OSC_EXCLK)
{
tmp |= (1 << CGC_CMC_EXCLKS_Pos) | (1 << CGC_CMC_OSCSELS_Pos);
}
......@@ -231,7 +223,7 @@ void CGC_LSEConfig(OSC_Pin_Mode_t sub, OSC_Power_Mode_t amphs)
CGC->CMC = tmp;
/* Set fSUB */
CGC->CSC &= ~(1<<6) ; //XTSTOP = 0
CGC->CSC &= ~(1 << CGC_CSC_XTSTOP_Pos) ; //XTSTOP = 0
if(sub == OSC_OSCILLATOR)
{
......@@ -261,27 +253,25 @@ void CGC_LSEConfig(OSC_Pin_Mode_t sub, OSC_Power_Mode_t amphs)
*/
void CGC_HSEConfig(OSC_Pin_Mode_t main, OSC_Speed_Mode_t amph)
{
/* Check the parameters */
volatile uint32_t w_count;
uint8_t temp_stab_set;
uint8_t temp_stab_wait;
uint8_t tmp;
assert_param(IS_CGC_LSE_MODE(main));
/* Check the parameters */
assert_param(IS_CGC_OSC_PIN_MODE(main));
assert_param(IS_CGC_HSE_OSC_SPEED(amph));
tmp = 0x00;
if(main == OSC_PORT )
{
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (0 << CGC_CMC_OSCSEL_Pos);
}
if(main == OSC_OSCILLATOR)
{
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos) | (amph << CGC_CMC_AMPH_Pos);
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos) | (((uint8_t)amph) << CGC_CMC_AMPH_Pos);
}
if(main == OSC_EXCLK)
else if(main == OSC_PORT )
{
tmp |= (0 << CGC_CMC_EXCLK_Pos) | (0 << CGC_CMC_OSCSEL_Pos);
}
else if(main == OSC_EXCLK)
{
tmp |= (1 << CGC_CMC_EXCLK_Pos) | (1 << CGC_CMC_OSCSEL_Pos);
}
......@@ -289,7 +279,7 @@ void CGC_HSEConfig(OSC_Pin_Mode_t main, OSC_Speed_Mode_t amph)
CGC->CMC = tmp;
/* Set fMX */
CGC->CSC &= ~(1<<7) ; //MSTOP = 0
CGC->CSC &= ~(1 << CGC_CSC_MSTOP_Pos) ; //MSTOP = 0
if(main == OSC_OSCILLATOR)
{
......@@ -304,7 +294,17 @@ void CGC_HSEConfig(OSC_Pin_Mode_t main, OSC_Speed_Mode_t amph)
}
}
/* Clock switching needs to be executed in SRAM */
#if defined (__CC_ARM)
#pragma arm section code = "RW_FUNC_PLL" // Arm Compiler 5
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION > 6010050)
#pragma clang section text = "RW_FUNC_PLL" // Arm Compiler 6
#endif
#if defined(__ICCARM__)
__ramfunc
#endif
/**
* @brief Enables External Low Speed oscillator (LSE/Fsub) used as CPU
......@@ -315,9 +315,12 @@ void CGC_HSEConfig(OSC_Pin_Mode_t main, OSC_Speed_Mode_t amph)
void CGC_LSE_CFG_AS_FCLK()
{
CGC->CKC = (1 << CGC_CKC_CSS_Pos) | (0 << CGC_CKC_MCM0_Pos);
__NOP();
__NOP();
__NOP();
__NOP();
while ((CGC->CKC & CGC_CKC_CLS_Msk) == 0);
USE_LSE_SYSTYEM_CLOCK = SYSTYEM_CLOCK_OPEN;
}
/**
......@@ -329,8 +332,11 @@ void CGC_LSE_CFG_AS_FCLK()
void CGC_HSE_CFG_AS_FCLK()
{
CGC->CKC = (0 << CGC_CKC_CSS_Pos) | (1 << CGC_CKC_MCM0_Pos );
__NOP();
__NOP();
__NOP();
__NOP();
while((CGC->CKC & CGC_CKC_MCS_Msk) == 0);
USE_HSE_SYSTYEM_CLOCK = SYSTYEM_CLOCK_OPEN;
}
/**
......@@ -342,12 +348,48 @@ void CGC_HSE_CFG_AS_FCLK()
*/
void CGC_HSI_CFG_AS_FCLK()
{
CGC->CKC = 0 << CGC_CKC_CSS_Pos ;
if (CGC->MCKC & CGC_MCKC_CKSTR_Msk)
{
CGC->MCKC &= ~(1 << CGC_MCKC_CKSELR_Pos);
__NOP();
__NOP();
__NOP();
__NOP();
while(CGC->MCKC & CGC_MCKC_CKSTR_Msk);
}
CGC->CKC = (0 << CGC_CKC_CSS_Pos) | (0 << CGC_CKC_MCM0_Pos );
__NOP();
__NOP();
__NOP();
__NOP();
while((CGC->CKC & (CGC_CKC_CSS_Msk | CGC_CKC_MCS_Msk)));
}
while((CGC->CKC & CGC_CKC_CSS_Msk) == 1);
USE_HSI_SYSTYEM_CLOCK = SYSTYEM_CLOCK_OPEN;
/**
* @brief Enables output frequency by PLL used as CPU
* system clock and Clock source of peripheral hardware circuit.
* @note
* @retval None
*/
__attribute__((section("RW_FUNC_PLL"))) void CGC_PLL_CFG_AS_FCLK(void)
{
CGC->MCKC |= (1 << CGC_MCKC_CKSELR_Pos);
__NOP();
__NOP();
__NOP();
__NOP();
while((CGC->MCKC & CGC_MCKC_CKSTR_Msk) == 0);
CGC->CKC = (0 << CGC_CKC_CSS_Pos) | (0 << CGC_CKC_MCM0_Pos );
__NOP();
__NOP();
__NOP();
__NOP();
while(CGC->CKC & CGC_CKC_CSS_Msk);
}
#if 0
/**
* @brief Enables External High Speed oscillator (HSE) used as MAIN system clock
* which can provided for clock output/buzzer or CPU/peripheral hardware circuit.
......@@ -356,7 +398,11 @@ void CGC_HSI_CFG_AS_FCLK()
*/
void CGC_HSE_CFG_AS_FMAIN()
{
CGC->CKC = 1 << CGC_CKC_MCM0_Pos;
CGC->CKC = (1 << CGC_CKC_MCM0_Pos);
__NOP();
__NOP();
__NOP();
__NOP();
while((CGC->CKC & CGC_CKC_MCS_Msk) == 0);
}
/**
......@@ -367,9 +413,20 @@ void CGC_HSE_CFG_AS_FMAIN()
*/
void CGC_HSI_CFG_AS_FMAIN()
{
CGC->CKC = 0 << CGC_CKC_MCM0_Pos;
while((CGC->CKC & CGC_CKC_MCS_Msk) == 1);
CGC->CKC = (0 << CGC_CKC_MCM0_Pos);
__NOP();
__NOP();
__NOP();
__NOP();
while(CGC->CKC & CGC_CKC_MCS_Msk);
}
#endif
#if defined (__CC_ARM)
#pragma arm section code // Arm Compiler 5
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION > 6010050)
#pragma clang section text = "" // Arm Compiler 6
#endif
/**
* @brief Setting PLL used as system clock and Clock source of peripheral hardware circuit.
......@@ -424,7 +481,7 @@ void CGC_PLL_Setting(PLL_Src_t src, PLL_Div_t div, PLL_Mul_t mul)
CGC->PLLCR = tmp;
CGC->PLLCR |= 1<<0; /* PLLON = 1 */
CGC->PLLCR |= (1 << CGC_PLLCR_PLLON_Pos); /* PLLON = 1 */
for (i = 0U; i <= 2000; i++)
{
__NOP();
......@@ -432,19 +489,6 @@ void CGC_PLL_Setting(PLL_Src_t src, PLL_Div_t div, PLL_Mul_t mul)
}
/**
* @brief Enables output frequency by PLL used as CPU
* system clock and Clock source of peripheral hardware circuit.
* @note
* @retval None
*/
__attribute__((section("RW_FUNC_PLL"))) void CGC_PLL_CFG_AS_FCLK(void)
{
CGC->MCKC = 0x01;
while((CGC->MCKC & CGC_MCKC_CKSTR_Msk) == 0);
USE_HSE_SYSTYEM_CLOCK = SYSTYEM_CLOCK_OPEN;
}
/**
* @brief This function stops the main system clock oscilator (MOSC).
* @param None
......@@ -452,7 +496,7 @@ __attribute__((section("RW_FUNC_PLL"))) void CGC_PLL_CFG_AS_FCLK(void)
*/
void CGC_MainOsc_Stop(void)
{
CGC->CSC |= 1<<7; /* MSTOP = 1 */
CGC->CSC |= (1 << CGC_CSC_MSTOP_Pos); /* MSTOP = 1 */
}
/**
......@@ -462,7 +506,7 @@ void CGC_MainOsc_Stop(void)
*/
void CGC_MainOsc_Start(void)
{
CGC->CSC &= ~(1<<7); /* MSTOP = 0 */
CGC->CSC &= ~(1 << CGC_CSC_MSTOP_Pos); /* MSTOP = 0 */
}
/**
......@@ -472,7 +516,7 @@ void CGC_MainOsc_Start(void)
*/
void CGC_SubOsc_Stop(void)
{
CGC->CSC |= 1<<6; /* XTSTOP = 1 */
CGC->CSC |= (1 << CGC_CSC_XTSTOP_Pos); /* XTSTOP = 1 */
}
/**
......@@ -482,7 +526,7 @@ void CGC_SubOsc_Stop(void)
*/
void CLK_SubOsc_Start(void)
{
CGC->CSC &= ~(1<<6); /* XTSTOP = 0 */
CGC->CSC &= ~(1 << CGC_CSC_XTSTOP_Pos); /* XTSTOP = 0 */
}
/**
......@@ -492,7 +536,7 @@ void CLK_SubOsc_Start(void)
*/
void CGC_Hoco_Stop(void)
{
CGC->CSC |= 1<<0; /* HIOSTOP = 1 */
CGC->CSC |= (1 << CGC_CSC_HIOSTOP_Pos); /* HIOSTOP = 1 */
}
/**
......@@ -502,5 +546,5 @@ void CGC_Hoco_Stop(void)
*/
void CGC_Hoco_Start(void)
{
CGC->CSC &= ~(1<<0); /* HIOSTOP = 0 */
CGC->CSC &= ~(1 << CGC_CSC_HIOSTOP_Pos); /* HIOSTOP = 0 */
}
......@@ -311,13 +311,13 @@
#define CheckSumErr 7 // Checksum Error
#define UnknownPartID 8 // Unknown Part ID
#define SWV 0x100 // 0x100 = 1.00 software version 软件版本号
#define SWV 0x115 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x103 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x100 // 0x100 = 1.00 bootloader version boot程序版本号
#define INTLV 0x112 // 0x100 = 1.00 internal version 内部版本号
#define INTLV 0x115 // 0x100 = 1.00 internal version 内部版本号
#define PROG_Y 0x24 // 0x24 = 2024年, program year
#define PROG_M 0x08 // 0x03 = 3月, program month
#define PROG_D 0x14 // 0x19 = 19日, program day
#define PROG_D 0x17 // 0x19 = 19日, program day
/******************************************************************************
Bootloader Variable
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment