edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

feat(radio): allow state of Sticky LS to persist across reboot or EM.

Open philmoz opened this issue 1 year ago • 7 comments

Persistence across EM is useful when recovering model state.

Not sure whether persistence on reboot is a good idea or not - opinions?

philmoz avatar May 07 '24 03:05 philmoz

Persistence on EM makes a lot of sense, but I believe not at all on reboot imho.

3djc avatar May 07 '24 05:05 3djc

On EM, definitely. Across reboot... only as an option. There are times where the LS being able to remember it's state (just like with customisable switches) would be advantageous.

pfeerick avatar May 07 '24 05:05 pfeerick

Could you describe such a scenario?

3djc avatar May 07 '24 06:05 3djc

For the same reason as with customisable switches... when using momentary switches as 2POS, and remembering the state across reboots.

pfeerick avatar May 07 '24 06:05 pfeerick

That works for customizable switches because they have a led to indicate the state. Bad idea for LS I think

3djc avatar May 07 '24 06:05 3djc

Even as an option, rather than the default? :thinking: So what happens when I use a SF to adjust a GV to get that persistence? Is that not dangerous also (with more steps, and loss of both SFs and GVs in the process).

pfeerick avatar May 07 '24 06:05 pfeerick

I've added an option flag so users can decide if a Sticky LS should persist across reboots.

philmoz avatar May 07 '24 11:05 philmoz

Is it at all feasible to add an option like this to the actual LS menu? With all the other options? So you can choose for individual STKY actions. Just throwing that out there (or maybe that’s what this is about and I just can’t interpret the code changed 😂)

inventor7777 avatar May 31 '24 12:05 inventor7777

LGTM on TX16S and TX12, and read/write to TX12 with companion fine. Simulator for X9D+2019 looks good also...

pfeerick avatar Jun 02 '24 06:06 pfeerick

Is it at all feasible to add an option like this to the actual LS menu? With all the other options? So you can choose for individual STKY actions. Just throwing that out there (or maybe that’s what this is about and I just can’t interpret the code changed 😂)

Not quite sure what you mean... this adds this as an option to all sticky functions... i.e. you have the option to make the state persistent across reboots.

pfeerick avatar Jun 02 '24 06:06 pfeerick

Not quite sure what you mean... this adds this as an option to all sticky functions... i.e. you have the option to make the state persistent across reboots.

After testing it on my radio, I now realize that that was the whole purpose, but I just didn't pay enough attention to the new code 😂

inventor7777 avatar Jun 03 '24 14:06 inventor7777

@philmoz The Persist option does not seem to work on my MT12. I have an LS set to persist, and after a reboot it ignores the persistence function. One other bizarre thing is that both positions trigger a sound file to play (via SF), but it just plays both of them in an row after a reboot regardless of which position I left it in. (which is not at all helpful).

inventor7777 avatar Aug 07 '24 22:08 inventor7777

Works fine for me. Are you sure that the logic for the LS is not causing it to be reset after boot up?

philmoz avatar Aug 07 '24 23:08 philmoz

I also can't reproduce this. A Sticky LS (LS1), triggered by SC down, and marked as persistent, is correctly saving it's states for me on MT12 with current nightly. And two SFs, one triggered by LS1, and the other !LS1, is correctly only being triggered by the active state on radio boot.

pfeerick avatar Aug 08 '24 05:08 pfeerick

Okay, I found the issue. I had V1 and V2 set to SB^ (which is always active except when pressed) so I think when the radio restarted it would confuse the LS and it would toggle back on. Once I switched it to only be active when pressed down, all issues vanished. I really should have tried that before commenting 🤣 😂

thanks guys!

inventor7777 avatar Aug 08 '24 12:08 inventor7777