Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lua): stick "side" missing from model.getInput #5801

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

forbesmyester
Copy link
Contributor

@forbesmyester forbesmyester commented Jan 18, 2025

Model > Input -> Side is missing from the Lua API.

This PR puts it back in.

NOTE: I think this is correct, I've been able to compile firmware, but currently I am unable to get the simulator to compile on a Ubuntu22 VM. It dies with the following error and my C++ skills are not going to be sufficient to move forward.

In file included from /home/user/edgetx/edgetx_main/companion/src/firmwares/eeprominterface.h:27,
                 from /home/user/edgetx/edgetx_main/companion/src/storage/eepe.cpp:24:
/home/user/edgetx/edgetx_main/build-output/native/../../radio/src/definitions.h:28:10: fatal error: memory_sections.h: No such file or directory
   28 | #include "memory_sections.h"
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

@pfeerick pfeerick changed the title [lua] Add mode (input side) to Lua API fix(lua): "mode" missing from model.getInput Jan 19, 2025
@pfeerick pfeerick added bug 🪲 Something isn't working lua-api Lua API related labels Jan 19, 2025
@pfeerick pfeerick added this to the 2.11 milestone Jan 19, 2025
@forbesmyester
Copy link
Contributor Author

If I wasn't clear, the actual firmware does compile, but that's all the testing I could do, I spent the whole morning trying with companion.

@pfeerick pfeerick force-pushed the feat-lua-input-mode branch from 034aa95 to c098a07 Compare January 19, 2025 10:45
@pfeerick
Copy link
Member

pfeerick commented Jan 19, 2025

No, that was clear... I've just rebased this on the current state of main as it was from before a fix was pushed for the just-broken Companion builds. So Companion should work for you again locally if you reset your local branch to the remote branch.

@pfeerick
Copy link
Member

pfeerick commented Jan 21, 2025

Ok, so this is working fine on GX12, is returning/displaying 3, 2 or 1 depending on the side mode set. Should this be mode or perhaps instead side?

-- "TNS|PR5801 Test|TNE"

local modelInput
local exit = 0

local function init()
  modelInput = model.getInput(0,0)
end

local function run(event, touchState)
  lcd.clear()

  lcd.drawText( 0, 0, "PR5801 modelInput.mode")
  lcd.drawText( 0, 20, "Mode : " .. tostring(modelInput.side) )

  if event == EVT_VIRTUAL_EXIT then 
    exit = 1
  end 
  return exit
end

return { run=run, init=init }

@forbesmyester
Copy link
Contributor Author

Perfectly happy with either. I did think about that but instead documented that it was side.

Happy to make the change if you want

@pfeerick
Copy link
Member

pfeerick commented Jan 21, 2025 via email

@pfeerick pfeerick changed the title fix(lua): "mode" missing from model.getInput fix(lua): stick "side" missing from model.getInput Jan 21, 2025
@pfeerick pfeerick merged commit 9fb053a into EdgeTX:main Jan 21, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working lua-api Lua API related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants