This source file includes following definitions.
- get_usb_bit
- kbd_fetch_data
- my_kbd_read_keys
- wrap_kbd_p1_f
- mykbd_task
- jogdial_control
- get_jogdial_direction
1 #include "lolevel.h"
2 #include "platform.h"
3 #include "core.h"
4 #include "conf.h"
5 #include "kbd_common.h"
6
7 KeyMap keymap[] = {
8
9 { 0, KEY_ZOOM_IN ,0x00000060 },
10 { 0, KEY_ZOOM_IN ,0x00000020 },
11 { 0, KEY_ZOOM_IN ,0x00000040 },
12 { 0, KEY_ZOOM_OUT ,0x00000180 },
13 { 0, KEY_ZOOM_OUT ,0x00000080 },
14 { 0, KEY_ZOOM_OUT ,0x00000100 },
15 { 0, KEY_UP ,0x00000400 },
16 { 0, KEY_DOWN ,0x00000800 },
17 { 0, KEY_LEFT ,0x00001000 },
18 { 0, KEY_RIGHT ,0x00002000 },
19 { 0, KEY_SET ,0x00004000 },
20 { 0, KEY_VIDEO ,0x00008000 },
21 { 0, KEY_ZOOM_ASSIST ,0x00010000 },
22 { 0, KEY_DISPLAY ,0x00020000 },
23 { 0, KEY_MENU ,0x00040000 },
24 { 0, KEY_ERASE ,0x00080000 },
25 { 0, KEY_FLASH ,0x00400000 },
26 { 0, KEY_PRINT ,0x00800000 },
27
28 { 2, KEY_POWER ,0x00000800 },
29 { 2, KEY_PLAYBACK ,0x00001000 },
30 { 2, KEY_SHOOT_FULL ,0x0000c000 },
31 { 2, KEY_SHOOT_FULL_ONLY ,0x00008000 },
32 { 2, KEY_SHOOT_HALF ,0x00004000 },
33
34 { 0, 0, 0 }
35 };
36
37 long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
38 long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
39 long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
40
41 extern void _GetKbdState(long*);
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 int get_usb_bit()
61 {
62 long usb_physw[3];
63 usb_physw[USB_IDX] = 0;
64 _kbd_read_keys_r2(usb_physw);
65 return(( usb_physw[USB_IDX] & USB_MASK)==USB_MASK) ;
66 }
67
68 void kbd_fetch_data(long *dst)
69 {
70 _GetKbdState(dst);
71 _kbd_read_keys_r2(dst);
72 }
73
74 void my_kbd_read_keys()
75 {
76 kbd_update_key_state();
77
78
79 if (conf.zoom_assist_button_disable)
80 physw_status[0] |= 0x00010000;
81
82 kbd_update_physw_bits();
83 }
84
85 long __attribute__((naked,noinline)) wrap_kbd_p1_f()
86 {
87 asm volatile(
88 "STMFD SP!, {R1-R7,LR}\n"
89 "MOV R5, #0\n"
90
91 "BL my_kbd_read_keys\n"
92 "B _kbd_p1_f_cont\n"
93 );
94 return 0;
95 }
96
97
98 void __attribute__((naked,noinline))
99 mykbd_task()
100 {
101 while (physw_run){
102 _SleepTask(physw_sleep_delay);
103
104 if (wrap_kbd_p1_f() == 1){
105 _kbd_p2_f();
106 }
107 }
108
109 _ExitTask();
110 }
111
112
113 int jogdial_stopped=0;
114
115
116
117 extern short* jog_position;
118 extern short rear_dial_position;
119
120 void jogdial_control(int n)
121 {
122 if (jogdial_stopped && !n)
123 {
124
125
126 jog_position[0] = jog_position[2] = rear_dial_position;
127 }
128 jogdial_stopped = n;
129 }
130
131 static short new_jogdial=0, old_jogdial=0;
132
133 long get_jogdial_direction(void)
134 {
135 old_jogdial = new_jogdial;
136 new_jogdial = rear_dial_position;
137 if (old_jogdial < new_jogdial) return JOGDIAL_LEFT;
138 else if (old_jogdial > new_jogdial) return JOGDIAL_RIGHT;
139 else return 0;
140 }