chore(radio): remove hardware definitions present in JSON (#6437)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
co-authored by
philmoz
parent
2ca8e3e7b6
commit
df981597c6
@@ -23,7 +23,7 @@ set(SIMU_DRIVERS
|
||||
)
|
||||
|
||||
set(HW_DESC_JSON ${FLAVOUR}.json)
|
||||
AddHardwareDefTarget(${HW_DESC_JSON})
|
||||
# AddHardwareDefTarget(${HW_DESC_JSON})
|
||||
AddHWGenTarget(${HW_DESC_JSON} simu_keys simu_keys.inc)
|
||||
AddHWGenTarget(${HW_DESC_JSON} simu_switches simu_switches.inc)
|
||||
AddHWGenTarget(${HW_DESC_JSON} hal_adc_inputs hal_adc_inputs.inc)
|
||||
@@ -32,8 +32,8 @@ set(SIMU_DRIVERS ${SIMU_DRIVERS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/simu_keys.inc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/simu_switches.inc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/hal_adc_inputs.inc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${HW_DESC_JSON}
|
||||
)
|
||||
${RADIO_SRC_DIR}/boards/hw_defs/${HW_DESC_JSON}
|
||||
)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(SIMU_LUA_COMPILER)
|
||||
|
||||
@@ -413,6 +413,8 @@ extern volatile uint32_t rotencDt;
|
||||
|
||||
void OpenTxSimulator::rotaryEncoderEvent(int steps)
|
||||
{
|
||||
if (steps == 0) return;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION) && !defined(USE_HATS_AS_KEYS)
|
||||
static uint32_t last_tick = 0;
|
||||
if (steps != 0) {
|
||||
@@ -426,22 +428,14 @@ void OpenTxSimulator::rotaryEncoderEvent(int steps)
|
||||
last_tick = now;
|
||||
}
|
||||
#else
|
||||
// TODO : this should probably be handled in the GUI
|
||||
int key;
|
||||
#if defined(PCBXLITE)
|
||||
if (steps > 0)
|
||||
key = KEY_DOWN;
|
||||
else if (steps < 0)
|
||||
key = KEY_UP;
|
||||
#elif defined(KEYS_GPIO_REG_PLUS) && defined(KEYS_GPIO_REG_MINUS)
|
||||
if (steps > 0)
|
||||
key = KEY_MINUS;
|
||||
else if (steps < 0)
|
||||
key = KEY_PLUS;
|
||||
else
|
||||
#endif
|
||||
// Should not happen but Clang complains that key is unset otherwise
|
||||
return;
|
||||
if (keyIsSupported(KEY_UP) | keyIsSupported(KEY_DOWN)) {
|
||||
key = steps > 0 ? KEY_DOWN : KEY_UP;
|
||||
} else if (keyIsSupported(KEY_PLUS) | keyIsSupported(KEY_MINUS)) {
|
||||
key = steps > 0 ? KEY_MINUS : KEY_PLUS;
|
||||
} else {
|
||||
return; // not supposed to happen???
|
||||
}
|
||||
|
||||
setKey(key, 1);
|
||||
QTimer::singleShot(10, [this, key]() { setKey(key, 0); });
|
||||
|
||||
Reference in New Issue
Block a user