From 111fd2cd5268c06a827c9f4488b9d1dedf088454 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Mon, 24 Jun 2024 18:10:17 +0200 Subject: [PATCH] small change with confirmed logic, FW-Version 20240624 --- MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino b/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino index e1c0df1..d818772 100644 --- a/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino +++ b/MiniBeieliNodeSketch/MiniBeieliNodeSketch.ino @@ -12,7 +12,7 @@ BME280 bme280; /******************************************************************************/ /* Firmware Version */ /******************************************************************************/ -static const int32_t fwVersion = 20240622; +static const int32_t fwVersion = 20240624; /******************************************************************************/ /* LoraWAN Settings */ @@ -226,6 +226,7 @@ bool start_new_iteration = false; bool next_package_is_init_package = true; uint32_t gRebootMs; char last_channel = 'X'; +bool toobigweightchange = false; /******************************************************************************/ /* Functions for Global Data Structures */ @@ -879,6 +880,7 @@ bool TooBigWeightChange() Serial.printf("TooBigWeightChange (my_position: %d): %d...\n", my_position, big_difference); } + toobigweightchange = big_difference; return big_difference; } @@ -980,7 +982,7 @@ void loop() { if (ReadSensors(false)) { // 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); LoRaWAN.send(); package_counter++;