mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
libretiny
This commit is contained in:
@@ -138,12 +138,19 @@ public:
|
||||
|
||||
~BL0937wh(){};
|
||||
};
|
||||
|
||||
#if defined LIBRETINY
|
||||
void /* ICACHE_RAM_ATTR */ bl0937_cf1_interrupt()
|
||||
#else
|
||||
void ICACHE_RAM_ATTR bl0937_cf1_interrupt()
|
||||
#endif
|
||||
{
|
||||
bl0937->cf1_interrupt();
|
||||
}
|
||||
#if defined LIBRETINY
|
||||
void /* ICACHE_RAM_ATTR */ bl0937_cf_interrupt()
|
||||
#else
|
||||
void ICACHE_RAM_ATTR bl0937_cf_interrupt()
|
||||
#endif
|
||||
{
|
||||
bl0937->cf_interrupt();
|
||||
}
|
||||
|
||||
@@ -177,16 +177,21 @@ void BL0937::setResistors(double current, double voltage_upstream, double voltag
|
||||
_calculateDefaultMultipliers();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined LIBRETINY
|
||||
void /* ICACHE_RAM_ATTR */ BL0937::cf_interrupt() {
|
||||
#else
|
||||
void ICACHE_RAM_ATTR BL0937::cf_interrupt() {
|
||||
#endif
|
||||
unsigned long now = micros();
|
||||
_power_pulse_width = now - _last_cf_interrupt;
|
||||
_last_cf_interrupt = now;
|
||||
_pulse_count++;
|
||||
}
|
||||
|
||||
#if defined LIBRETINY
|
||||
void /* ICACHE_RAM_ATTR */ BL0937::cf1_interrupt() {
|
||||
#else
|
||||
void ICACHE_RAM_ATTR BL0937::cf1_interrupt() {
|
||||
|
||||
#endif
|
||||
unsigned long now = micros();
|
||||
|
||||
if ((now - _first_cf1_interrupt) > _pulse_timeout) {
|
||||
|
||||
@@ -174,7 +174,11 @@ class Loging : public IoTItem {
|
||||
SerialPrint("E", F("Loging"), "'" + id + "' db file writing error, return");
|
||||
return;
|
||||
}
|
||||
#ifdef LIBRETINY
|
||||
SerialPrint("i", F("Loging"), "'" + id + "' file created http://" + ipToString(WiFi.localIP()) + path);
|
||||
#else
|
||||
SerialPrint("i", F("Loging"), "'" + id + "' file created http://" + WiFi.localIP().toString() + path);
|
||||
#endif
|
||||
}
|
||||
|
||||
void addNewDataToExistingFile(String &path, String &logData) {
|
||||
@@ -183,7 +187,11 @@ class Loging : public IoTItem {
|
||||
SerialPrint("i", F("Loging"), "'" + id + "' file writing error, return");
|
||||
return;
|
||||
};
|
||||
#ifdef LIBRETINY
|
||||
SerialPrint("i", F("Loging"), "'" + id + "' loging in file http://" + ipToString(WiFi.localIP()) + path);
|
||||
#else
|
||||
SerialPrint("i", F("Loging"), "'" + id + "' loging in file http://" + WiFi.localIP().toString() + path);
|
||||
#endif
|
||||
}
|
||||
|
||||
// данная функция уже перенесена в ядро и будет удалена в последствии
|
||||
|
||||
@@ -139,7 +139,11 @@ class LogingDaily : public IoTItem {
|
||||
SerialPrint("E", F("LogingDaily"), "'" + id + "' db file writing error, return");
|
||||
return;
|
||||
}
|
||||
#ifdef LIBRETINY
|
||||
SerialPrint("i", F("LogingDaily"), "'" + id + "' file created http://" + ipToString(WiFi.localIP()) + path);
|
||||
#else
|
||||
SerialPrint("i", F("LogingDaily"), "'" + id + "' file created http://" + WiFi.localIP().toString() + path);
|
||||
#endif
|
||||
}
|
||||
|
||||
void addNewDataToExistingFile(String &path, String &logData) {
|
||||
@@ -148,7 +152,11 @@ class LogingDaily : public IoTItem {
|
||||
SerialPrint("i", F("LogingDaily"), "'" + id + "' file writing error, return");
|
||||
return;
|
||||
};
|
||||
#ifdef LIBRETINY
|
||||
SerialPrint("i", F("LogingDaily"), "'" + id + "' LogingDaily in file http://" + ipToString(WiFi.localIP()) + path);
|
||||
#else
|
||||
SerialPrint("i", F("LogingDaily"), "'" + id + "' LogingDaily in file http://" + WiFi.localIP().toString() + path);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool hasDayChanged() {
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
if (httpCode > 0)
|
||||
{
|
||||
ret = httpCode;
|
||||
ret = String(httpCode);
|
||||
|
||||
if (httpCode == HTTP_CODE_OK)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user