first version of cron, does not read configuation from file

This commit is contained in:
Emanuele Trabattoni
2025-07-26 16:05:03 +02:00
parent 91f4c5c750
commit 448e1bad15
8 changed files with 1129 additions and 9 deletions

View File

@@ -180,6 +180,12 @@ namespace drivers
const std::string PCF85063::datetime2str(const datetime_t &datetime)
{
tm dtime = datetime2tm(datetime);
const std::string buf(std::asctime(&dtime));
return buf.substr(0, std::min(buf.find('\n'),buf.find('\r')));
}
const std::tm PCF85063::datetime2tm(const datetime_t& datetime) {
tm dtime;
dtime.tm_sec = datetime.second;
dtime.tm_min = datetime.minute;
@@ -188,8 +194,7 @@ namespace drivers
dtime.tm_mday = datetime.day;
dtime.tm_mon = datetime.month - 1;
dtime.tm_year = datetime.year - 1900; // time offset in structure according cpp reference
const std::string buf(std::asctime(&dtime));
return buf.substr(0, std::min(buf.find('\n'),buf.find('\r')));
return dtime;
}
const uint8_t PCF85063::decToBcd(const int val)