Closed frdoni closed 4 years ago
I found the problem.
When You went to use attachPush or attachPop, on DUE board You must cast Your callback function to (NexTouchEventCb) type.
so even if this line compile corretly for Mega2560:
bTorna.attachPush(bTornaCallback);
for Arduino DUE must correct in:
bTorna.attachPush( (NexTouchEventCb) bTornaCallback);
Francesco
Hi,
switching from Mega2560 (where it compile correct) to Arduino DUE will prompt a lot of errors:
exit status 1 invalid conversion from 'void (*)(void*)' to 'NexTouchEventCb {aka void (*)(void*)}' [-fpermissive]
I know that gcc is different, (arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++) but seems that in file NexTouch.h there isn't a correct declaration for:
other logs:
E:\test\nex0_init.ino: In function 'void initNextion()': nex0_init:7:37: error: invalid conversion from 'void (*)(void*)' to 'NexTouchEventCb {aka void (*)(void*)}' [-fpermissive] bTorna.attachPush(bTornaCallback); ^ In file included from C:\Program Files (x86)\Arduino\libraries\Enhanced_Nextion_Library/NexPage.h:21:0, from E:\test\test.ino:111: C:\Program Files (x86)\Arduino\libraries\Enhanced_Nextion_Library/NexTouch.h:75:10: error: initializing argument 1 of 'void NexTouch::attachPush(NexTouchEventCb, void*)' [-fpermissive] void attachPush(NexTouchEventCb push, void *ptr = NULL); ^ nex0_init:10:39: error: invalid conversion from 'void (*)(void*)' to 'NexTouchEventCb {aka void (*)(void*)}' [-fpermissive] btSlot1.attachPush(btSlot1Callback); ^ In file included from C:\Program Files (x86)\Arduino\libraries\Enhanced_Nextion_Library/NexPage.h:21:0, from E:\test\test.ino:111:
Francesco