A1100 IS Porting thread - page 15 - DryOS Development - CHDK Forum

A1100 IS Porting thread

  • 647 Replies
  • 244858 Views
Re: A1100 IS Porting thread
« Reply #140 on: 27 / April / 2010, 09:18:39 »
Advertisements
stubs_min.S
DEF(physw_status, 0xC624)//--->fixed

The values is 0xCEF8 in a480,I search the 0xCEF8 from a480's firmware.
and at the same code place in a1100's firmware,the value is 0xC624.So I use it.

Re: A1100 IS Porting thread
« Reply #141 on: 27 / April / 2010, 09:20:13 »
the task_PhySw function

A480

Code: [Select]
ROM:FFC10FD0 task_PhySw                              ; DATA XREF: taskcreate_PhySw+1Co
ROM:FFC10FD0                 STMFD   SP!, {R4,LR}
ROM:FFC10FD4                 LDR     R4, =0x1BE0
ROM:FFC10FD8                 B       loc_FFC10FF0
ROM:FFC10FDC ; ---------------------------------------------------------------------------
ROM:FFC10FDC
ROM:FFC10FDC loc_FFC10FDC                            ; CODE XREF: task_PhySw+28j
ROM:FFC10FDC                 MOV     R0, #0xA
ROM:FFC10FE0                 BL      eventproc_export_SleepTask ; LOCATION: KerSys.c:0
ROM:FFC10FE4                 BL      kbd_p1_f
ROM:FFC10FE8                 CMP     R0, #1
ROM:FFC10FEC                 BLEQ    sub_FFC10CA0
ROM:FFC10FF0
ROM:FFC10FF0 loc_FFC10FF0                            ; CODE XREF: task_PhySw+8j
ROM:FFC10FF0                 LDR     R0, [R4,#0xC]
ROM:FFC10FF4                 CMP     R0, #0
ROM:FFC10FF8                 BNE     loc_FFC10FDC
ROM:FFC10FFC                 LDMFD   SP!, {R4,LR}
ROM:FFC11000                 B       eventproc_export_ExitTask ; LOCATION: KerTask.c:0

A1100

Code: [Select]
task_PhySw                              ; DATA XREF: taskcreate_PhySw+1Co
ROM:FFC1167C                 STMFD   SP!, {R4,LR}
ROM:FFC11680                 LDR     R4, =0x1C18
ROM:FFC11684                 B       loc_FFC1169C
ROM:FFC11688 ; ---------------------------------------------------------------------------
ROM:FFC11688
ROM:FFC11688 loc_FFC11688                            ; CODE XREF: task_PhySw+28j
ROM:FFC11688                 MOV     R0, #0xA
ROM:FFC1168C                 BL      SleepTask
ROM:FFC11690                 BL      kbd_p1_f
ROM:FFC11694                 CMP     R0, #1
ROM:FFC11698                 BLEQ    sub_FFC1134C
ROM:FFC1169C
ROM:FFC1169C loc_FFC1169C                            ; CODE XREF: task_PhySw+8j
ROM:FFC1169C                 LDR     R0, [R4,#0xC]
ROM:FFC116A0                 CMP     R0, #0
ROM:FFC116A4                 BNE     loc_FFC11688
ROM:FFC116A8                 LDMFD   SP!, {R4,LR}
ROM:FFC116AC                 B       ExitTask


Re: A1100 IS Porting thread
« Reply #142 on: 27 / April / 2010, 09:23:17 »
The function address in both firmware:

A480

Code: [Select]
ROM:FFC10AD8 sub_FFC10AD8                            ; CODE XREF: sub_FFC1818C+38p
ROM:FFC10AD8
ROM:FFC10AD8 var_5C          = -0x5C
ROM:FFC10AD8
ROM:FFC10AD8                 STMFD   SP!, {R4,R5,LR}
ROM:FFC10ADC                 LDR     R4, =0x1BE0
ROM:FFC10AE0                 SUB     SP, SP, #0x54
ROM:FFC10AE4                 LDR     R0, [R4,#0xC]
ROM:FFC10AE8                 CMP     R0, #1
ROM:FFC10AEC                 BEQ     loc_FFC10BC0
ROM:FFC10AF0                 LDR     R2, =0xCEEC
ROM:FFC10AF4                 SUB     R1, R2, #0xC
ROM:FFC10AF8                 SUB     R0, R2, #0x18
ROM:FFC10AFC                 BL      _sub_FFC2C0B0__PhySwConfig.c__0 ; LOCATION: PhySwConfig.c:0
ROM:FFC10B00                 BL      sub_FFC2C894
ROM:FFC10B04                 BL      sub_FFC11360
ROM:FFC10B08                 LDR     R1, =0xCEF8                            --->this
ROM:FFC10B0C                 MOV     R0, #2
ROM:FFC10B10                 SUB     R2, R1, #0x18
ROM:FFC10B14                 ADD     R3, R2, #0xC
ROM:FFC10B18                 ADD     R5, R3, #0x18


A1100

Code: [Select]
ROM:FFC11184 var_7C          = -0x7C
ROM:FFC11184
ROM:FFC11184                 STMFD   SP!, {R4,R5,LR}
ROM:FFC11188                 LDR     R4, =0x1C18
ROM:FFC1118C                 SUB     SP, SP, #0x74
ROM:FFC11190                 LDR     R0, [R4,#0xC]
ROM:FFC11194                 CMP     R0, #1
ROM:FFC11198                 BEQ     loc_FFC1126C
ROM:FFC1119C                 LDR     R2, =0xC618
ROM:FFC111A0                 SUB     R1, R2, #0xC
ROM:FFC111A4                 SUB     R0, R2, #0x18
ROM:FFC111A8                 BL      sub_FFC30118
ROM:FFC111AC                 BL      sub_FFC30AF8
ROM:FFC111B0                 BL      kbd_read_keys
ROM:FFC111B4                 LDR     R1, =0xC624              ---->this
ROM:FFC111B8                 MOV     R0, #2
ROM:FFC111BC                 SUB     R2, R1, #0x18
ROM:FFC111C0                 ADD     R3, R2, #0xC
ROM:FFC111C4                 ADD     R5, R3, #0x18


Re: A1100 IS Porting thread
« Reply #143 on: 27 / April / 2010, 09:34:06 »
any suggestion is appreciate

Re: A1100 IS Porting thread
« Reply #144 on: 27 / April / 2010, 09:47:13 »
I am losing track what the current version of your keyboard code is.

Can you list it again ?

For now, I would use :

dst[2] = *mmio2 & 0xffff;

Re: A1100 IS Porting thread
« Reply #145 on: 27 / April / 2010, 10:05:02 »
Code: [Select]
void kbd_fetch_data(long *dst)
{
    volatile long *mmio0 = (void*)0xc0220200;
    volatile long *mmio1 = (void*)0xc0220204;
    volatile long *mmio2 = (void*)0xc0220208;

    dst[0] = *mmio0;
    dst[1] = *mmio1;
    dst[2] = *mmio2 & 0xffff;
//  dst[2] = *mmio2;
}

void my_kbd_read_keys()
{
kbd_prev_state[0] = kbd_new_state[0];
kbd_prev_state[1] = kbd_new_state[1];
kbd_prev_state[2] = kbd_new_state[2];

    _kbd_pwr_on();

    kbd_fetch_data(kbd_new_state);

if (kbd_process() == 0){
// leave it alone...
physw_status[0] = kbd_new_state[0];
physw_status[1] = kbd_new_state[1];
//physw_status[2] = kbd_new_state[2];
    //  if(imgbuf)physw_status[2]  = physw_status[2] | menu_key_mask ;  ----->no imgbuf
} else {
// override keys
physw_status[0] = (kbd_new_state[0] & (~KEYS_MASK0)) |
  (kbd_mod_state[0] & KEYS_MASK0);

physw_status[1] = (kbd_new_state[1] & (~KEYS_MASK1)) |
  (kbd_mod_state[1] & KEYS_MASK1);

// physw_status[2] = (kbd_new_state[2] & (~KEYS_MASK2)) |
//   (kbd_mod_state[2] & KEYS_MASK2);
}

    _kbd_read_keys_r2(physw_status);

remote_key = (physw_status[2] & USB_MASK)==USB_MASK;
      if (remote_key)  remote_count += 1;
else if (remote_count) {
usb_power = remote_count;
remote_count = 0;
}

if (conf.remote_enable) {
physw_status[2] = physw_status[2] & ~(SD_READONLY_FLAG | USB_MASK);
}
    else physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG;

    _kbd_pwr_off();

}
with this code,The camera can turn on with sound.
When I press some key of the camera
the digit on the screen have some changes
one case:
physw_status[1]                  --->    2       c21ffeb(when I press the left key,I change to c21f7eb, press right key change to c21fbeb)


I can trun on the mode to let the lens out.But can not take picture.And at this time,any key is disable.But the digit on the screen is changed when I press the key.

Re: A1100 IS Porting thread
« Reply #146 on: 27 / April / 2010, 10:06:44 »
The only key can work is menu key.I can press menu key to let the canon menu come out.

Re: A1100 IS Porting thread
« Reply #147 on: 27 / April / 2010, 10:10:20 »
As a matter of interest, connect the camera to the PC using the USB cable.

Make sure conf.remote_enable is true.

Does a programme on the PC startup ?

It should not.

Do any bits of physw_status[] change ?

Re: A1100 IS Porting thread
« Reply #148 on: 27 / April / 2010, 10:17:31 »
Yes,When I trun from playback mode to the shoot mode.The physw_status[1],physw_status[2],physw_status[3]
are changed.

Re: A1100 IS Porting thread
« Reply #149 on: 27 / April / 2010, 10:20:14 »
I meant when you connect to the PC while in shoot mode, what happens ?

Anyway, try changing if (kbd_process() == 0){

to

// if (kbd_process() == 0){
if(1){




 

Related Topics


SimplePortal © 2008-2014, SimplePortal