system: refactoring & delays clean-up

- BREAKING replace loadavg and system check from millis to seconds
- implement all available system clocks, make sure it is correctly
  scaled with the origin type
- fix duration::{millis(),ccount(),seconds()} and return a respective
  clock's time_point instead of duration. just like led sources, make
  sure every module stores timestamps as time_point and intervals as
  duration
- no need to track millis overflow on top of existing overflow counter
  of the micros64 in getUptime
- remove class overhead in led static delays conversion, just try to
  inline the required calculations and use NAME as unique id

also fix some non-apparent issues with heartbeat
- allow zero interval when it is also Mode::Once
- iterating runners to find the interval might return zero
This commit is contained in:
Maxim Prokhorov
2021-11-25 19:06:18 +03:00
parent 2fe5fc6c34
commit 1ca98880d6
14 changed files with 829 additions and 523 deletions

View File

@@ -394,12 +394,14 @@ void boardSetup() {
return;
}
DEBUG_MSG_P(PSTR("[MAIN] %s %s built %s\n"), getAppName(), getVersion(), buildTime().c_str());
DEBUG_MSG_P(PSTR("[MAIN] %s %s built %s\n"),
getAppName(), getVersion(), buildTime().c_str());
DEBUG_MSG_P(PSTR("[MAIN] %s\n"), getAppAuthor());
DEBUG_MSG_P(PSTR("[MAIN] %s\n"), getAppWebsite());
DEBUG_MSG_P(PSTR("[MAIN] CPU chip ID: %s\n"), getFullChipId().c_str());
DEBUG_MSG_P(PSTR("[MAIN] SDK: %s\n"), ESP.getSdkVersion());
DEBUG_MSG_P(PSTR("[MAIN] Arduino Core: %s\n"), getCoreVersion().c_str());
DEBUG_MSG_P(PSTR("[MAIN] CPU chip ID: %s frequency: %hhuMHz\n"),
getFullChipId().c_str(), system_get_cpu_freq());
DEBUG_MSG_P(PSTR("[MAIN] SDK: %s Arduino Core: %s\n"),
ESP.getSdkVersion(), getCoreVersion().c_str());
DEBUG_MSG_P(PSTR("[MAIN] Support: %s\n"), getEspurnaModules());
#if SENSOR_SUPPORT
DEBUG_MSG_P(PSTR("[MAIN] Sensors: %s\n"), getEspurnaSensors());