Merge pull request #62 from lora-aprs/sbias-master

Sbias master
This commit is contained in:
Peter Buchegger 2022-05-13 21:38:02 +02:00 committed by GitHub
commit ea6ba8ca73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View file

@ -175,6 +175,12 @@ void loop() {
} }
#endif #endif
if (powerManagement.isChargeing()) {
powerManagement.enableChgLed();
} else {
powerManagement.disableChgLed();
}
if (!send_update && gps_loc_update && BeaconMan.getCurrentBeaconConfig()->smart_beacon.active) { if (!send_update && gps_loc_update && BeaconMan.getCurrentBeaconConfig()->smart_beacon.active) {
uint32_t lastTx = millis() - lastTxTime; uint32_t lastTx = millis() - lastTxTime;
currentHeading = gps.course.deg(); currentHeading = gps.course.deg();

View file

@ -44,6 +44,16 @@ void PowerManagement::decativateOLED() {
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF); axp.setPowerOutPut(AXP192_DCDC1, 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::activateMeasurement() { void PowerManagement::activateMeasurement() {
axp.adc1Enable(AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, true); axp.adc1Enable(AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, true);
@ -70,3 +80,7 @@ double PowerManagement::getBatteryChargeDischargeCurrent() {
bool PowerManagement::isBatteryConnect() { bool PowerManagement::isBatteryConnect() {
return axp.isBatteryConnect(); return axp.isBatteryConnect();
} }
bool PowerManagement::isChargeing() {
return axp.isChargeing();
}

View file

@ -18,6 +18,9 @@ public:
void activateOLED(); void activateOLED();
void decativateOLED(); void decativateOLED();
void enableChgLed();
void disableChgLed();
void activateMeasurement(); void activateMeasurement();
void deactivateMeasurement(); void deactivateMeasurement();
@ -25,6 +28,7 @@ public:
double getBatteryChargeDischargeCurrent(); double getBatteryChargeDischargeCurrent();
bool isBatteryConnect(); bool isBatteryConnect();
bool isChargeing();
private: private:
AXP20X_Class axp; AXP20X_Class axp;