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

A1100 IS Porting thread

  • 647 Replies
  • 245780 Views
Re: A1100 IS Porting thread
« Reply #160 on: 27 / April / 2010, 11:22:18 »
Advertisements
Let us consider physw_status[1] bit patterns.

They are c21xxeb, where 'xx' are  :-

1011  1111  DISPLAY
1111  1110  UP
1111  1101  DOWN
1111  0111  LEFT
1111  1011  RIGHT
1110  1111  SET
1101  1111  MENU
0111  1111 PRINT

So, the corresponding bit of the memory-mapped input/output register goes low when the key is pressed.
We want a '1' at the corresponding bit position.

Taking the SET key as an example,  the mask is 00001000

(the nibble values are 8,4,2,1)

(because there are four nibbles before the bit position and three after).

MENU key would be  :-

00002000.

Work out the others and post them, I will check.
« Last Edit: 27 / April / 2010, 11:25:41 by Microfunguy »

Re: A1100 IS Porting thread
« Reply #161 on: 27 / April / 2010, 11:46:48 »
Sorry,still not very clear.
I know how this come
1110  1111  SET
but do not know to it change to  00001000

I do not very clear about the 8,4,2,1

Re: A1100 IS Porting thread
« Reply #162 on: 27 / April / 2010, 11:51:45 »
We are looking for the position of the '0'.

It is in the left nibble.

The bit values are 8,4,2,1 measured from left to right.
It is at far right position so its value is '1'.

For MENU, the '0' is in third position from right so its value is 2.

Re: A1100 IS Porting thread
« Reply #163 on: 27 / April / 2010, 12:54:26 »
Have you got shoot_full and shoot_half in the correct order.

shoot_half shows two bit positions going low, which you would only expect for shoot_full.

For physw_status[2] values I get  :-

00004000
00000100
00000200
00000800
00000400
00001000
00002000
00008000


Re: A1100 IS Porting thread
« Reply #164 on: 28 / April / 2010, 00:54:20 »
OK,The keymap is done.Next...
 How the keys_marks values come from?

#define KEYS_MASK0 (0x00020000)
#define KEYS_MASK1 (0x00000000)
#define KEYS_MASK2 (0x00000DFF)

Re: A1100 IS Porting thread
« Reply #165 on: 28 / April / 2010, 00:59:10 »
And this time I think  I can call the chdk menu.How?
I press the print key.Now "alt" text on the screen.
I have not use the chdk before.

Re: A1100 IS Porting thread
« Reply #166 on: 28 / April / 2010, 01:17:27 »
Have you got shoot_full and shoot_half in the correct order.

shoot_half shows two bit positions going low, which you would only expect for shoot_full.

For physw_status[2] values I get  :-

00004000
00000100
00000200
00000800
00000400
00001000
00002000
00008000
Yes,I writ wrong,The  shoot_full and shoot_half should swith like
KEY_SHOOT_FULL            90ff------>                   90cf(physw_status[2])
KEY_SHOOT_HALF           90ff------>                     90ef(physw_status[2])

Re: A1100 IS Porting thread
« Reply #167 on: 28 / April / 2010, 01:30:41 »
Ok,I can all chdk menu now.The keys_marks is not fixed.
The chdk menu cant separate from canon menu.
When I press any key,Two menu response.And canon menu is before the chdk menu.

this is because the keys_marks value do not fixed?
How these value from?
#define KEYS_MASK0 (0x00020000)
#define KEYS_MASK1 (0x00000000)
#define KEYS_MASK2 (0x00000DFF)

Re: A1100 IS Porting thread
« Reply #168 on: 28 / April / 2010, 02:38:02 »

The KEY_MASK? macros should be the or of all the masks of keys that correspond to the specific index (i.e. for KEY_MASK0  you should take the masks of keys that are represented in physw_status[0]).

Sorry,as my bad english,I do not understand these clear.

I konw how to generate  the keymap with the help of Microfunguy.

But I do not understand how to general the keyMask

my keymap:
Code: [Select]
static KeyMap keymap[] = {
/* tiny bug: key order matters. see kbd_get_pressed_key()
* for example
*/
{ 1, KEY_DISPLAY , 0x00004000 },   
{ 2, KEY_SHOOT_FULL , 0x00000020 },
{ 2, KEY_SHOOT_HALF , 0x00000010 },
{ 1, KEY_UP , 0x00000100 },
{ 1, KEY_DOWN , 0x00000200 },
{ 1, KEY_LEFT , 0x00000800 },
{ 1, KEY_RIGHT , 0x00000400 },
{ 1, KEY_SET , 0x00001000 },
{ 2, KEY_ZOOM_IN , 0x00000040 },
{ 2, KEY_ZOOM_OUT , 0x00000080 },
{ 1, KEY_MENU , 0x00002000 },
{ 1, KEY_PRINT , 0x00008000 },   
        { 0, 0, 0 }
};

Re: A1100 IS Porting thread
« Reply #169 on: 28 / April / 2010, 02:48:47 »
nihao xiaofeng! )))
any news?
« Last Edit: 28 / April / 2010, 03:02:44 by igorstu »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal