mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Optimize rule/script processing
Optimize rule/script processing
This commit is contained in:
parent
bfad4f815f
commit
cae714e300
@ -859,7 +859,7 @@ bool XdrvMqttData(char *topicBuf, uint16_t stopicBuf, char *dataBuf, uint16_t sd
|
|||||||
|
|
||||||
bool XdrvRulesProcess(void)
|
bool XdrvRulesProcess(void)
|
||||||
{
|
{
|
||||||
return XdrvCall(FUNC_RULES_PROCESS);
|
return XdrvCallDriver(10, FUNC_RULES_PROCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_DEBUG_DRIVER
|
#ifdef USE_DEBUG_DRIVER
|
||||||
@ -872,6 +872,25 @@ void ShowFreeMem(const char *where)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*********************************************************************************************\
|
||||||
|
* Function call to single xdrv
|
||||||
|
\*********************************************************************************************/
|
||||||
|
|
||||||
|
bool XdrvCallDriver(uint32_t driver, uint8_t Function)
|
||||||
|
{
|
||||||
|
for (uint32_t x = 0; x < xdrv_present; x++) {
|
||||||
|
#ifdef XFUNC_PTR_IN_ROM
|
||||||
|
uint32_t listed = pgm_read_byte(kXdrvList + x);
|
||||||
|
#else
|
||||||
|
uint32_t listed = kXdrvList[x];
|
||||||
|
#endif
|
||||||
|
if (driver == listed) {
|
||||||
|
return xdrv_func_ptr[x](Function);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Function call to all xdrv
|
* Function call to all xdrv
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user