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);
|
batteryVoltage = String(powerManagement.getBatteryVoltage(), 2);
|
||||||
batteryChargeCurrent = String(powerManagement.getBatteryChargeDischargeCurrent(), 0);
|
batteryChargeCurrent = String(powerManagement.getBatteryChargeDischargeCurrent(), 0);
|
||||||
}
|
}
|
||||||
|
if (powerManagement.isChargeing())
|
||||||
|
{
|
||||||
|
powerManagement.enableChgLed();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
powerManagement.disableChgLed();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!send_update && gps_loc_update && Config.smart_beacon.active)
|
if(!send_update && gps_loc_update && Config.smart_beacon.active)
|
||||||
|
|
|
@ -29,6 +29,18 @@ void PowerManagement::deactivateLoRa()
|
||||||
axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF);
|
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
|
// cppcheck-suppress unusedFunction
|
||||||
void PowerManagement::activateGPS()
|
void PowerManagement::activateGPS()
|
||||||
{
|
{
|
||||||
|
@ -89,3 +101,8 @@ bool PowerManagement::isBatteryConnect()
|
||||||
{
|
{
|
||||||
return axp.isBatteryConnect();
|
return axp.isBatteryConnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PowerManagement::isChargeing()
|
||||||
|
{
|
||||||
|
return axp.isChargeing();
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,9 @@ public:
|
||||||
PowerManagement();
|
PowerManagement();
|
||||||
bool begin(TwoWire & port);
|
bool begin(TwoWire & port);
|
||||||
|
|
||||||
|
void enableChgLed();
|
||||||
|
void disableChgLed();
|
||||||
|
|
||||||
void activateLoRa();
|
void activateLoRa();
|
||||||
void deactivateLoRa();
|
void deactivateLoRa();
|
||||||
|
|
||||||
|
@ -26,6 +29,7 @@ public:
|
||||||
double getBatteryChargeDischargeCurrent();
|
double getBatteryChargeDischargeCurrent();
|
||||||
|
|
||||||
bool isBatteryConnect();
|
bool isBatteryConnect();
|
||||||
|
bool isChargeing();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AXP20X_Class axp;
|
AXP20X_Class axp;
|
||||||
|
|
Loading…
Reference in a new issue