Ignore:
Timestamp:
01/16/12 06:46:19 (16 months ago)
Author:
reyalp
Message:

new usb remote system from waterwings http://chdk.setepontos.com/index.php?topic=7127.msg79948#msg79948
draft documentation http://chdk.wikia.com/wiki/User:Waterwingz/USB_Remote_V2
note ixus230 kbd.c not updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platform/ixus75_sd750/kbd.c

    r1344 r1568  
    1212 
    1313 
    14 static long kbd_new_state[3]; 
    15 static long kbd_prev_state[3]; 
    16 static long kbd_mod_state[3]; 
     14long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; 
     15static long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; 
     16static long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; 
     17 
    1718static KeyMap keymap[]; 
    1819static long last_kbd_key = 0; 
    19 static int usb_power=0; 
    20 static int remote_key, remote_count; 
     20 
     21 
    2122#define USB_MASK (0x40000)  
    22 #define USB_REG 2 
    23  
     23#define USB_IDX  2 
     24 
     25extern void usb_remote_key( int ) ; 
     26int get_usb_bit()  
     27{ 
     28        long usb_physw[3]; 
     29        usb_physw[USB_IDX] = 0; 
     30        _kbd_read_keys_r2(usb_physw); 
     31        return(( usb_physw[USB_IDX] & USB_MASK)==USB_MASK) ;  
     32} 
    2433 
    2534#define KEYS_MASK0 (0x00000000) 
     
    130139    _kbd_read_keys_r2(physw_status); 
    131140 
     141        usb_remote_key(physw_status[USB_IDX]) ; 
     142 
    132143        if (conf.remote_enable) { 
    133                 remote_key = (physw_status[2] & USB_MASK)==USB_MASK; 
    134                 if (remote_key)  
    135                         remote_count += 1; 
    136                 else if (remote_count) { 
    137                         usb_power = remote_count; 
    138                         remote_count = 0; 
    139                 } 
    140                 physw_status[2] = physw_status[2] & ~(SD_READONLY_FLAG | USB_MASK); 
    141         } 
    142         else 
    143                 physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG; 
     144                physw_status[USB_IDX] = physw_status[USB_IDX] & ~(SD_READONLY_FLAG | USB_MASK); 
     145        } else { 
     146                physw_status[USB_IDX] = physw_status[USB_IDX] & ~SD_READONLY_FLAG; 
     147        } 
    144148 
    145149 
     
    148152} 
    149153 
    150 int get_usb_power(int edge) 
    151 { 
    152         int x; 
    153  
    154         if (edge) return remote_key; 
    155         x = usb_power; 
    156         usb_power = 0; 
    157         return x; 
    158 } 
    159  
    160 /* void kbd_set_alt_mode_key_mask(long key) 
    161 { 
    162     int i; 
    163     for (i=0; keymap[i].hackkey; ++i) { 
    164         if (keymap[i].hackkey == key) { 
    165             alt_mode_key_mask = keymap[i].canonkey; 
    166             return; 
    167         } 
    168     } 
    169 } */ 
    170154 
    171155void kbd_key_press(long key) 
Note: See TracChangeset for help on using the changeset viewer.