EdgeTX / edgetx-sdcard

SD Card contents and images for EdgeTX
130 stars 42 forks source link

fix(SoarETX): Replace the way to identify the radio Switches #143

Closed frankiearzu closed 7 months ago

frankiearzu commented 7 months ago

Fixes #142 The way to find the switches worked in 2.9.4, but not in 2.10. Fixing it to a way that works for both.

The correction is for both version 1 (backward compatibility), and new v2.

The code for firmware 2.9.x (and before) was looking for a "trim" with name "Rl" to identify the "last" switch.. looks like is no longer there in 2.10.

Change the code to identify the switches using a pattern.

pfeerick commented 7 months ago

Yes, switch naming changing slightly with 2.10, so playing catchup with Lua now... i.e. same as in https://github.com/EdgeTX/edgetx-sdcard/pull/140. The perils of hard-coded switch names... you guys should be asking for constants ;)

frankiearzu commented 7 months ago

Yes, LUA constants should be better, someone provided that code when I asked in Discord. The only thing that I notice was that I created a model in 2.10 using the template.. worked fine, then downgraded to 2.9.4.. all my special functions who was setup as "!1x" was replaced as "1s". Then I deleted the model, and created from scratch in 2.9.4 from the same templates.. everything ok. I guess moving back version in the model is not compatible.. but is expected that we only should support moving up.. not down.

frankiearzu commented 7 months ago

Someone else tested my changes.. always good to have a second tester. image

pfeerick commented 7 months ago

Yes, that is the case... you can upgrade, but can't downgrade (i.e. the reason to keep backups)... settings will migrate forwards, but can't go backwards since older firmware doesn't know about newer firmware config format changes...