Hi,
I have recompiled my sketch that normally runs on a MEGA for arduino zero.
Had to make several changes mainly in valriables to make it work and I am now stuck to the following function which crushes on Arduino Zero.
void processReceivedResponse(){
int16_t comnd=0;
char *pch;
if (strstr(HTTP_req, "&St")) {
pch=strstr(HTTP_req, "&St");
sscanf(pch,"%*3c%d",&comnd); // <---- crushes on this line
#ifdef debugWeb
PORT_S.print(F("HTTP RCVD Command :"));
PORT_S.println (comnd);
#endif
if (comnd>0 ) { executeCommand(comnd);}
}
if (strstr(HTTP_req, "&UtdButtons")) { updateDeviceStatus();}
if (strstr(HTTP_req, "&Wl")) {
pch=strstr(HTTP_req, "&Wl");
sscanf(pch,"%*3c%d",&comnd);
#ifdef debugWeb
PORT_S.print(F("HTTP RCVD Command :Water Level Margin Set"));
PORT_S.println (comnd);
#endif
if (comnd>0 && comnd<13) {sendUniversalSwitch(liquidID[1], comnd);}
}
}
I know that this is not a complete sketch and its probably hard to pinpoint the problem from just one function, but it would be impossible for anyone toto go through 100s of lines of code.
I have managed to narrow down the line were the code above crushes which is :
sscanf(pch,"%*3c%d",&comnd);
I suspect that this has something to do with the difference of length of variables in ARM architecture when compared to the AVR.
Can anyone tell whats wrong from just this snippet?