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:
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?