Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » menuMgr.initForUpDownOk parameter definition vs GUI generated code

Author: Mr.Robot
19/09/2021 16:47:36
Hey,

I got a new prototype of my hardware in and had to adjust the GPIO numbers for my buttons on my old project. After I recompiled it, something odd happened. The UP and DOWN buttons were switched. First I checked my wiring (since it is a new PCB and could have a design error) but everything seemed ok. After going through the code and API I stumbeled onto an issue with the initForUpDownOk parameters. Even though it is called UP_DOWN_OK, it takes its parameters as DOWN_UP_OK. The GUI, however, generates code in the fashion of UP_DOWN_OK which resulted in my buttons being swapped.

Here is a screenshoot from the designer:

image

and the generated code:

menuMgr.initForUpDownOk(&renderer, &menuArsenal, UP_BUTTON_GPIO, DOWN_BUTTON_GPIO, A_BUTTON_GPIO);

(the GPIO definitions are in a separate config file)

The API for initForUpDownOk however states that DOWN comes before UP:
void MenuManager::initForUpDownOk	(	MenuRenderer * 	renderer,
     MenuItem * 	root,
     pinid_t 	downPin,
     pinid_t 	upPin,
     pinid_t 	okPin 
)


Is this a bug or am I doing something wrong?

Author: davetcc
20/09/2021 09:42:14
We'll need to take a look at this and feed back here.




Register / Login  |  Desktop view  |  Jump to top of page