feat(radio): refactor of switch handling to better support customisable switches (#6095)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
philmoz
2025-07-28 12:59:22 +10:00
committed by GitHub
co-authored by philmoz 3djc elecpower
parent 28833f42e6
commit 0c8c39b134
155 changed files with 4538 additions and 2306 deletions
-2
View File
@@ -17,5 +17,3 @@
#include "hal/switch_driver.h"
#include "stm32_switch_driver.h"
SwitchHwPos bsp_get_switch_position(const stm32_switch_t *sw, SwitchCategory cat, uint8_t idx) {return SWITCH_HW_MID;}
+2
View File
@@ -830,6 +830,8 @@
// LED Strip
#if !defined(RADIO_NV14_FAMILY)
#define LED_STRIP_LENGTH 4
#define BLING_LED_STRIP_START 0
#define BLING_LED_STRIP_LENGTH 4
#define LED_STRIP_GPIO GPIO_PIN(GPIOH, 12) // PH.12 / TIM5_CH3
#define LED_STRIP_GPIO_AF LL_GPIO_AF_2 // TIM3/4/5
#define LED_STRIP_TIMER TIM5
@@ -32,7 +32,7 @@
static const char _switch_names[][4] = {"SW2", "SW3"};
SwitchHwPos boardSwitchGetPosition(SwitchCategory cat, uint8_t idx)
SwitchHwPos boardSwitchGetPosition(uint8_t idx)
{
if (idx <= 1) {
// uint16_t swVal = getAnalogValue(4);
@@ -55,7 +55,7 @@ SwitchHwPos boardSwitchGetPosition(SwitchCategory cat, uint8_t idx)
return SWITCH_HW_UP;
}
const char* boardSwitchGetName(SwitchCategory cat, uint8_t idx)
const char* boardSwitchGetName(uint8_t idx)
{
return _switch_names[idx];
}