Button Interrupt?

Started by nanomad, October 17, 2012, 10:08:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nanomad

So, I was wondering how the hell does canon know about keypresses. If it were me, I'd use an external interrupt driven by the TX chip and then run the appropriate handlers.
Does anyone know if it works like this?
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

Yes.

My theory:

- button presses originate from the MPU, via SIO3/MREQ: http://magiclantern.wikia.com/wiki/SIO3_MREQ
- 5Dc: bindGUISwitchCBR; on newer cameras it's more complicated, but along the same lines
- the bind function sends GUI events via GUI_Control (ML name: fake_simple_button).

In 5Dc, bindGUISwitchCBR is overriden to figure out which wheel was turned, because they both send the same GUI event (see gui.c).

However, I had no success porting this trick on 5D3 to figure out unhandled buttons that have all the same event code ( GUICMD_PRESS_BUTTON_SOMETHING ).


g3gg0

you can add a watchpoint to GUI_CONTROL function and look at the call trace if that helps
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

a1ex

GUI_CONTROL processes the event in gui_main_task (Canon's button handler), and GUI_Control sends it to gui_main_task. Small difference, but kinda important.

nanomad

Thanks for the info, I really hope I can manage to fix the damn button codes once and for all :P
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

You are talking about AV button, right?

That one is tricky, as the MPU sends something like OLC_INFO_CHANGED...

nanomad

Not only the AV button, but also SET and other stuff.
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5