Last active
May 3, 2016 21:30
-
-
Save naehrwert/c22020cb4a666808ec344fc56d5ea312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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