Commit d312a3c3 authored by 时昊's avatar 时昊

feat:背光点亮,按键调通

parent abd6e7ae
......@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>BAT32A239KK64FB</Device>
<Vendor>Cmsemicon</Vendor>
<PackID>Cmsemicon.BAT32A239.1.0.3</PackID>
<PackID>Cmsemicon.BAT32A239.1.0.5</PackID>
<PackURL>http://www.mcu.com.cn/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x08000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
......@@ -275,8 +275,8 @@
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x8000</StartAddress>
<Size>0x38000</Size>
<StartAddress>0x0</StartAddress>
<Size>0x40000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
......@@ -1156,7 +1156,7 @@
<file attr="config" category="source" name="Device\Source\isr_BAT32A239.c" version="1.0.0">
<instance index="0">RTE\Device\BAT32A239KK64FB\isr_BAT32A239.c</instance>
<component Cclass="Device" Cgroup="ISR" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/>
<targetInfos>
<targetInfo name="HaoJin232"/>
</targetInfos>
......@@ -1164,7 +1164,7 @@
<file attr="config" category="source" condition="Startup ARM" name="Device\Source\ARM\startup_BAT32A239.s" version="1.0.0">
<instance index="0">RTE\Device\BAT32A239KK64FB\startup_BAT32A239.s</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/>
<targetInfos>
<targetInfo name="HaoJin232"/>
</targetInfos>
......@@ -1172,7 +1172,7 @@
<file attr="config" category="source" name="Device\Source\system_BAT32A239.c" version="1.0.0">
<instance index="0">RTE\Device\BAT32A239KK64FB\system_BAT32A239.c</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/>
<targetInfos>
<targetInfo name="HaoJin232"/>
</targetInfos>
......@@ -1180,7 +1180,7 @@
<file attr="config" category="header" name="Device\Source\userdefine.h" version="1.0.0">
<instance index="0">RTE\Device\BAT32A239KK64FB\userdefine.h</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/>
<targetInfos>
<targetInfo name="HaoJin232"/>
</targetInfos>
......
......@@ -18,7 +18,7 @@ User definitions
typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define APP_BASE (0x00008000ul)
/* Status list definition */
......
......@@ -19,30 +19,31 @@ void BackLight_Process(void)
{
if (SYS_OPR_STAT_IGN_ON)
{
if(ALS_Get_Data1() > 200)//data1 500以内,data0 3000以内
{
if (g_Light.Light_Day < 15)//1.5s 1500ms
{
g_Light.Light_Day++;//100ms
}
else
{
g_Light.Light_Night = 0;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
}
else
{
if (g_Light.Light_Night < 15)
{
g_Light.Light_Night++;
}
else
{
g_Light.Light_Day = 0;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
}
}
// if(ALS_Get_Data1() > 200)//data1 500以内,data0 3000以内
// {
// if (g_Light.Light_Day < 15)//1.5s 1500ms
// {
// g_Light.Light_Day++;//100ms
// }
// else
// {
// g_Light.Light_Night = 0;
// TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
// }
// }
// else
// {
// if (g_Light.Light_Night < 15)
// {
// g_Light.Light_Night++;
// }
// else
// {
// g_Light.Light_Day = 0;
// TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
// }
// }
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
else
{
......
......@@ -1646,7 +1646,7 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
{
IC1_SEG059 = IC_SEG_ON;
IC1_SEG058 = IC_SEG_ON;
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 100);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 100);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 100);
}
else
......@@ -1655,7 +1655,7 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
{
IC1_SEG059 = IC_SEG_ON;
IC1_SEG058 = IC_SEG_ON;
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 100);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 100);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 100);
}
else
......@@ -1664,14 +1664,14 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
{
IC1_SEG059 = IC_SEG_OFF;
IC1_SEG058 = IC_SEG_ON;
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 100);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 100);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 0);
}
else
{
IC1_SEG059 = IC_SEG_ON;
IC1_SEG058 = IC_SEG_OFF;
LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 0);
//LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 100);
}
}
......
......@@ -76,14 +76,14 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//Set
Key_Status_en_t Key_Status_Read_Left(void)
{
Key_Status_en_t enKeyReal = KEY_REALTIME_LOOSEN;
//if (RTE_GPIO_Get_Level(MODE_P_IN))
//{
// enKeyReal = KEY_REALTIME_LOOSEN;
//}
//else
//{
// enKeyReal = KEY_REALTIME_PRESS;
//}
if (RTE_GPIO_Get_Level(Key_MCU_IN))
{
enKeyReal = KEY_REALTIME_LOOSEN;
}
else
{
enKeyReal = KEY_REALTIME_PRESS;
}
return enKeyReal;
}
Key_Status_en_t Key_Status_Read_Right(void)
......
......@@ -78,7 +78,7 @@ static void Power_KL30_Init(void)
g_stRTCInformation.u8RTCDayOfMonth = 1;
g_stRTCInformation.u8RTCMonth = 1;
g_stRTCInformation.u8RTCYear = 20;
RTE_RTC_Init(g_stRTCInformation);
//RTE_RTC_Init(g_stRTCInformation);
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(WAKEUP_KL15_In,Trigger_Rising);
}
......
......@@ -69,12 +69,12 @@ void Sys_50ms_Tasks(void)
uint8_t u8LEDDriverCheckCount = 0U;
void Sys_100ms_Tasks(void)
{
if((PageType != Page_Time_Hour)&&(PageType != Page_Time_Minute))
{
RTE_RTC_Get_CounterValue(&counter_val);
counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
}
// if((PageType != Page_Time_Hour)&&(PageType != Page_Time_Minute))
// {
// RTE_RTC_Get_CounterValue(&counter_val);
// counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
// counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
// }
Fuel_Cal_Sevice(100u);
BackLight_Process();
Services_Mileage_Callback();
......
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