Better long RESTORE key and POWER switch press behavior.

Caution: Non registered users only see threads and messages in the currently selected language, which is determined by their browser. Please create an account and log in to see all content by default. This is a limitation of the forum software.


Also users that are not logged in can not create new threads. This is a, unfortunately needed, counter measure against spam. Please create an account and log in to start new threads.

Don't Panic. Please wash hands.
  • Hi! Just got my MK2.


    So far so good, but i've found one inconvenience in handling long press of RESTORE and POWER. Long press is triggered when you release the key/switch which is not so intuitive. What i expected is long press action get triggered while i'm HOLDING down the key/switch (release won't do anything). That's how most electronic devices behave if they have long press action. So with such behavior you don't need to count the seconds since you see the action gets triggered and then you simply release the key.


    Also, after switching the kernel, it would be good to have automatic reset. At least it can be added as an option in setting.


    What do you think?

  • I don't think there is any specific reason it works like this. I guess mostly because it made the code small and easy to write. The code only takes action on a release and the timer that keeps track of "long press" is also reused as flag to see if the button was pressed at all. Using JZ opcode to check against zero (never pressed). Doing an action immediately when timer hits a certain value requires keeping track of the fact that it already happened and somehow stop the timer from overflow (or it will repeat actions while holding). As it is programmed now it relies on the fact the user will not press "forever" as I think it can overflow eventually and see it as a short press again.


    So if you accept "code space restrictions" as a good reason, I have a valid explanation ;-)

  • If there is any space left, I'd like to put this on the "nice-to-have" list for next year. TBH, I've had that exact same thought before, and I'd be OK with a "hard wait for button released" in case a long-press was found (that is: Pull low on reset, then hard-wait, then perform the selected action).


    Just to emphasize what "nice to have" means: It's not a requirement from the boss, but something that would make me smile - not mandatory at all, and low on the priority list. Peter's and my priority is currently the ACA1240/1260.

  • There is a little bit of space left at the end of the image. Maybe could move a text string or two to create a bit of extra code space were it is needed. IF (big if) we look at that we should collect the other ideas posted in the past. I remember there was a wish to switch between mono and stereo through restore key which isn't possible currently. Might as well put that also in, when I dive into the code base anyway.

  • The last reply was more than 365 days ago, this thread is most likely obsolete. It is recommended to create a new thread instead.