Cross compilation fixes (esp) & binaries

This commit is contained in:
2022-10-04 01:37:47 +03:00
parent 891701cee1
commit 39cfb42307
19 changed files with 44434 additions and 43638 deletions

View File

@@ -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;

View File

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

View File

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