Closed athertop closed 8 years ago
Are you sure is "Pause".
Last I've seen was "Brake"
And yes that's a new "Flight Mode" :)
Well spotted - my deliberate mistake ;-) It is indeed 'Brake mode', anyway, changing 17 to 18 fixes this.Strangely, the wav file for Brake mode is already present in the repository, so we are all good there.
Yes. As Brake mode can be used on a Aux function (CH7 to CH12) the sound appears isolated (I use it on CH7), but for the sake of consistency can be added to the Flight modes list also. btw: tables consume lots of memory on Lua, and we must be careful with its usage.
Ivale, The sound files for the "Brake" mode and the coding is already configured/included in the project (you will see the FlightMode array which starts on line 102 includes the "Brake" mode) - its just that the coding error was preventing them from being used. Like I said, changing 17 to 18 on line 498 fixes this. I am hoping that Clooney will apply the suggested fix, along with the other fixes I detailed in another post for Open Tx 2.1.7. I haven't heard from Jochen in a while now. The project seems to have gone quiet.
Pull request issued above
The fix now merged for this issue
If you select Pause mode (new in 3.3) it siaplays/calls "Invalid Flight mode". I have tracked this down to line 498 which reads: if FmodeNr<1 or FmodeNr>17 then
it should read:
if FmodeNr<1 or FmodeNr>18 then
FmodeNr is set in the LUA to the Telem Flight Mode + 1, but the Pause Mode is APM mode 17, so this sets FmodeNr to 18 which the current line 498 equates to TRUE so fmodeNr is set to 13 inside the IF staement, which is 'Invalid flight mode'. Simple fix - replace 17 with 18, or instead use table.getn(FlightMode) to simply refer to the array length. This way you can add future flight modes to the start of this code without worrying about This IF statement.