Добавляем модуль RTC и его поддержку в систему

This commit is contained in:
2023-02-17 20:26:29 +03:00
parent e0b8613c99
commit 1189b7c289
8 changed files with 174 additions and 2 deletions

View File

@@ -29,6 +29,8 @@ void configure(String path) {
void* driver;
// пробуем спросить драйвер GPIO
if (driver = myIoTItem->getGpioDriver()) IoTgpio.regDriver((IoTGpio*)driver);
// пробуем спросить драйвер RTC
if (driver = myIoTItem->getRtcDriver()) rtcItem = (IoTItem*)driver;
IoTItems.push_back(myIoTItem);
}
@@ -41,6 +43,9 @@ void configure(String path) {
void clearConfigure() {
Serial.printf("Start clearing config\n");
rtcItem = nullptr;
IoTgpio.clearDrivers();
for (std::list<IoTItem*>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) {
Serial.printf("Start delete iotitem %s \n", (*it)->getID().c_str());
if (*it) delete *it;