mirror of
https://github.com/lora-aprs/LoRa_APRS_Tracker.git
synced 2025-12-06 07:12:15 +01:00
looks like GPS is getting a hickup... is it because of the power management chip?
This commit is contained in:
parent
4228ffe235
commit
17f7a12ef8
|
|
@ -45,6 +45,7 @@ void setup()
|
||||||
powerManagement.activateLoRa();
|
powerManagement.activateLoRa();
|
||||||
powerManagement.activateOLED();
|
powerManagement.activateOLED();
|
||||||
powerManagement.activateGPS();
|
powerManagement.activateGPS();
|
||||||
|
powerManagement.activateMeasurement();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delay(500);
|
delay(500);
|
||||||
|
|
@ -97,8 +98,7 @@ void loop()
|
||||||
|
|
||||||
if(send_update && gps.location.isValid() && gps.location.isUpdated())
|
if(send_update && gps.location.isValid() && gps.location.isUpdated())
|
||||||
{
|
{
|
||||||
nextBeaconTimeStamp = nowTimeStamp + (BEACON_TIMEOUT * SECS_PER_MIN);
|
powerManagement.deactivateMeasurement();
|
||||||
breakTime(nextBeaconTimeStamp, nextBeaconStruct);
|
|
||||||
send_update = false;
|
send_update = false;
|
||||||
|
|
||||||
APRSMessage msg;
|
APRSMessage msg;
|
||||||
|
|
@ -118,6 +118,7 @@ void loop()
|
||||||
// APRS Data:
|
// APRS Data:
|
||||||
LoRa.write((const uint8_t *)data.c_str(), data.length());
|
LoRa.write((const uint8_t *)data.c_str(), data.length());
|
||||||
LoRa.endPacket();
|
LoRa.endPacket();
|
||||||
|
powerManagement.activateMeasurement();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gps_time_update)
|
if(gps_time_update)
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,6 @@ bool PowerManagement::begin(TwoWire & port)
|
||||||
if(!result)
|
if(!result)
|
||||||
{
|
{
|
||||||
axp.setDCDC1Voltage(3300);
|
axp.setDCDC1Voltage(3300);
|
||||||
// Enable AXP ADC function
|
|
||||||
axp.adc1Enable(AXP202_BATT_CUR_ADC1 |
|
|
||||||
AXP202_BATT_VOL_ADC1,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -57,6 +53,21 @@ void PowerManagement::decativateOLED()
|
||||||
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF);
|
axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PowerManagement::activateMeasurement()
|
||||||
|
{
|
||||||
|
axp.adc1Enable(AXP202_BATT_CUR_ADC1 |
|
||||||
|
AXP202_BATT_VOL_ADC1,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PowerManagement::deactivateMeasurement()
|
||||||
|
{
|
||||||
|
axp.adc1Enable(AXP202_BATT_CUR_ADC1 |
|
||||||
|
AXP202_BATT_VOL_ADC1,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
double PowerManagement::getBatteryVoltage()
|
double PowerManagement::getBatteryVoltage()
|
||||||
{
|
{
|
||||||
return axp.getBattVoltage() / 1000.0;
|
return axp.getBattVoltage() / 1000.0;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ public:
|
||||||
void activateOLED();
|
void activateOLED();
|
||||||
void decativateOLED();
|
void decativateOLED();
|
||||||
|
|
||||||
|
void activateMeasurement();
|
||||||
|
void deactivateMeasurement();
|
||||||
|
|
||||||
double getBatteryVoltage();
|
double getBatteryVoltage();
|
||||||
double getBatteryChargeDischargeCurrent();
|
double getBatteryChargeDischargeCurrent();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue