fix bug with last_values
This commit is contained in:
parent
2ebcac04b7
commit
ddec85f57e
|
|
@ -156,7 +156,7 @@ void setup(void)
|
|||
|
||||
setup_platform();
|
||||
SetupScales(config_data.debug_level);
|
||||
ClearLoraData();
|
||||
ClearLoraData(true);
|
||||
setup_bme280();
|
||||
|
||||
setup_flash();
|
||||
|
|
@ -382,7 +382,7 @@ void loop()
|
|||
}
|
||||
}
|
||||
|
||||
void ClearLoraData(void)
|
||||
void ClearLoraData(bool clearLastValues)
|
||||
{
|
||||
lora_data.version = LORA_DATA_VERSION;
|
||||
lora_data.vbat = 0;
|
||||
|
|
@ -412,6 +412,7 @@ void ClearLoraData(void)
|
|||
my_position = 0;
|
||||
|
||||
// We initialize last_sensor_reading
|
||||
if (clearLastValues) {
|
||||
last_sensor_reading.vbat = 0;
|
||||
last_sensor_reading.weight1 = 0;
|
||||
last_sensor_reading.weight2 = 0;
|
||||
|
|
@ -420,6 +421,7 @@ void ClearLoraData(void)
|
|||
last_sensor_reading.humidity = 0;
|
||||
last_sensor_reading.pressure = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowLORAData(bool firstTime)
|
||||
{
|
||||
|
|
@ -859,7 +861,7 @@ void startSendingUplink(bool firstTime, bool confirmed)
|
|||
}
|
||||
}
|
||||
|
||||
ClearLoraData();
|
||||
ClearLoraData(false);
|
||||
}
|
||||
|
||||
static void sendBufferDoneCb(
|
||||
|
|
|
|||
Loading…
Reference in New Issue