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

A1100 IS Porting thread

  • 647 Replies
  • 231930 Views
Re: A1100 IS Porting thread
« Reply #120 on: 26 / April / 2010, 11:10:24 »
Advertisements
I use the _platformsub_kbd_fetch_data(kbd_new_state)
then as you say I replace it with your code.
//_platformsub_kbd_fetch_data(kbd_new_state);
kbd_new_state[0] = physw_status[0]; // <---- Add this
   kbd_new_state[1] = physw_status[1]; // <---- Add this
   kbd_new_state[2] = physw_status[2]; // <---- Add this

Re: A1100 IS Porting thread
« Reply #121 on: 26 / April / 2010, 11:40:38 »
Now the most important thing is to let the keyboard work.

Re: A1100 IS Porting thread
« Reply #122 on: 26 / April / 2010, 11:42:54 »
This is the code for the A1000, I see the kbd power is turned on :-

Code: [Select]
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 ;  
} 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);

//    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG;


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();

}


and kbd_fetch_data() is  :-


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;
}
« Last Edit: 26 / April / 2010, 11:46:47 by Microfunguy »

Re: A1100 IS Porting thread
« Reply #123 on: 26 / April / 2010, 12:01:05 »
ok,I must comment some of your code
 //physw_status[2] = kbd_new_state[2];
to run chdk,otherwise the screen is not work.
Strange!

After comment out that that,Screen works.
And this time.I get these result:
Code: [Select]
   code:
        sprintf(osd_buf, "1:%8x  ", physw_status[0]);
        draw_txt_string(28, 10, osd_buf, conf.osd_color);

        sprintf(osd_buf, "2:%8x  ", physw_status[1]);
        draw_txt_string(28, 11, osd_buf, conf.osd_color);

        sprintf(osd_buf, "3:%8x  ", physw_status[2]);
result:
1  30x200xc
2    c2000eb
3     2d0ff

x meaning change all the time.
the keyboard is still not work.


Re: A1100 IS Porting thread
« Reply #124 on: 26 / April / 2010, 12:05:27 »
Try changing :

dst[2] = *mmio2 & 0xffff;

to

dst[2] = *mmio2;

Re: A1100 IS Porting thread
« Reply #125 on: 26 / April / 2010, 12:08:25 »
I have tried,with the same result.Have no change.
Bad luck.

Re: A1100 IS Porting thread
« Reply #126 on: 26 / April / 2010, 12:10:50 »
my kdb.c
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);

//    physw_status[2] = physw_status[2] & ~SD_READONLY_FLAG;


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();

}

Re: A1100 IS Porting thread
« Reply #127 on: 26 / April / 2010, 12:29:47 »
Some of that code was just for SDM.

So, the A1000 works, the A2000 works but the A1100 does not.

Hmmm  .....   I don't know.



Re: A1100 IS Porting thread
« Reply #128 on: 26 / April / 2010, 13:19:36 »
Try that last method again but do not include any of the override code.

Re: A1100 IS Porting thread
« Reply #129 on: 26 / April / 2010, 22:05:57 »
strange! No matter what code I use,I must comment out this code.Otherwise,the screen cant work.
    
//physw_status[2] = kbd_new_state[2];

what is that code doing?
why this code run fine.

physw_status[0] = kbd_new_state[0];
physw_status[1] = kbd_new_state[1];

Is some function address do not correct cause this problem?

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal