source: trunk/platform/a640/kbd.c @ 1344

Revision 1344, 883 bytes checked in by philmoz, 21 months ago (diff)

Implement the full shutter press without releasing half-press logic:
http://chdk.setepontos.com/index.php?topic=1444.0

  • Property svn:eol-style set to native
Line 
1#include "../generic/kbd.c"
2
3static KeyMap keymap[] = {
4    /* tiny bug: key order matters. see kbd_get_pressed_key()
5     * for example
6     */
7        { KEY_UP        , 0x00000001 },
8        { KEY_DOWN      , 0x00000002 },
9        { KEY_LEFT      , 0x00000008 },
10        { KEY_RIGHT     , 0x00000004 },
11        { KEY_SET       , 0x00000100 },
12        { KEY_SHOOT_FULL, 0x00000030 }, // note 3 here!
13    { KEY_SHOOT_FULL_ONLY, 0x00000020 },
14        { KEY_SHOOT_HALF, 0x00000010 },
15        { KEY_ZOOM_IN   , 0x00000040 },
16        { KEY_ZOOM_OUT  , 0x00000080 },
17        { KEY_MENU      , 0x00000200 },
18        { KEY_DISPLAY   , 0x00000400 },
19        { KEY_PRINT     , 0x00001000 },
20        { KEY_ERASE     , 0x00000800 },
21        { KEY_DUMMY     , 0x00001000 },
22        { 0, 0 }
23};
24
25void kbd_fetch_data(long *dst)
26{
27    volatile long *mmio0 = (void*)0xc0220200;
28    volatile long *mmio1 = (void*)0xc0220204;
29    volatile long *mmio2 = (void*)0xc0220208;
30
31    dst[0] = *mmio0;
32    dst[1] = *mmio1;
33    dst[2] = *mmio2 & 0xffff;
34}
35
Note: See TracBrowser for help on using the repository browser.