I've been trying to debug the code using GDB and Eclipse. I've noticed that when the button hangs in "pressed" state GetMouseReading functions gets z=1 instead of z=0. please see my Breakpoint in Step2:
static void GetMouseReading(GMouse *m) {
GMouseReading r;
// Step 1 - Get the Raw Reading
{
m->flags &= ~GMOUSE_FLG_NEEDREAD;
if (!gmvmt(m)->get(m, &r))
return;
}
// Step 2 - Handle touch and button 0 debouncing
{
// Clean off button garbage
r.buttons &= GINPUT_MOUSE_BTN_MASK;
and code seems to be stuck in sem_wait() function:
err = lll_futex_wait (&isem->value, 0,isem->private ^ FUTEX_PRIVATE_FLAG);
I'm not sure if this information is relevant but I've stuck now and don't know how to find the root cause of this issue.
Thanks,