first commit

This commit is contained in:
Tomislav Kopić 2024-06-11 19:12:09 +02:00
parent 634f2e4f1f
commit 053476718e

View File

@ -75,8 +75,17 @@ static void hal_sleep_until(timestamp_t ts) {
if (remaining <= 0) { if (remaining <= 0) {
break; break;
} }
delayMicroseconds(remaining+5000); // Delay for remaining microseconds
Serial.println(remaining); // Adjust the delay duration based on the remaining time
if (remaining >= 1000) {
delayMicroseconds(1000); // Delay for 1000 microseconds (1 millisecond)
} else if (remaining > 100) {
delayMicroseconds(100); // Delay for 100 microseconds
} else if (remaining > 10) {
delayMicroseconds(10); // Delay for 10 microseconds
} else if (remaining > 0) {
delayMicroseconds(1); // Delay for 1 microsecond
}
} }
#endif #endif
} }
@ -339,7 +348,7 @@ void setup() {
tamalib_register_hal(&hal); tamalib_register_hal(&hal);
tamalib_set_framerate(TAMA_DISPLAY_FRAMERATE); tamalib_set_framerate(TAMA_DISPLAY_FRAMERATE);
tamalib_init(1000000); tamalib_init(1010000);
#if defined(ENABLE_SAVE_STATUS) || defined(AUTO_SAVE_MINUTES) || defined(ENABLE_LOAD_STATE_FROM_EEPROM) #if defined(ENABLE_SAVE_STATUS) || defined(AUTO_SAVE_MINUTES) || defined(ENABLE_LOAD_STATE_FROM_EEPROM)
initEEPROM(); initEEPROM();