Skip to content

Instantly share code, notes, and snippets.

@naehrwert
Last active May 3, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naehrwert/c22020cb4a666808ec344fc56d5ea312 to your computer and use it in GitHub Desktop.
Save naehrwert/c22020cb4a666808ec344fc56d5ea312 to your computer and use it in GitHub Desktop.
static int dev_im_mq;
static int hb_param_idx;
static int hb_param_type;
int SetDeviceState(fd_ctxt *fd, int *buf)
{
/* ... */
switch(buf[0])
{
/* ... */
case 3:
hb_param_idx = buf[2];
hb_param_type = buf[1];
/* ... */
}
/* ... */
}
int GetHomeButtonParams(int *buf)
{
buf[0] = hb_param_type;
buf[1] = hb_param_idx;
return 0;
}
int dev_im_handler(...)
{
while(!recv_msg(dev_im_mq, &req, 0))
{
switch(req->cmd)
{
/* ... */
case 4:
/* ... */
SetDeviceState(fd_ctxt, (int *)req->vecs[0].phys);
/* ... */
case 7:
/* ... */
GetHomeButtonParams((int *)req->vecs[0].phys);
/* ... */
/* ... */
}
/* ... */
}
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment