物理按键的程序
#include "main.h"
#include"s5pv210-gpio.h"
char *voice_table[6]={"./picture/voice0.bmp","./picture/voice1.bmp",
"./picture/voice2.bmp","./picture/voice3.bmp",
"./picture/voice4.bmp","./picture/voice5.bmp",};
void * key(void *arg){
int fp3=-1,fp2=-1,fp0=-1;
int key ,key_num,flag=0xaa;
fp3=open("/dev/gpH3",O_RDWR);
if(fp3<0){
perror("dev/gpH3");
//_/exit(-1);
}
fp2=open("/dev/gpH2",O_RDWR);
if(fp2<0){
perror("dev/gpH2");
//_exit(-1);
}
printf("\n 111111111111 %d %d\n\n",fp2,fp3);
ioctl(fp3,GPIO_SET_PIN_OUT,0);
ioctl(fp3,GPIO_SET_PULL_DIS,0);
ioctl(fp3,GPIO_CLR_PIN,0);
ioctl(fp3,GPIO_SET_PIN_OUT,1);
ioctl(fp3,GPIO_SET_PULL_DIS,1);
ioctl(fp3,GPIO_CLR_PIN,1);
ioctl(fp2,GPIO_SET_PIN_IN,3);
ioctl(fp2,GPIO_SET_PIN_IN,4);
ioctl(fp2,GPIO_SET_PIN_IN,5);
ioctl(fp2,GPIO_SET_PIN_IN,6);
ioctl(fp2,GPIO_SET_PIN_IN,7);
ioctl(fp2,GPIO_SET_PULL_UP,3);
ioctl(fp2,GPIO_SET_PULL_UP,4);
ioctl(fp2,GPIO_SET_PULL_UP,5);
ioctl(fp2,GPIO_SET_PULL_UP,6);
ioctl(fp2,GPIO_SET_PULL_UP,7);
ioctl(fp2,GPIO_SET_PIN,3);
ioctl(fp2,GPIO_SET_PIN,4);
ioctl(fp2,GPIO_SET_PIN,5);
ioctl(fp2,GPIO_SET_PIN,6);
ioctl(fp2,GPIO_SET_PIN,7);
int fp=open("./fifo_cmd",O_WRONLY);
SONGNAME *namehead=readsongname();
while(1){
printf(&