libretiny

This commit is contained in:
Mit4el
2024-09-20 12:45:17 +03:00
parent b32abb5a28
commit 596eb9cad4
78 changed files with 8577 additions and 63 deletions

View File

@@ -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();
}

View File

@@ -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) {

View File

@@ -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
}
// данная функция уже перенесена в ядро и будет удалена в последствии

View File

@@ -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() {

View File

@@ -77,7 +77,7 @@ public:
if (httpCode > 0)
{
ret = httpCode;
ret = String(httpCode);
if (httpCode == HTTP_CODE_OK)
{