4.0.1 ядро для 8266

This commit is contained in:
Dmitry Borisenko
2022-09-14 18:53:02 +02:00
parent 49dde6031a
commit 8ce79687bc
11 changed files with 208 additions and 204 deletions

View File

@@ -54,21 +54,21 @@ class Bmp280p : public IoTItem {
};
void* getAPI_Bmp280(String subtype, String param) {
if (subtype == F("Bmp280t") || subtype == F("Bmp280p")) {
String addr;
jsonRead(param, "addr", addr);
if (bmps.find(addr) == bmps.end()) {
bmps[addr] = new Adafruit_BMP280();
bmps[addr]->begin(hexStringToUint8(addr));
}
if (subtype == F("Bmp280t")) {
return new Bmp280t(bmps[addr], param);
} else if (subtype == F("Bmp280p")) {
return new Bmp280p(bmps[addr], param);
}
} else {
return nullptr;
}
// if (subtype == F("Bmp280t") || subtype == F("Bmp280p")) {
// String addr;
// jsonRead(param, "addr", addr);
//
// if (bmps.find(addr) == bmps.end()) {
// bmps[addr] = new Adafruit_BMP280();
// bmps[addr]->begin(hexStringToUint8(addr));
// }
//
// if (subtype == F("Bmp280t")) {
// return new Bmp280t(bmps[addr], param);
// } else if (subtype == F("Bmp280p")) {
// return new Bmp280p(bmps[addr], param);
// }
//} else {
return nullptr;
//}
}