OK, I am also trying to use gwinAttachToggle() to have a hardware button control the selection on a list widget. A few questions which are not that obvious from the examples. WIth GFX_USE_INPUT and GINPUT_TOGGLE set, my button driver needs to provide a ginput_lld_toggle_getbits() function. My understanding is that this just returns the state of the switches/buttons ?? If there is are two buttons and the first button is pressed, it would return 1 as its function result ?? My GToggleConfig configuration is:
#define GINPUT_TOGGLE_NUM_PORTS 2 // The total number of toggle inputs
#define GINPUT_TOGGLE_CONFIG_ENTRIES 1 // The total number of GToggleConfig entries
#define CLI_SW1_MASK 1
#define CLI_SW2_MASK 2
#define GINPUT_TOGGLE_DECLARE_STRUCTURE() \
const GToggleConfig GInputToggleConfigTable[GINPUT_TOGGLE_CONFIG_ENTRIES] = { \
{0, \
CLI_SW1_MASK|CLI_SW2_MASK, \
0, \
0}, \
}
So my issue here is that I never see an event from the list widget. The TogglePoll() function is getting called on a regular basis and ginput_lld_toggle_getbits() returns the state of SW1, but geventSendEvent() never is called. (For switch on or off). My setup when I populate the widget just does:
gwinAttachToggle(setup_list, 0, 0);
gwinAttachToggle(setup_list, 1, 1);
geventListenerInit(&setup_listener);
gwinAttachListener(&setup_listener);
I see my list on my LCD screen, so I know it is displaying properly. My code is just calling:
pe = geventEventWait(&setup_listener, TIME_INFINITE);
And it never comes back. So what am I not understanding??
Thanks.