[nv14] Make Ghost menu work with joystick trims (#1416)

* Update radio_ghost_module_config.cpp

* Update board.h

* Update keys_driver.cpp

* Auto-formatting

* Add functions simply so gtests compiles

* Update board.h

define TRIMS_EMULATE_BUTTONS to avoid HW dependent defines in other code

* Update radio_ghost_module_config.cpp

Use TRIMS_EMULATE_BUTTONS rather than PCBNV14

* `simu` code behind build flag also

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
stefan73
2022-01-21 14:42:13 +10:00
committed by GitHub
co-authored by Peter Feerick
parent 91d3c88421
commit 1d7b04d679
4 changed files with 54 additions and 16 deletions
+15
View File
@@ -560,6 +560,21 @@ bool trimDown(uint8_t idx)
return readTrims() & (1 << idx);
}
#if defined(TRIMS_EMULATE_BUTTONS)
bool trimsAsButtons = false;
void setTrimsAsButtons(bool val) { trimsAsButtons = val; }
bool getTrimsAsButtons()
{
bool lua = false;
#if defined(LUA)
lua = isLuaStandaloneRunning();
#endif
return (trimsAsButtons || lua);
}
#endif
uint32_t readKeys()
{
uint32_t result = 0;