Add absolute knob positioning and horizontal keys emulation

replace/ae1f1307291b94316dbc547f4f9545773cd26639
Niccolò Izzo 2021-01-28 12:52:10 +01:00
rodzic 364f8d4e46
commit 0b98f50a12
4 zmienionych plików z 20 dodań i 2 usunięć

Wyświetl plik

@ -811,7 +811,7 @@ void ui_updateFSM(event_t event, bool *sync_rtx)
case MENU_MACRO:
_ui_drawDarkOverlay();
// If a number is pressed perform the corresponding macro
if(!msg.long_press && input_isNumberPressed(msg))
if(!msg.long_press)
{
_ui_fsm_menuMacro(msg, sync_rtx);
}

Wyświetl plik

@ -49,6 +49,19 @@ void kbd_terminate()
keyboard_t kbd_getKeys()
{
keyboard_t keys = 0;
/* Use absolute position knob to emulate left and right buttons */
static uint8_t old_pos = 0;
uint8_t new_pos = platform_getChSelector();
if (old_pos != new_pos) {
if (new_pos < old_pos)
keys |= KEY_LEFT;
else
keys |= KEY_RIGHT;
old_pos = new_pos;
}
/*
* First of all, configure the row lines as inputs. Since they are in common
* with the display, their configuration can have been screwed up by display
@ -73,7 +86,6 @@ keyboard_t kbd_getKeys()
* this means that we have to put a small delay before reading the GPIOs to
* allow voltage to settle.
*/
keyboard_t keys = 0;
gpio_setPin(KB_ROW1);
delayUs(1);

Wyświetl plik

@ -25,6 +25,9 @@
/* Device has a working real time clock */
#define HAS_RTC
/* Device has a channel selection knob */
#define HAS_ABSOLUTE_KNOB
/* Supported radio bands */
#define BAND_VHF
#define BAND_UHF

Wyświetl plik

@ -25,6 +25,9 @@
/* Device has a working real time clock */
#define HAS_RTC
/* Device has a channel selection knob */
#define HAS_ABSOLUTE_KNOB
/* Supported radio bands */
#define BAND_VHF
#define BAND_UHF