Commit e0e05b88 authored by 时昊's avatar 时昊

feat:修改背光初始化,和背光函数调用

parent 86dd5796
......@@ -20,7 +20,7 @@ User definitions
typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define APP_BASE (0x0000C400ul)
/* Status list definition */
......
......@@ -67,6 +67,7 @@ static void Power_KL30_Init(void)
Menu_User_Init();
Can_Init();
Protocol_KL30_Wakeup_Init();
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 100);
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN, Trigger_Rising);
}
......@@ -107,7 +108,7 @@ static void Power_OVP_Init(void)
static void Power_IG_OFF_Init(void)
{
Line_In_KL15_OFF_Init();
RTE_GPIO_Set_Level(Blacklight_PWM, 0);
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
}
static void Power_IG_ON_Init(void)
......@@ -164,18 +165,10 @@ static Power_Status_em Power_Stay_OFF(void)
}
else
{
if ((Common_GetIgnOffTime() < 1000))
if ((Common_GetIgnOffTime() < 20000))
{
u8PowerSts = EM_IGN_OFF;
}
else
{
//igoff大于1s且下15电才进休眠,否则一直保持在igoff状态
//if(Sys_Read_KL15_Voltage() < 5000)
{
u8PowerSts = EM_IGN_Sleep_Init;
}
}
}
return u8PowerSts;
......@@ -191,7 +184,7 @@ static Power_Status_em Power_Stay_Protect(void)
/* 关闭所有外设,坪保留AD采集,电溝状思切�? */
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
//CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
}
u8PowerSts = EM_IGN_OFF_Init;
/* 电溝模弝正常 */
......@@ -204,15 +197,10 @@ static Power_Status_em Power_Stay_Protect(void)
if ( SYS_OPR_STAT_RUN )
{
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
//CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
return u8PowerSts;
}
//进入异常电压,电源库里直接将15电等于0,则直接退出,状态是igoff,下15则进入休眠
// if ( SYS_OPR_STAT_IGN_OFF )
// {
// break;
// }
}
}
......
......@@ -80,6 +80,8 @@ void Sys_100ms_Tasks(void)
//Data_Mileage_Clear();
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_High);
BackLight_Process();
//TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 100);
// aaa = Menu_Item_Select_Get(MENU_ITEM_SELECT_AUTO);
}
......
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