mirror of
https://github.com/anklimov/lighthub
synced 2025-12-09 21:29:49 +03:00
Cross compilation fixes (esp) & binaries
This commit is contained in:
@@ -641,7 +641,7 @@ aJsonObject *templateParamObj = NULL;
|
||||
int res = -1;
|
||||
|
||||
// trying to find parameter in template with name == subItem (NB!! standard suffixes dint working here)
|
||||
if (subItem && strlen (subItem))
|
||||
if (subItem && strlen (subItem) && store && store->parameters)
|
||||
|
||||
{
|
||||
templateParamObj = aJson.getObjectItem(store->parameters, subItem);
|
||||
@@ -651,12 +651,12 @@ else
|
||||
|
||||
// No subitem, trying to find suffix with root item - (Trying to find template parameter where id == suffixCode)
|
||||
{
|
||||
templateParamObj = store->parameters->child;
|
||||
if (store && store->parameters) templateParamObj = store->parameters->child;
|
||||
bool suffixFinded = false;
|
||||
while (templateParamObj)
|
||||
{
|
||||
aJsonObject *idObj = aJson.getObjectItem(templateParamObj, "id");
|
||||
if (idObj->type==aJson_Int && idObj->valueint == suffixCode)
|
||||
if (idObj && idObj->type==aJson_Int && idObj->valueint == suffixCode)
|
||||
{
|
||||
res= sendItemCmd(templateParamObj,cmd);
|
||||
suffixFinded = true;
|
||||
|
||||
@@ -147,7 +147,7 @@ int out_relay::Ctrl(itemCmd cmd, char* subItem, bool toExecute)
|
||||
{
|
||||
debugSerial<<F("relayCtr: ");
|
||||
cmd.debugOut();
|
||||
if (! strcmp_P(subItem,action_P)) return 0;
|
||||
if ((subItem && !strcmp_P(subItem,action_P)) || !item) return 0;
|
||||
int suffixCode;
|
||||
if (cmd.isCommand()) suffixCode = S_CMD;
|
||||
else suffixCode = cmd.getSuffix();
|
||||
|
||||
@@ -160,11 +160,18 @@ itemCmd getNumber(char **chan) {
|
||||
return val;
|
||||
}
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32) || defined(ESP8266)
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
unsigned long freeRam ()
|
||||
{
|
||||
return esp_get_free_heap_size();//heap_caps_get_free_size();
|
||||
//return system_get_free_heap_size();
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ESP8266)
|
||||
unsigned long freeRam ()
|
||||
{
|
||||
return system_get_free_heap_size();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user