edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

Bug: Modes active in Mixes - #8 cannot be de-selected

Open MartyFufkin opened this issue 5 years ago • 11 comments

I searched for Modes in Mixes in open issues and didn't see anything.

Describe the bug When editing a Mixer channel, the all the modes can be selected or de-selected (yellow to light blue in default theme)

To Reproduce Model Settings --> Mixes --> Select any channel and Edit --> Try to de-select Mode 8. All other modes can be de-selected except number 8 (remains yellow).

Expected behavior I expect number 8 to toggle like numbers 0 through 7.

Screenshots Mixer Mode 8

General information

  • EdgeTX version 2.4.0 d878efb3
  • Hardware: Radiomaster TX16S

MartyFufkin avatar Jul 02 '21 19:07 MartyFufkin

TX16S nightly d878efb confirm non desectability of Mode 8

jogybaer0815 avatar Jul 02 '21 21:07 jogybaer0815

Yeah, confirmed here also. RM-TX16S, touchscreen fix PR firmware.

pfeerick avatar Jul 03 '21 04:07 pfeerick

@raphaelcoeffic This is the offending line https://github.com/EdgeTX/edgetx/blob/4667b296989dc19c0d6915c031f401a6f28542d5/radio/src/gui/colorlcd/model_mixes.cpp#L145

as opposed to this one for the inputs page, which doesn't have a problem... https://github.com/EdgeTX/edgetx/blob/4667b296989dc19c0d6915c031f401a6f28542d5/radio/src/gui/colorlcd/model_inputs.cpp#L293

BUT am I missing something, and they're BOTH wrong? Since the variable i has been declared as a uint8_t, yet, in the case of the admittedly apparently working inputs page (where a quick test with FM8 seemed to work on the transmitter), it it seems to be doing a bit manipulation treating it as a uint32_t ... but there's nine flight modes with a eight bit value?

I'm thinking a PR changing the i in both instances uint32_t across the board for that loop? Both the MixData and ExpoData (also for Input) data structures declare uint32_t flightModes:9; after all...

pfeerick avatar Jul 03 '21 10:07 pfeerick

Flightmode 0 is assigned when NO other flightmode is assigned. So perhaps when the parameter is null, it should default to 0, and when it has a value not null, it will get the value. Sneaky way to get nine bits out of a byte?

lshems avatar Jul 03 '21 10:07 lshems

I don't think so... it's a uint32 value in the underlying data structures, plus it's inconsistent between implementations. In the case of the mix page, the flight mode just can't be toggled, in the case of the inputs page, I got no idea why it actually seems to works, and with the headache I currently have, I'm in no mood to step through the logic problem. 😆

Actually setting to uint32_t values does appear to work though... but will need more testing obviously...

pfeerick avatar Jul 03 '21 10:07 pfeerick

Ah, the headaches paradox. Lots of people are not in the 'mood' because of a headache. But doing some 'fun' stuff takes away blood from the parts in the brain causing the headache. So the general advice I always give: just have fun!

lshems avatar Jul 03 '21 10:07 lshems

So you had your pleasure fixing this one after all. Lol.

lshems avatar Jul 03 '21 11:07 lshems

I decided to play wack-a-mole and test it tomorrow ... if that fails, I'll delete it, deny it ever happened, and we won't ever speak of this issue again. 😆

pfeerick avatar Jul 03 '21 11:07 pfeerick

@MartyFufkin Would you mind giving #394 a try and see if it works properly for you... and double check the inputs page also - it was working before, but I've changed the code there also to be consistent.

Direct link to the firmware files => https://github.com/EdgeTX/edgetx/suites/3149558893/artifacts/72406020

pfeerick avatar Jul 04 '21 02:07 pfeerick

I'm away from home next couple of days but I will try it Monday or Tuesday.

MartyFufkin avatar Jul 04 '21 13:07 MartyFufkin

I flashed the firmware from the Direct Link and I can confirm that this issue appears to be fixed. Nice work guys.

MartyFufkin avatar Jul 05 '21 14:07 MartyFufkin