Compare commits

..

2 commits

Author SHA1 Message Date
Kai Lauterbach
e7211140af Merge branch 'develop' 2023-05-14 10:29:22 +02:00
Kai Lauterbach
9ad3db73bf Fixed target data block reading. Added some more debug output. 2023-05-14 10:29:00 +02:00
4 changed files with 4 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View file

@ -87,10 +87,7 @@ void setup()
SPIFFS.begin(); SPIFFS.begin();
#ifdef DEVELOPMENT
// Serial is not used in non development mode
Serial.begin(SERIAL_BAUD_RATE); Serial.begin(SERIAL_BAUD_RATE);
#endif
Serial.flush(); Serial.flush();
delay(1000); delay(1000);

View file

@ -165,14 +165,13 @@ void tc_update_main()
// search for the current active time slot // search for the current active time slot
for (int i = NUMBER_OF_TIMER_DATA_BLOCKS-1; i >= 0 && target_data_block == 255; --i) for (int i = NUMBER_OF_TIMER_DATA_BLOCKS-1; i >= 0 && target_data_block == 255; --i)
{ {
//Serial.println((String)tc_data[i].hh + ":" + (String)tc_data[i].mm); Serial.println((String)i + " - " + (String)tc_data[i].hh + ":" + (String)tc_data[i].mm);
if (tc_data[i].hh <= hour() && if (((tc_data[i].hh * 60) + tc_data[i].mm) <= ((hour() * 60) + minute()))
tc_data[i].mm <= minute())
{ {
target_data_block = i+1; // found the next block to load target_data_block = i+1; // found the next block to load
Serial.println((String)i + " => " + target_data_block);
} }
//Serial.println((String)i + " => " + target_data_block);
} }
if (target_data_block == 255) if (target_data_block == 255)