Generic functions for some CFn parameters

#716 Merged at d16247e
  1. Alex
  • Added a generic implementation for some CFn functions (ALO, HTP, MLU), to fix issues like #2345 (affected cameras: all except 5D2/50D/500D)

  • Removed FEATURE_EXPO_ISO_HTP (no real reason to change it from ML menus; it's the same as Canon's)

Nicer way to implement these generic getters/setters? Weak functions maybe?

To be merged after 70D and 100D.

  • Issues #2345: ALO mode detection fail closed

Comments (26)

  1. nikfreak

    Maybe might fit into this PR as it has to do with CFn and 100D/SL1 which has a combined q/set button which you can assign via CFn to do something.take a look at the screenshot below as I would like to do the following:

    • If ML not loaded take the assigned setting from canon menu
    • Once ML is loaded override the setting to do nothing. Just plain set button functionality everywhere.

    Most cameras have the first assignment "0-Disabled" but ofc 100D is not able to do so. One should make a petition a force Canon to release a unified fw update where this setting is available but that's another story.

    On SL1 in its default setting "0: Quick Control screen" the gui events are like this:

    • BGMT_Q
    • BGMT_Press_Set
    • BGMT_Unpress_Set

    In sum there are 6 settings. Assigning 1 to 5 it turns out to be the other way like:

    • BGMT_Press_Set
    • BGMT_Unpress_Set
    • ....

    Leave alone the option to be able to assign a button and override the functionality it's clear that opening up Q-Menu is an optional feature. One can open it at any time via the touch LCD in photo (evf) mode or simply use Canon or even ML menu to make adjustments.

    Hacking it like described above I would be able to find a unified solution and implement a fake BGMT-Q by a longrpress on set button. Any hints for accomplishing it? Atm I hacked the button to act as a SET button only and return 0 for BGMT_Q. In ML menu I use BQMT_Q_ALT (Av) but I have no fallback for the situation where one would assign 1 to 5 by himself via CFn setting. Hope you get what I mean.


    1. Alex author

      Indeed, forcing the SET button functionality at startup should work.

      For the long-press trick, I guess you tried to adapt the EOS M code, where we bring ML menu by a long-press of the delete button, right?

      1. nikfreak

        No I rather tried and experimented with the 1100D code together with the longpress detection and adjusted to my needs. But whatever I did I ended up with the same result:

        Therefore I think it will help a lot if we can override / disable the CFn setting to do nothing.

        1. Alex author

          Ah, you use a dummy value for BGMT_Q, right? In this case, just put any negative number; these are never passed to Canon code, so you don't need to return 0 manually.

          If you change the CFn, do the button codes from SET change?

          1. nikfreak

            No dummy value. I use the exact value, The button codes remain same.Just the order changes. For e.g. there's an option in CFn where you can assign set to "open Menu". The button codes from 1 to 5 are the other way around as described above. In the case of "5: open Menu" it would be:

            • BGMT_PESS_SET
            • BGMT_PRESS_UNSET
            • BGMT_MENU
                1. nikfreak

                  Ok let's scratch / forget the button mapping discussions here and leave it as it is for now. If it comes up again we will discuss it in the 100D PR. Some users reported a "need" for BGMT_Q in lua etc but grepping for BGMT_Q I don't see much use of it and there's no reason I couldn't custom code it to use another button or use something like fake_simple_button

                  1. nikfreak

                    Btw if you read this can you check the "online firmware signer". Was getting "upload failed" error all the day while trying to renew the 100D installers

                    1. Georg Hofstetter

                      Status: 'Created .FIR for 100D (ID 0x346) from template AES_single.FIR'

                      works here. still a problem?

                      1. nikfreak

                        Works now. Probably user error and I might have used "MASTER" instead of "SLAVE"last time.

        2. Alex author

          Looking at the 1100D code, it seems to react when you are de-pressing the button, rather than after some fixed timeout. The EOS M code opens the menu after 500ms of holding the delete button. I prefer the second method.

          For the CFn problem, what about faking MLEV_JOYSTICK_LONG instead of BGMT_Q?

          1. nikfreak

            Just tried the EOSM code and it looks like I could use that too but CFn remains difficult. I think I need something like

            • get_setbtn_cfn (check if it is 0:QCS) like seen in screenshot above
            • if not 0:QCS then force it with set_setbtn_cfn to be 0:QCS (loop task?)

            Any idea how to achieve it?

            1. Alex author

              I'm confused.

              You are using the Av button, so it shouldn't have anything to do with the custom functions.

              You also said 'But whatever I did I ended up with the same result: faking button BGMT_Q will end up in calling whatever is set under CFn "Assign SET button"'.

              I gave you the solution: fake MLEV_JOYSTICK_LONG instead of BGMT_Q (in menu, they do the same thing, but MLEV is never passed to Canon code).

              If it's not that, can you re-state what the problem is?

              1. nikfreak

                Ofc I can.

                • 100D is perfect in terms of menu it with a longpress / shortpress solution or returning 0 for BGMT_Q (ike I do atm). No problems with menu
                • I need to make it foolproof because the button events change if the CFn setting is not 0:QCS
                • CFn 1-5 is vice versa in terms of button events. if user sets this then things get broken and outside of ML menu some sub-Q-menu will pop up again
                • So I need to fix it to be 0:QCS always
                • MLEV_JOYSTICK would work same as the actual EOSM press down/erase solution but only if 0:QCS is set

                Maybe I am just thinking about it too much. As said i am also comfortable with my override in gui.c by returning 0 but also this does only work with 0:QCS. I can leave a comment in the top of 100D thread and inform people to set it to 0:QCS and never play with it...

                1. Alex author

                  I'm not sure I understand. What do you mean by "outside of ML menu some sub-Q-menu will pop up again" ?

                      1. Alex author

                        Ah, looks like the issue may be from the Q hack. If you disable it, the other CFn's work fine, right?

                        So, you are looking for a way to recognize when SET was pressed (easy), and also a way to block the event in order to use SET for ML functions, other than menu (and this part depends on which CFn is selected).

                        Ideally, all this should work if user code (e.g. ettr, shortcuts or whatever) checks a single event code (BGMT_PRESS_SET), and can return 0 to block it, just like on all other cameras.

                        Correct so far?

                        In this case, since all the other settings (except QCS) start with BGMT_PRESS_SET, would it make sense to block the Q event only when that CFn is set on QCS?

                        1. nikfreak

                          Exactly! Till now I am doing it by returning 0 to block Q completely and everywhere. For bocking it only when 0:QCS is also a good idea but I also want to get rest assured that it won't trigger those dialogs (Q-Sub-menus). If you got any suggestion then shout it out.

                          1. nikfreak

                            Just risked it and used SetCFndata (0,7,6) to set CFn7 "Assign Set button" to a fake value. 100D has 0,1,2,3,4,5.

                            Overriding to 6 now returns a BGMT_UNPRESS_SET now everywhere. From here on I think it should be no problem to modify it to be BGMT_PRESS_SET followed by UNPRESS_SET and fake simple buttons via short and longpress everywhere. Though I wouldn't need it as it' perfect now with Trash button and Av in menu. Just unsure if this method would get rejected by you. If not I guess it should be something like

                            • On ML load fake it once and set to the fake value
                            • maybe on shut down set it to 0 again but that's optional. I am able to manually set it between 0 and 5 again via CFn7 menu
                            • maybe use short / longpress ISO button to call the Q-gui

                            and voila cam would be perfect.

  2. Walter Schulz

    Unable to reproduce ALO status error with 7D. Works with older builds and generic-cfn. Able to reproduce with 650D and fixed with generic-cfn.

    Minimal issue with "ALO active" screen info not vanishing after deactivation. Neglectable.

    1. Alex author

      Yeah, not all cameras had problems with ALO status, but all of them are affected by the change (same code running on all cameras).

  3. Georg Hofstetter

    what about putting such code into a module-kind object that will be loaded on startup? depending on the model, the correct module is loaded and provides the functionality via weak functions. would make the "core-code" more generic.