mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 10:12:50 +00:00
Finish config transition
This commit is contained in:
@@ -3,38 +3,26 @@
|
||||
|
||||
UpDownInterruptImpl1 *upDownInterruptImpl1;
|
||||
|
||||
UpDownInterruptImpl1::UpDownInterruptImpl1() :
|
||||
UpDownInterruptBase(
|
||||
"upDown1")
|
||||
{
|
||||
}
|
||||
UpDownInterruptImpl1::UpDownInterruptImpl1() : UpDownInterruptBase("upDown1") {}
|
||||
|
||||
void UpDownInterruptImpl1::init()
|
||||
{
|
||||
|
||||
if (!radioConfig.preferences.updown1_enabled)
|
||||
{
|
||||
if (!moduleConfig.payloadVariant.canned_message.updown1_enabled) {
|
||||
// Input device is disabled.
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t pinUp = radioConfig.preferences.inputbroker_pin_a;
|
||||
uint8_t pinDown = radioConfig.preferences.inputbroker_pin_b;
|
||||
uint8_t pinPress = radioConfig.preferences.inputbroker_pin_press;
|
||||
uint8_t pinUp = moduleConfig.payloadVariant.canned_message.inputbroker_pin_a;
|
||||
uint8_t pinDown = moduleConfig.payloadVariant.canned_message.inputbroker_pin_b;
|
||||
uint8_t pinPress = moduleConfig.payloadVariant.canned_message.inputbroker_pin_press;
|
||||
|
||||
char eventDown =
|
||||
static_cast<char>(InputEventChar_KEY_DOWN);
|
||||
char eventUp =
|
||||
static_cast<char>(InputEventChar_KEY_UP);
|
||||
char eventPressed =
|
||||
static_cast<char>(InputEventChar_KEY_SELECT);
|
||||
char eventDown = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_DOWN);
|
||||
char eventUp = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_UP);
|
||||
char eventPressed = static_cast<char>(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_SELECT);
|
||||
|
||||
UpDownInterruptBase::init(
|
||||
pinDown, pinUp, pinPress,
|
||||
eventDown, eventUp, eventPressed,
|
||||
UpDownInterruptImpl1::handleIntDown,
|
||||
UpDownInterruptImpl1::handleIntUp,
|
||||
UpDownInterruptImpl1::handleIntPressed);
|
||||
UpDownInterruptBase::init(pinDown, pinUp, pinPress, eventDown, eventUp, eventPressed, UpDownInterruptImpl1::handleIntDown,
|
||||
UpDownInterruptImpl1::handleIntUp, UpDownInterruptImpl1::handleIntPressed);
|
||||
inputBroker->registerSource(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user