mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-30 14:16:32 +00:00
Add tests for result
This commit is contained in:
parent
850d240d2e
commit
c67922241c
@ -240,7 +240,18 @@ boolean XdrvCall(byte Function)
|
||||
for (byte x = 0; x < xdrv_present; x++) {
|
||||
// WifiAddDelayWhenDisconnected();
|
||||
result = xdrv_func_ptr[x](Function);
|
||||
if (result) break;
|
||||
|
||||
if (result && ((FUNC_COMMAND == Function) ||
|
||||
(FUNC_MQTT_DATA == Function) ||
|
||||
(FUNC_RULES_PROCESS == Function) ||
|
||||
(FUNC_BUTTON_PRESSED == Function) ||
|
||||
(FUNC_SERIAL == Function) ||
|
||||
(FUNC_MODULE_INIT == Function) ||
|
||||
(FUNC_SET_CHANNELS == Function) ||
|
||||
(FUNC_SET_DEVICE_POWER == Function)
|
||||
)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -17,6 +17,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef USE_DISPLAY
|
||||
|
||||
#ifdef XFUNC_PTR_IN_ROM
|
||||
boolean (* const xdsp_func_ptr[])(byte) PROGMEM = { // Display Function Pointers
|
||||
#else
|
||||
@ -123,8 +125,13 @@ boolean XdspCall(byte Function)
|
||||
|
||||
for (byte x = 0; x < xdsp_present; x++) {
|
||||
result = xdsp_func_ptr[x](Function);
|
||||
if (result) break;
|
||||
|
||||
if (result && (FUNC_DISPLAY_MODEL == Function)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // USE_DISPLAY
|
||||
|
@ -17,6 +17,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef USE_ENERGY_SENSOR
|
||||
|
||||
#ifdef XFUNC_PTR_IN_ROM
|
||||
int (* const xnrg_func_ptr[])(byte) PROGMEM = { // Energy driver Function Pointers
|
||||
#else
|
||||
@ -96,7 +98,14 @@ int XnrgCall(byte Function)
|
||||
|
||||
for (byte x = 0; x < xnrg_present; x++) {
|
||||
result = xnrg_func_ptr[x](Function);
|
||||
if (result) break;
|
||||
|
||||
if (result && ((FUNC_SERIAL == Function) ||
|
||||
(FUNC_COMMAND == Function)
|
||||
)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // USE_ENERGY_SENSOR
|
||||
|
Loading…
x
Reference in New Issue
Block a user