mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 13:16:32 +00:00
v5.11.1j - Provide user driver/sensor hooks 91-99
Provide user driver/sensor hooks 91-99 (#1828)
This commit is contained in:
parent
51d3419c9d
commit
0908c336ee
@ -100,9 +100,6 @@ typedef unsigned long power_t; // Power (Relay) type
|
|||||||
#define APP_BAUDRATE 115200 // Default serial baudrate
|
#define APP_BAUDRATE 115200 // Default serial baudrate
|
||||||
#define MAX_STATUS 11 // Max number of status lines
|
#define MAX_STATUS 11 // Max number of status lines
|
||||||
|
|
||||||
#define XDRV_MAX 10 // Max number of allowed Xdrv drivers (Update xdrv_interface.ino if changed)
|
|
||||||
#define XSNS_MAX 20 // Max number of allowed Xsns External Sensors (Update xsns_interface.ino if changed)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Removed from esp8266 core since 20171105
|
// Removed from esp8266 core since 20171105
|
||||||
#define min(a,b) ((a)<(b)?(a):(b))
|
#define min(a,b) ((a)<(b)?(a):(b))
|
||||||
|
@ -1211,9 +1211,7 @@ uint32_t Midnight()
|
|||||||
boolean MidnightNow()
|
boolean MidnightNow()
|
||||||
{
|
{
|
||||||
boolean mnflg = midnight_now;
|
boolean mnflg = midnight_now;
|
||||||
if (mnflg) {
|
if (mnflg) midnight_now = 0;
|
||||||
midnight_now = 0;
|
|
||||||
}
|
|
||||||
return mnflg;
|
return mnflg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1229,17 +1227,14 @@ void RtcSecond()
|
|||||||
ntp_time = sntp_get_current_timestamp();
|
ntp_time = sntp_get_current_timestamp();
|
||||||
if (ntp_time) {
|
if (ntp_time) {
|
||||||
utc_time = ntp_time;
|
utc_time = ntp_time;
|
||||||
|
ntp_sync_minute = 60; // Sync so block further requests
|
||||||
BreakTime(utc_time, tmpTime);
|
BreakTime(utc_time, tmpTime);
|
||||||
RtcTime.year = tmpTime.year + 1970;
|
RtcTime.year = tmpTime.year + 1970;
|
||||||
daylight_saving_time = RuleToTime(DaylightSavingTime, RtcTime.year);
|
daylight_saving_time = RuleToTime(DaylightSavingTime, RtcTime.year);
|
||||||
standard_time = RuleToTime(StandardTime, RtcTime.year);
|
standard_time = RuleToTime(StandardTime, RtcTime.year);
|
||||||
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION "(" D_UTC_TIME ") %s"), GetTime(0).c_str());
|
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION "(" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"),
|
||||||
|
GetTime(0).c_str(), GetTime(2).c_str(), GetTime(3).c_str());
|
||||||
AddLog(LOG_LEVEL_DEBUG);
|
AddLog(LOG_LEVEL_DEBUG);
|
||||||
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION "(" D_DST_TIME ") %s"), GetTime(2).c_str());
|
|
||||||
AddLog(LOG_LEVEL_DEBUG);
|
|
||||||
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION "(" D_STD_TIME ") %s"), GetTime(3).c_str());
|
|
||||||
AddLog(LOG_LEVEL_DEBUG);
|
|
||||||
ntp_sync_minute = 60; // Sync so block further requests
|
|
||||||
} else {
|
} else {
|
||||||
ntp_sync_minute++; // Try again in next minute
|
ntp_sync_minute++; // Try again in next minute
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,84 @@ boolean (* const xdrv_func_ptr[])(byte) PROGMEM = { // Driver Function Pointer
|
|||||||
#ifdef XDRV_10
|
#ifdef XDRV_10
|
||||||
&Xdrv10,
|
&Xdrv10,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_11
|
||||||
|
&Xdrv11,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_12
|
||||||
|
&Xdrv12,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_13
|
||||||
|
&Xdrv13,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_14
|
||||||
|
&Xdrv14,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_15
|
||||||
|
&Xdrv15,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_16
|
||||||
|
&Xdrv16,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_17
|
||||||
|
&Xdrv17,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_18
|
||||||
|
&Xdrv18,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_19
|
||||||
|
&Xdrv19,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_20
|
||||||
|
&Xdrv20,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Optional user defined drivers in range 91 - 99
|
||||||
|
|
||||||
|
#ifdef XDRV_91
|
||||||
|
&Xdrv91,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_92
|
||||||
|
&Xdrv92,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_93
|
||||||
|
&Xdrv93,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_94
|
||||||
|
&Xdrv94,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_95
|
||||||
|
&Xdrv95,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_96
|
||||||
|
&Xdrv96,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_97
|
||||||
|
&Xdrv97,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_98
|
||||||
|
&Xdrv98,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XDRV_99
|
||||||
|
&Xdrv99
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t xdrv_present = sizeof(xdrv_func_ptr) / sizeof(xdrv_func_ptr[0]); // Number of drivers found
|
const uint8_t xdrv_present = sizeof(xdrv_func_ptr) / sizeof(xdrv_func_ptr[0]); // Number of drivers found
|
||||||
|
@ -97,6 +97,92 @@ boolean (* const xsns_func_ptr[])(byte) PROGMEM = { // Sensor Function Pointers
|
|||||||
#ifdef XSNS_20
|
#ifdef XSNS_20
|
||||||
&Xsns20,
|
&Xsns20,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_21
|
||||||
|
&Xsns21,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_22
|
||||||
|
&Xsns22,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_23
|
||||||
|
&Xsns23,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_24
|
||||||
|
&Xsns24,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_25
|
||||||
|
&Xsns25,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_26
|
||||||
|
&Xsns26,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_27
|
||||||
|
&Xsns27,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_28
|
||||||
|
&Xsns28,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_29
|
||||||
|
&Xsns29,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_30
|
||||||
|
&Xsns30,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_31
|
||||||
|
&Xsns31,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_32
|
||||||
|
&Xsns32,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Optional user defined sensors in range 91 - 99
|
||||||
|
|
||||||
|
#ifdef XSNS_91
|
||||||
|
&Xsns91,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_92
|
||||||
|
&Xsns92,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_93
|
||||||
|
&Xsns93,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_94
|
||||||
|
&Xsns94,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_95
|
||||||
|
&Xsns95,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_96
|
||||||
|
&Xsns96,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_97
|
||||||
|
&Xsns97,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_98
|
||||||
|
&Xsns98,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XSNS_99
|
||||||
|
&Xsns99
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t xsns_present = sizeof(xsns_func_ptr) / sizeof(xsns_func_ptr[0]); // Number of External Sensors found
|
const uint8_t xsns_present = sizeof(xsns_func_ptr) / sizeof(xsns_func_ptr[0]); // Number of External Sensors found
|
||||||
|
Loading…
x
Reference in New Issue
Block a user