mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-28 21:55:11 +00:00
* simplified alertIf()
* refactored TimeSeriesData to top-level class
This commit is contained in:
@@ -21,12 +21,12 @@ protected:
|
||||
void onSensorDataRead() override {
|
||||
float batt_voltage = getVoltage(TELEM_CHANNEL_SELF);
|
||||
|
||||
recordData(battery_data, batt_voltage); // record battery
|
||||
alertIfLow(low_batt, batt_voltage, 3.4f, "Battery low!");
|
||||
battery_data.recordData(getRTCClock(), batt_voltage); // record battery
|
||||
alertIf(batt_voltage < 3.4f, low_batt, "Battery low!");
|
||||
}
|
||||
|
||||
int querySeriesData(uint32_t start_secs_ago, uint32_t end_secs_ago, MinMaxAvg dest[], int max_num) override {
|
||||
calcDataMinMaxAvg(battery_data, start_secs_ago, end_secs_ago, &dest[0], TELEM_CHANNEL_SELF, LPP_VOLTAGE);
|
||||
battery_data.calcDataMinMaxAvg(getRTCClock(), start_secs_ago, end_secs_ago, &dest[0], TELEM_CHANNEL_SELF, LPP_VOLTAGE);
|
||||
return 1;
|
||||
}
|
||||
/* ======================================================================= */
|
||||
|
||||
Reference in New Issue
Block a user