Changeset 1573
- Timestamp:
- 01/17/12 03:27:07 (16 months ago)
- Location:
- trunk/platform/ixus230_elph310hs
- Files:
-
- 2 edited
-
kbd.c (modified) (5 diffs)
-
platform_camera.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/platform/ixus230_elph310hs/kbd.c
r1567 r1573 28 28 } KeyMap; 29 29 30 long kbd_new_state[3] ;31 static long kbd_prev_state[3] ;32 static long kbd_mod_state[3] ;30 long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; 31 static long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; 32 static long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; 33 33 34 34 static long last_kbd_key = 0; 35 35 static long alt_mode_key_mask = 0x00004000; // KEY_VIDEO 36 static int usb_power=0; 37 static int remote_key, remote_count; 38 static int shoot_counter=0; 36 39 37 extern void _GetKbdState(long*); 40 38 41 #define DELAY_TIMEOUT 1000042 39 43 40 #define KEYS_MASK0 (0x00004000|0X00000004) … … 50 47 #define SD_READONLY_REG 2 51 48 52 #define USB_REG 2 49 53 50 #define USB_MASK (0x04000000) 51 #define USB_IDX 2 52 53 extern void usb_remote_key( int ) ; 54 int get_usb_bit() 55 { 56 long usb_physw[3]; 57 usb_physw[USB_IDX] = 0; 58 _kbd_read_keys_r2(usb_physw); 59 return(( usb_physw[USB_IDX] & USB_MASK)==USB_MASK) ; 60 } 54 61 55 62 #ifndef MALLOCD_STACK … … 82 89 long __attribute__((naked)) wrap_kbd_p1_f() ; 83 90 84 void wait_until_remote_button_is_released(void)85 {86 int count1;87 int count2;88 int tick,tick2,tick3;89 int nSW;90 int prev_usb_power,cur_usb_power;91 // ------ add by Masuji SUTO (start) --------------92 static int nMode;93 // ------ add by Masuji SUTO (end) --------------94 95 asm volatile ("STMFD SP!, {R0-R11,LR}\n"); // store R0-R11 and LR in stack96 debug_led(1);97 tick = get_tick_count();98 tick2 = tick;99 static long usb_physw[3];100 if (conf.synch_enable && conf.ricoh_ca1_mode && conf.remote_enable && (!shooting_get_drive_mode()|| ((shooting_get_drive_mode()==2) && state_shooting_progress != SHOOTING_PROGRESS_PROCESSING))) // synch mode enable so wait for USB to disconnect101 {102 // ------ add by Masuji SUTO (start) --------------103 nMode=0;104 usb_physw[2] = 0; // makes sure USB bit is cleared.105 _kbd_read_keys_r2(usb_physw);106 if((usb_physw[2] & USB_MASK)==USB_MASK) nMode=1;107 // ------ add by Masuji SUTO (end) --------------108 if(conf.ricoh_ca1_mode && conf.remote_enable)109 {110 if(shooting_get_drive_mode()==1 && state_shooting_progress == SHOOTING_PROGRESS_PROCESSING){ //continuous-shooting mode111 if(conf.bracket_type>2){112 if(shoot_counter<2) shutter_int=3;113 shoot_counter--;114 }115 else{116 prev_usb_power=0;117 nSW = 0;118 do119 {120 usb_physw[2] = 0; // makes sure USB bit is cleared.121 _kbd_read_keys_r2(usb_physw);122 cur_usb_power = (usb_physw[2] & USB_MASK)==USB_MASK;123 if(cur_usb_power){124 if(!prev_usb_power){125 tick2 = get_tick_count();126 prev_usb_power=cur_usb_power;127 }128 else{129 if((int)get_tick_count()-tick2>1000) {debug_led(0);}130 }131 }132 else{133 if(prev_usb_power){134 tick3 = (int)get_tick_count()-tick2;135 if(nSW==10) {136 if(tick3>50) shutter_int=1;137 nSW=20;138 }139 if(nSW==0 && tick3>0) {140 if(tick3<50) {141 nSW=10;142 }143 else{144 if(tick3>1000) shutter_int=1;145 nSW=20;146 }147 }148 prev_usb_power=cur_usb_power;149 }150 }151 if((int)get_tick_count()-tick >= DELAY_TIMEOUT) {nSW=20;shutter_int=2;}152 }153 while(nSW<20);154 }155 } //continuous-shooting mode156 else{ //nomal mode157 shoot_counter=0;158 if(conf.bracket_type>2){159 shoot_counter=(conf.bracket_type-2)*2;160 }161 do162 {163 // _GetKbdState(x);164 usb_physw[2] = 0;165 _kbd_read_keys_r2(usb_physw);166 }167 168 // ------ modif by Masuji SUTO (start) --------------169 while(((((usb_physw[2] & USB_MASK)!=USB_MASK) && (nMode==0)) || (((usb_physw[2] & USB_MASK)==USB_MASK) && (nMode==1))) && ((int)get_tick_count()-tick < DELAY_TIMEOUT));170 // ------ modif by Masuji SUTO (end) --------------171 }172 } // ricoh ca-1 mode173 174 else175 176 {177 do178 {179 // _GetKbdState(x);180 usb_physw[2] = 0;181 _kbd_read_keys_r2(usb_physw);182 }183 while((usb_physw[2]&USB_MASK) && ((int)get_tick_count()-tick < DELAY_TIMEOUT));184 185 }186 187 } // synch enable188 189 190 if (conf.synch_delay_enable && conf.synch_delay_value>0) // if delay is switched on and greater than 0191 {192 for (count1=0;count1<conf.synch_delay_value+(conf.synch_delay_coarse_value*1000);count1++) // wait delay_value * 0.1ms193 {194 for (count2=0;count2<1400;count2++) // delay approx. 0.1ms195 {196 }197 }198 }199 200 debug_led(0);201 202 asm volatile ("LDMFD SP!, {R0-R11,LR}\n"); // restore R0-R11 and LR from stack203 }204 205 206 91 static void __attribute__((noinline)) mykbd_task_proceed() 207 92 { … … 295 180 296 181 297 remote_key = (physw_status[2] & USB_MASK)==USB_MASK; 298 if (remote_key) { 299 remote_count += 1; 300 } 301 else if (remote_count) { 302 usb_power = remote_count; 303 remote_count = 0; 304 } 182 usb_remote_key(physw_status[USB_IDX]) ; 305 183 306 184 if (conf.remote_enable) { 307 physw_status[ 2] = physw_status[SD_READONLY_REG] & ~(SD_READONLY_FLAG | USB_MASK);185 physw_status[USB_IDX] = physw_status[USB_IDX] & ~(SD_READONLY_FLAG | USB_MASK); 308 186 } else { 309 physw_status[ 2] = physw_status[SD_READONLY_REG] & ~SD_READONLY_FLAG;187 physw_status[USB_IDX] = physw_status[USB_IDX] & ~SD_READONLY_FLAG; 310 188 } 311 189 } … … 441 319 } 442 320 443 444 int get_usb_power(int edge)445 {446 int x;447 448 if (edge) return remote_key;449 x = usb_power;450 usb_power = 0;451 return x;452 }453 454 455 321 long kbd_use_zoom_as_mf() { 456 322 return 0; -
trunk/platform/ixus230_elph310hs/platform_camera.h
r1567 r1573 113 113 #define CAM_USE_COLORED_ICONS 1 // Enable using the CHDK-DE colored icons. 114 114 115 #define REMOTE_SYNC_STATUS_LED 0xC0220130 // specifies an LED that turns on while camera waits for USB remote to sync 115 116 116 117
Note: See TracChangeset
for help on using the changeset viewer.