Commit 5c35c886 authored by 张金硕's avatar 张金硕

feat:配置P14_7AD端口为输入模式采集电压,修改可调背光等级数量及PWM占空比,修改主题模式自动时的逻辑

parent 7780a58f
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</OCR_RVCT3> </OCR_RVCT3>
<OCR_RVCT4> <OCR_RVCT4>
<Type>1</Type> <Type>1</Type>
<StartAddress>0xc400</StartAddress> <StartAddress>0x0</StartAddress>
<Size>0x73c00</Size> <Size>0x73c00</Size>
</OCR_RVCT4> </OCR_RVCT4>
<OCR_RVCT5> <OCR_RVCT5>
...@@ -361,7 +361,7 @@ ...@@ -361,7 +361,7 @@
</VariousControls> </VariousControls>
</Aads> </Aads>
<LDads> <LDads>
<umfTarg>0</umfTarg> <umfTarg>1</umfTarg>
<Ropi>0</Ropi> <Ropi>0</Ropi>
<Rwpi>0</Rwpi> <Rwpi>0</Rwpi>
<noStLib>0</noStLib> <noStLib>0</noStLib>
...@@ -968,16 +968,16 @@ ...@@ -968,16 +968,16 @@
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\PicBin.h</FilePath> <FilePath>..\..\..\..\Source\Component\AMT630H\PicBin.h</FilePath>
</File> </File>
<File>
<FileName>UartProtocol.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath>
</File>
<File> <File>
<FileName>UartProtocol_V1.32_BAT32A239.lib</FileName> <FileName>UartProtocol_V1.32_BAT32A239.lib</FileName>
<FileType>4</FileType> <FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol_V1.32_BAT32A239.lib</FilePath> <FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol_V1.32_BAT32A239.lib</FilePath>
</File> </File>
<File>
<FileName>UartProtocol.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath>
</File>
<File> <File>
<FileName>AMT630H_Datas.c</FileName> <FileName>AMT630H_Datas.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision *** ; *** Scatter-Loading Description File generated by uVision ***
; ************************************************************* ; *************************************************************
LR_IROM1 0x0000c400 0x00073C00 { ; load region size_region LR_IROM1 0x00000000 0x00073C00 { ; load region size_region
ER_IROM1 0x0000c400 0x00073C00 { ; load address = execution address ER_IROM1 0x00000000 0x00073C00 { ; load address = execution address
*.o (RESET, +First) *.o (RESET, +First)
*(InRoot$$Sections) *(InRoot$$Sections)
.ANY (+RO) .ANY (+RO)
......
...@@ -20,7 +20,7 @@ User definitions ...@@ -20,7 +20,7 @@ User definitions
typedef unsigned short MD_STATUS; typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0 #define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define APP_BASE (0x0000C400ul) #define APP_BASE (0x0000C400ul)
/* Status list definition */ /* Status list definition */
......
...@@ -30,7 +30,7 @@ typedef struct ...@@ -30,7 +30,7 @@ typedef struct
} _st_BacklightLevel; } _st_BacklightLevel;
#define Backlight_Max 10 #define Backlight_Max 10
#define BacklightLevel_Max 10 #define BacklightLevel_Max 5
_st_Backlight BacklightTable[Backlight_Max] = _st_Backlight BacklightTable[Backlight_Max] =
{ {
/*温度 阻值 */ /*温度 阻值 */
...@@ -50,9 +50,9 @@ _st_BacklightLevel BacklightLevelTable[BacklightLevel_Max] = ...@@ -50,9 +50,9 @@ _st_BacklightLevel BacklightLevelTable[BacklightLevel_Max] =
/*背光等级 背光占空比 */ /*背光等级 背光占空比 */
{1, 100}, {1, 100},
{2, 200}, {2, 200},
{3, 300}, {3, 400},
{4, 400}, {4, 600},
{5, 500}, {5, 800},
}; };
...@@ -116,37 +116,32 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并 ...@@ -116,37 +116,32 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并
timeCount += deltaTime; timeCount += deltaTime;
if(LightADCompleteFlg) if(LightADCompleteFlg)
{ {
if(LightR_Status == 0) if(LightR <= 800)
{ {
LightR_Status_Count++;
if(LightR >20) if(LightR_Status_Count>=150)
{ {
LightR_Status_Count++; LightR_Status_Count = 0;
} LightR_Status = 0;
else }
}
else if(LightR > 800)
{
LightR_Status_Count++;
if(LightR_Status_Count>=150)
{ {
LightR_Status_Count = 0 ; LightR_Status_Count = 0;
} LightR_Status = 1;
}
}
if(LightR_Status == 0)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 200); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 200);
} }
else else
{ {
if(LightR <20) TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 800);
{
LightR_Status_Count++;
}
else
{
LightR_Status_Count = 0 ;
}
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 800);
} }
if(LightR_Status_Count>=150)
{
LightR_Status_Count = 0;
LightR_Status = !LightR_Status;
}
} }
} }
......
...@@ -80,7 +80,7 @@ void Gpio_Init(_GpioUser_Enum InitMode) ...@@ -80,7 +80,7 @@ void Gpio_Init(_GpioUser_Enum InitMode)
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN00, GpioOut_Low); //L_BD433Ctrl_OUT RTE_GPIO_Config(RTE_GPIO_PORT14_PIN00, GpioOut_Low); //L_BD433Ctrl_OUT
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN01, RTE_GPIO_DIR_IN); //L_BiasBitSW_燃油_OUT--- RTE_GPIO_Config(RTE_GPIO_PORT14_PIN01, RTE_GPIO_DIR_IN); //L_BiasBitSW_燃油_OUT---
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN06, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT14_PIN06, GpioOut_Low);
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN07, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT14_PIN07, RTE_GPIO_DIR_IN);
} }
else else
{ {
......
...@@ -85,7 +85,7 @@ const __attribute__((aligned(4))) ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBE ...@@ -85,7 +85,7 @@ const __attribute__((aligned(4))) ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBE
{ 3U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,}, { 3U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,},
{ 4U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,}, { 4U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,},
{ 5U, 3U, 0U, 5000U, 0U, 10U, ADC_Res_Calc_Circuit201,}, { 5U, 3U, 0U, 5000U, 0U, 10U, ADC_Res_Calc_Circuit201,},
{ 6U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,}, { 6U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
}; };
...@@ -97,7 +97,7 @@ const __attribute__((aligned(4))) ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_N ...@@ -97,7 +97,7 @@ const __attribute__((aligned(4))) ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_N
{ 0U, 0U, 500U, 300U,}, { 0U, 0U, 500U, 300U,},
{ 0U, 0U, 500U, 0U,}, { 0U, 0U, 500U, 0U,},
{ 47000U, 0U, 100000U, 0U,}, { 47000U, 0U, 100000U, 0U,},
{ 0U, 0U, 500U, 0U,}, { 0U, 100000U, 0U, 0U,},
}; };
/* Private function prototypes ----------------------------------------------*/ /* Private function prototypes ----------------------------------------------*/
......
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