-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.c
39 lines (36 loc) · 978 Bytes
/
config.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "remote_config.h"
#define PRINT_CONFIG
int set_config(remote_config_t *remote, int device_fd)
{
unsigned int i;
unsigned int *para = &remote->repeat_delay;
for(i = 0; i < ARRAY_SIZE(config_item); i++){
if(para[i]!=0xffffffff){
#ifdef PRINT_CONFIG
switch(i){
case 4:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
printf("%20s = 0x%x\n", config_item[i], para[i]);
break;
default:
printf("%20s = %d\n", config_item[i], para[i]);
break;
}
#endif
ioctl(device_fd, remote_ioc_table[i], ¶[i]);
}
}
return 0;
}