handle change-led in in process-loop
This commit is contained in:
parent
5a28898255
commit
5623096732
|
@ -152,6 +152,14 @@ void loop()
|
|||
batteryVoltage = String(powerManagement.getBatteryVoltage(), 2);
|
||||
batteryChargeCurrent = String(powerManagement.getBatteryChargeDischargeCurrent(), 0);
|
||||
}
|
||||
if (powerManagement.isChargeing())
|
||||
{
|
||||
powerManagement.enableChgLed();
|
||||
}
|
||||
else
|
||||
{
|
||||
powerManagement.disableChgLed();
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!send_update && gps_loc_update && Config.smart_beacon.active)
|
||||
|
|
|
@ -29,6 +29,18 @@ void PowerManagement::deactivateLoRa()
|
|||
axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void PowerManagement::disableChgLed()
|
||||
{
|
||||
axp.setChgLEDMode(AXP20X_LED_OFF);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void PowerManagement::enableChgLed()
|
||||
{
|
||||
axp.setChgLEDMode(AXP20X_LED_LOW_LEVEL);
|
||||
}
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
void PowerManagement::activateGPS()
|
||||
{
|
||||
|
@ -89,3 +101,8 @@ bool PowerManagement::isBatteryConnect()
|
|||
{
|
||||
return axp.isBatteryConnect();
|
||||
}
|
||||
|
||||
bool PowerManagement::isChargeing()
|
||||
{
|
||||
return axp.isChargeing();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@ public:
|
|||
PowerManagement();
|
||||
bool begin(TwoWire & port);
|
||||
|
||||
void enableChgLed();
|
||||
void disableChgLed();
|
||||
|
||||
void activateLoRa();
|
||||
void deactivateLoRa();
|
||||
|
||||
|
@ -26,6 +29,7 @@ public:
|
|||
double getBatteryChargeDischargeCurrent();
|
||||
|
||||
bool isBatteryConnect();
|
||||
bool isChargeing();
|
||||
|
||||
private:
|
||||
AXP20X_Class axp;
|
||||
|
|
Loading…
Reference in a new issue