RomeHein / ESPecial

ESP32 automation with web interface and telegram bot
GNU General Public License v3.0
111 stars 17 forks source link

addAutomation error for esp32-C3 #21

Closed josef2600 closed 1 year ago

josef2600 commented 1 year ago

it compiles for s3 and other esp32, but not for C3. i don't know why! working on it.

PreferenceHandler.cpp:1043:8: error: no declaration matches 'String PreferenceHandler::addAutomation(const char*, int, const int16_t (*)[4], char (*)[4][100], int, int)' String PreferenceHandler::addAutomation(const char* label,int autoRun,const int16_t conditions[MAX_AUTOMATIONS_CONDITIONS_NUMBER][4], ^~~~~~~~~~~~~~~~~ In file included from D:\micro\2023\Home_Automation_v5\wifi\ESPecial\new\ESPecial\PreferenceHandler.cpp:1: D:\micro\2023\Home_Automation_v5\wifi\ESPecial\new\ESPecial\PreferenceHandler.h:198:12: note: candidate is: 'String PreferenceHandler::addAutomation(const char*, int, const int16_t (*)[4], char (*)[4][100], int, int32_t)' String addAutomation(const char* label, int autoRun,const int16_t conditions[MAX_AUTOMATIONS_CONDITIONS_NUMBER][4], ^~~~~~~~~~~~~ D:\micro\2023\Home_Automation_v5\wifi\ESPecial\new\ESPecial\PreferenceHandler.h:141:7: note: 'class PreferenceHandler' defined here class PreferenceHandler ^~~~~~~~~~~~~~~~~ PreferenceHandler.cpp:1059:8: error: no declaration matches 'String PreferenceHandler::editAutomation(AutomationFlash&, const char*, int, const int16_t (*)[4], char (*)[4][100], int, int)' String PreferenceHandler::editAutomation(AutomationFlash& automation, const char* newLabel, int newAutoRun, ^~~~~~~~~~~~~~~~~ In file included from D:\micro\2023\Home_Automation_v5\wifi\ESPecial\new\ESPecial\PreferenceHandler.cpp:1: D:\micro\2023\Home_Automation_v5\wifi\ESPecial\new\ESPecial\PreferenceHandler.h:201:12: note: candidate is: 'String PreferenceHandler::editAutomation(AutomationFlash&, const char*, int, const int16_t (*)[4], char (*)[4][100], int, int32_t)' String editAutomation(AutomationFlash& automation, const char* newLabel,int newAutoRun, ^~~~~~~~~~~~~~ D:\micro\2023\Home_Automation_v5\wifi\ESPecial\new\ESPecial\PreferenceHandler.h:141:7: note: 'class PreferenceHandler' defined here class PreferenceHandler ^~~~~~~~~~~~~~~~~

josef2600 commented 1 year ago

wooooooooooo! that was stupid! why? yeah! the compiler doesn't do its job??!! in the files PreferenceHandler.h and PreferenceHandler.cpp there is a difference! guess what?! it doesn't recognize = 0 ! ether i am getting real dumb or, i don't know what! if i change this: ` String addAutomation(const char* label, int autoRun,const int16_t conditions[MAX_AUTOMATIONS_CONDITIONS_NUMBER][4], char actions[MAX_AUTOMATION_ACTION_NUMBER][4][MAX_MESSAGE_TEXT_SIZE],int loopCount = 0, int32_t debounceDelay = 0);

String editAutomation(AutomationFlash& automation, const char* newLabel,int newAutoRun,
    const int16_t newConditions[MAX_AUTOMATIONS_CONDITIONS_NUMBER][4],char newActions[MAX_AUTOMATION_ACTION_NUMBER][4][MAX_MESSAGE_TEXT_SIZE], 
    int newLoopCount, int32_t newDebounceDelay);

to this: String addAutomation(const char* label,int autoRun,const int16_t conditions[MAX_AUTOMATIONS_CONDITIONS_NUMBER][4], char actions[MAX_AUTOMATION_ACTION_NUMBER][4][100], int loopCount,int debounceDelay);

String editAutomation(AutomationFlash& automation, const char* newLabel, int newAutoRun,
                                    const int16_t newConditions[MAX_AUTOMATIONS_NUMBER][4],
                                    char newActions[MAX_AUTOMATION_ACTION_NUMBER][4][100], int newLoopCount,int newDebounceDelay);

it compiles with no problem! remember i disabled all things that C3 doesn't have. eg: psram - camera - DAC ... //#define i_haveexternalDS1307 //#define i_havepsram //#define i_have_internal_touch //#define i_have_internal_DAC //#define i_have_camera

define i_am___esp32c3

`

josef2600 commented 1 year ago

remember, it only make this error for C3, not any others. for all esp32 that i checked, it compiles. eg: S3 S2 old ones ...

RomeHein commented 1 year ago

I'm not sure to understand how ESPecial could work on other esp32 like the S3 , C3 and S2. ESPecial was coded using the dual processors. So if any of these esp32 is single core, it won't work for sure. Compilation maybe, but more than this, I'm unsure :)

josef2600 commented 1 year ago

as i said, i have made many changes now. i have tested it, and it works, but still has a few problems. right now it hangs in certain situations. i will create an issue for it.