Making kbd.c code generic - page 3 - General Discussion and Assistance - CHDK Forum

Making kbd.c code generic

  • 51 Replies
  • 15266 Views
*

Offline msl

  • *****
  • 1276
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Making kbd.c code generic
« Reply #20 on: 13 / March / 2015, 09:06:28 »
Advertisements
A720 works fine, wiki updated.

msl
CHDK-DE:  CHDK-DE links

*

Offline srsa_4c

  • ******
  • 4430
Re: Making kbd.c code generic
« Reply #21 on: 13 / March / 2015, 19:50:18 »
I have tested the a460.
The following small correction should be OK for both the a460 and the a450 as these cameras only differ in the available zoom range.
Code: [Select]
Index: platform/a460/platform_kbd.h
===================================================================
--- platform/a460/platform_kbd.h (revision 4061)
+++ platform/a460/platform_kbd.h (working copy)
@@ -4,8 +4,7 @@
 #define KEYS_MASK0 0x00000000
 #define KEYS_MASK1 0x00000000
 
-// copied from old code, key map doesn't use all bits
-#define KEYS_MASK2 0x00001fff
+#define KEYS_MASK2 0x0000173f
 
 #define SD_READONLY_IDX 2
 #define SD_READONLY_FLAG 0x20000
Side note: I somehow don't get the 'section edit' links on the Testing Needed wikia page, so I have edited the whole page (which resulted in some noise due to some usual wikia weirdness).

*

Offline reyalp

  • ******
  • 13503
Re: Making kbd.c code generic
« Reply #22 on: 13 / March / 2015, 22:26:20 »
I have tested the a460.
The following small correction should be OK for both the a460 and the a450 as these cameras only differ in the available zoom range.
Done.
Quote
Side note: I somehow don't get the 'section edit' links on the Testing Needed wikia page, so I have edited the whole page (which resulted in some noise due to some usual wikia weirdness).
It seems only second level headings get the section edit button, so I switched them.

Thanks everyone for testing :) I wasn't sure how a wiki page would work for this, but it seems to be OK.
Don't forget what the H stands for.

*

Offline nafraf

  • *****
  • 1308
Re: Making kbd.c code generic
« Reply #23 on: 15 / March / 2015, 00:26:32 »
A810 works fine, wiki updated. Thanks


Re: Making kbd.c code generic
« Reply #24 on: 15 / March / 2015, 17:34:44 »
A1200 done - wiki updated.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 13503
Re: Making kbd.c code generic
« Reply #25 on: 15 / March / 2015, 20:14:25 »
This wasn't my invention, it's just how the ixus40 port was done. The firmware code uses system timers, and is quite different from anything that came later, so it's impossible to make it look/work like the usual keyboard code.
I updated ixus30 to use the standard press/release functions. If you (still?) have this camera and can confirm it works, I can do the ixus40 as well.

Another observation:
Since these cameras don't use the canon keyboard task for kbd_process (= script etc) they probably don't need to do the stack switch.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4430
Re: Making kbd.c code generic
« Reply #26 on: 17 / March / 2015, 18:56:20 »
I updated ixus30 to use the standard press/release functions. If you (still?) have this camera and can confirm it works, I can do the ixus40 as well.

Another observation:
Since these cameras don't use the canon keyboard task for kbd_process (= script etc) they probably don't need to do the stack switch.
Test went well, I've also removed the stack switch related code.

*

Offline srsa_4c

  • ******
  • 4430
Re: Making kbd.c code generic
« Reply #27 on: 19 / March / 2015, 17:06:28 »
Regarding the ixus110, I have reservations about having a variable in the mask define, but again this can be changed later if needed.
Did that again with the a470. These two cams will require attention when adding new features to the common code (they have CAM_OPTIONAL_EXTRA_BUTTON defined).

Regarding https://www.assembla.com/code/chdk/subversion/commit/4095 :
Does this combination even make sense? I would guess that people doing those ports simply forgot to undef CAM_USE_ZOOM_FOR_MF.
« Last Edit: 19 / March / 2015, 17:08:30 by srsa_4c »


*

Offline reyalp

  • ******
  • 13503
Re: Making kbd.c code generic
« Reply #28 on: 19 / March / 2015, 17:12:48 »
Does this combination even make sense? I would guess that people doing those ports simply forgot to undef KBD_ZOOM_FOR_MF_USE_MF_KEY.
I assume you mean undef  CAM_USE_ZOOM_FOR_MF, as the other one is my new define.

Those cameras (s2is, s3is, s80...) had a special version version of the function kbd_use_zoom_as_mf which
1) Checks if the MF key is pressed
2) Sends an MF key press to the canon firmware, in addition the the regular up/down

I assumed this means it was it intentional, but I don't have any of these cameras, so I don't really know if it makes sense. Without being able to test, I try to preserve the current behavior.

You can compare the two versions in the kbd_common.c file.

Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4430
Re: Making kbd.c code generic
« Reply #29 on: 19 / March / 2015, 17:27:35 »
Those cameras (s2is, s3is, s80...) had a special version version of the function kbd_use_zoom_as_mf which
1) Checks if the MF key is pressed
2) Sends an MF key press to the canon firmware, in addition the the regular up/down

I assumed this means it was it intentional, but I don't have any of these cameras, so I don't really know if it makes sense. Without being able to test, I try to preserve the current behavior.
Okay, I just tried it again (had to reset my settings for the SD override display to reappear). It does work (on the s3) and does have some advantage over the native method, so I guess it can stay. I'll revisit the s80 too.
edit:
It also works on the s80, although only for one shot (AF lock has to be re-activated for it to work again). This is because I have restricted SD override to AF lock. I think this is OK, no change needed.
« Last Edit: 19 / March / 2015, 17:42:02 by srsa_4c »

 

Related Topics