Ralim / IronOS

Open Source Soldering Iron firmware
https://ralim.github.io/IronOS/
GNU General Public License v3.0
7.21k stars 713 forks source link

Pressing both buttons is error-prone #348

Closed skorokithakis closed 5 years ago

skorokithakis commented 6 years ago

Pressing both buttons is mistaken for a single-button press most of the time.

On the idle screen, you can hold the settings button and it will show you the firmware version.

It looks like the two-button press is implemented as a check for pressing one button a short time after the other button has been pressed. Instead, it would be much more user friendly if it were implemented like so:

On button down, check if the other button is also down. If so, consider it a double-press. If not, continue waiting for the button to go up.

This leads to much more user-friendly behaviour, as it detects double-presses every time, and the user can more easily press one button and then the other to register as a double-press.

Ralim commented 6 years ago

Hi, The logic I have implemented is the exact inverse of yours, but your point still works perfectly fine. I'll have a fix for this merged into mainline along with the improved ADC and TS80 support Im trying to smash through now

skorokithakis commented 6 years ago

Hmm, out of curiosity, what's the current logic?

Ralim commented 6 years ago

Basically inverse,swap pressing down with releasing up :)

So when you press down it doesn't do anything but store it. Then on release it handles it. The catch was that it handles the release when all have been released and then looks at the current state, which means if you release them at different times that is delayed by more than the sampling frequency (50ms average) then it would only report one being released as it didn't still have the other one in memory. I've updated this in the ts80 fork but going to tweak it a bit further.

skorokithakis commented 6 years ago

Oh, I see. Yes, this was counter to my expectation so I didn't even realize it was triggered on release. Hopefully the way I described will be more intuitive!

skorokithakis commented 6 years ago

Is there any way I could try the code on this? I'm really struggling every time :(

Ralim commented 6 years ago

Yep I can make you up a build when I get back home from being away.

In most situations there are alternate exits rather than both buttons (such as holding the rear button).

skorokithakis commented 6 years ago

THAT WORKS?! Daaamn, you just saved me a lot of frustration. That's easier than pressing both buttons, thank you!

Ralim commented 6 years ago

Yeah, because the double press was hard for people I added it where that wasn't already used for something else :)

leeph commented 5 years ago

Thanks for raising this @skorokithakis - this was my single biggest complaint with the Ralim firmware. I'm literally so excited right now I'm going to power up my TS100 just to switch it off with the rear button :)

Really love the firmware in all other respects - thanks @Ralim !!!