WXK
2023-08-29 7e5e286a011abedb6d5862c123474c5eb97d27eb
FML/Power.c
@@ -13,6 +13,7 @@
#include "Uart.h"
#include "HIDO_Debug.h"
#include "WS2812.h"
#include "GPS.h"
extern uint32_t uwbled,gpsled,loraled,powerled;
extern uint32_t lp_time;
extern uint32_t led_timer;
@@ -108,6 +109,7 @@
 * Author            : www.hido-studio.com
 * Modified Date:    : 2020年11月10日
 *******************************************************************************/
extern HIDO_VOID GPS_PowerOff(void);
HIDO_VOID Power_GPS_LoraOff(HIDO_VOID)
{
   GPIO_RESET(&l_astPowerPin[POWER_PIN_GPS_LORA]);
@@ -123,6 +125,9 @@
 * Author            : hido.ltd
 *******************************************************************************/
extern uint8_t nomove_flag;
extern  void Set4LEDColor_Off(void);
extern void MX_Init(void);
extern  void SystemClock_Config(void);
void Power_Sleep(void)
{
extern ADC_HandleTypeDef hadc;
@@ -142,7 +147,7 @@
    if(nomove_flag==0)
    Set4LEDColor_Off(); //关led总电源
    
    GPIO_InitTypeDef GPIO_InitStruct = {0};
    GPIO_InitTypeDef GPIO_InitStruct = {0};//
  GPIO_InitStruct.Pin = GPIO_PIN_4;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
@@ -193,7 +198,7 @@
  
//  LEDON_POLL();
if(lp_time%2==0&&lp_time!=led_timer)
if(lp_time%2==0&&lp_time!=led_timer)//电源灯2s闪烁一次,电量大于20闪蓝灯反之闪红灯。
{
    if(bat_percent>=20)
    {powerled=BLUE;}