Commit 3fa0fa7f authored by 李俭双's avatar 李俭双

🐞 fix:48025 【天鹰TY200】【欠压保护】欠压保护,电压检测时长不固定,更换电源管理库

parent 13a51f36
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include "wdt.h" #include "wdt.h"
#define u16Base_Vol 0u #define u16Base_Vol 0u
#define u16ENTER_LOW_N_RANGE 6500U #define u16ENTER_LOW_N_RANGE 7000U
#define u16EXIT_LOW_N_RANGE 7000U #define u16EXIT_LOW_N_RANGE 7500U
#define u16ENTER_LOW_Y_RANGE 9000U #define u16ENTER_LOW_Y_RANGE 9000U
#define u16EXIT_LOW_Y_RANGE 10000U #define u16EXIT_LOW_Y_RANGE 10000U
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
void Delay_ms(uint32_t u32Ms); void Delay_ms(uint32_t u32Ms);
// #pragma alignvar(8) // #pragma alignvar(8)
static const monitorlib_uint16_t SysFun_Range[24u] = { static const monitorlib_uint16_t SysFun_Range[26u] = {
u16Base_Vol, u16Base_Vol,
u16ENTER_LOW_N_RANGE, u16ENTER_LOW_N_RANGE,
...@@ -36,7 +36,7 @@ static const monitorlib_uint16_t SysFun_Range[24u] = { ...@@ -36,7 +36,7 @@ static const monitorlib_uint16_t SysFun_Range[24u] = {
u16ENTER_HIGH_N_RANGE, u16ENTER_HIGH_N_RANGE,
u16Top_Vol, u16Top_Vol,
500, /* 进入异常电压时间 1S */ 2500, /* 进入异常电压时间 5S */
50u, /* KL15消抖时间 100ms*/ 50u, /* KL15消抖时间 100ms*/
u16Base_Vol, u16Base_Vol,
...@@ -55,6 +55,9 @@ static const monitorlib_uint16_t SysFun_Range[24u] = { ...@@ -55,6 +55,9 @@ static const monitorlib_uint16_t SysFun_Range[24u] = {
u16Top_Vol, u16Top_Vol,
2u, 2u,
2u, 2u,
2u,
0u,
}; };
monitorlib_uint16_t Sys_Read_KL30_Voltage_F(void) monitorlib_uint16_t Sys_Read_KL30_Voltage_F(void)
...@@ -103,15 +106,27 @@ monitorlib_uint8_t System_LINE_KL15(void) ...@@ -103,15 +106,27 @@ monitorlib_uint8_t System_LINE_KL15(void)
{ {
monitorlib_uint8_t u8KL15 = 0; monitorlib_uint8_t u8KL15 = 0;
if (RTE_GPIO_Get_Level(WAKEUP_KL15_In) == 1u ) //if (RTE_GPIO_Get_Level(WAKEUP_KL15_In) == 1u )
//{
// u8KL15 = 1u;
//}
//else
//{
// u8KL15 = 0;
//}
if ((Sys_Read_KL15_Voltage() >= 5500u ) && (RTE_GPIO_Get_Level(WAKEUP_KL15_In) == 1u ))
{ {
u8KL15 = 1u; u8KL15 = 1u;
} }
else if((Sys_Read_KL15_Voltage() >= 5000u)&&(Sys_Read_KL15_Voltage() < 5500u))
{
;
}
else else
{ {
u8KL15 = 0; u8KL15 = 0;
} }
return u8KL15; return u8KL15;
} }
......
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