Commit be05f0a7 authored by 时昊's avatar 时昊

feat:增加common初始化函数,休眠能唤醒

parent 30182ce7
......@@ -44,6 +44,7 @@ static void Power_KL30_Init(void)
loc_config.pfnUARTConfirmCallBack = NULL;
loc_config.pfnUARTReadMsgCallBack = Amt630hUartRecvData;
RTE_UART_Init(UART_CH2, &loc_config);
Common_DataInit();
Analog_Signal_Conv_Init();
Sys_KL30_Init();
Data_Vehicle_Speed_KL30_Wakeup_Init();
......@@ -66,11 +67,12 @@ static void Power_KL30_Init(void)
Menu_User_Init();
Can_Init();
Protocol_KL30_Wakeup_Init();
//RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
}
static void Power_Wakeup_Init(void)
{
Common_DataInit();
Gpio_Init(Gpio_WakeUp_Init);
eeprom_StoreInfo_Init();
Analog_Signal_Conv_Init();
......@@ -90,7 +92,7 @@ static void Power_Wakeup_Init(void)
Menu_User_WAKEUP();
Can_Init();
Protocol_KL30_Wakeup_Init();
//RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
}
static void Power_LVP_Init(void)
......@@ -128,7 +130,10 @@ static void Power_Sleep_Init(void)
Gpio_Init(Gpio_Sleep_Init);
AMT630H_Sleep();
Analog_Signal_Conv_Stop();
RTE_DEEPSLEEP_Enable();
if (RTE_GPIO_Get_Level(KL15_AD_IN) == 0)/* KL15 */
{
RTE_DEEPSLEEP_Enable();
}
}
static Power_Status_em Power_Stay_ON(void)
......@@ -159,7 +164,7 @@ static Power_Status_em Power_Stay_OFF(void)
}
else
{
if ((Common_GetIgnOffTime() < 10000))
if ((Common_GetIgnOffTime() < 1000))
{
u8PowerSts = EM_IGN_OFF;
}
......@@ -168,7 +173,7 @@ static Power_Status_em Power_Stay_OFF(void)
//igoff大于1s且下15电才进休眠,否则一直保持在igoff状态
//if(Sys_Read_KL15_Voltage() < 5000)
{
//u8PowerSts = EM_IGN_Sleep_Init;
u8PowerSts = EM_IGN_Sleep_Init;
}
}
}
......
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