small change with confirmed logic, FW-Version 20240624

This commit is contained in:
Joerg Lehmann 2024-06-24 18:10:17 +02:00
parent ec7a10f5ff
commit 111fd2cd52
1 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,7 @@ BME280 bme280;
/******************************************************************************/ /******************************************************************************/
/* Firmware Version */ /* Firmware Version */
/******************************************************************************/ /******************************************************************************/
static const int32_t fwVersion = 20240622; static const int32_t fwVersion = 20240624;
/******************************************************************************/ /******************************************************************************/
/* LoraWAN Settings */ /* LoraWAN Settings */
@ -226,6 +226,7 @@ bool start_new_iteration = false;
bool next_package_is_init_package = true; bool next_package_is_init_package = true;
uint32_t gRebootMs; uint32_t gRebootMs;
char last_channel = 'X'; char last_channel = 'X';
bool toobigweightchange = false;
/******************************************************************************/ /******************************************************************************/
/* Functions for Global Data Structures */ /* Functions for Global Data Structures */
@ -879,6 +880,7 @@ bool TooBigWeightChange()
Serial.printf("TooBigWeightChange (my_position: %d): %d...\n", my_position, big_difference); Serial.printf("TooBigWeightChange (my_position: %d): %d...\n", my_position, big_difference);
} }
toobigweightchange = big_difference;
return big_difference; return big_difference;
} }
@ -980,7 +982,7 @@ void loop()
{ {
if (ReadSensors(false)) { if (ReadSensors(false)) {
// we send confirmed packages when weight change is too big or for every init package // we send confirmed packages when weight change is too big or for every init package
isTxConfirmed = (TooBigWeightChange()) || (iteration <= INIT_PACKETS) || (iteration % INIT_PACKAGE_INTERVAL == 0); isTxConfirmed = (toobigweightchange) || (iteration <= INIT_PACKETS) || (iteration % INIT_PACKAGE_INTERVAL == 0);
prepareTxFrame(appPort); prepareTxFrame(appPort);
LoRaWAN.send(); LoRaWAN.send();
package_counter++; package_counter++;