Renamed UI_NO_KEYBOARD macro to CONFIG_UI_NO_KEYBOARD

pull/238/head
Silvano Seva 2023-12-28 10:39:32 +01:00
rodzic 8bc867beae
commit e54234f968
4 zmienionych plików z 27 dodań i 27 usunięć

Wyświetl plik

@ -227,7 +227,7 @@ typedef struct ui_state_t
freq_t new_offset;
// Which state to return to when we exit menu
uint8_t last_main_state;
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
uint8_t macro_menu_selected;
#endif // UI_NO_KEYBOARD
}

Wyświetl plik

@ -886,7 +886,7 @@ static bool _ui_exitStandby(long long now)
static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
{
// If there is no keyboard left and right select the menu entry to edit
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (msg.keys & KNOB_LEFT)
{
ui_state.macro_menu_selected--;
@ -902,9 +902,9 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
ui_state.input_number = ui_state.macro_menu_selected + 1;
else
ui_state.input_number = 0;
#else // UI_NO_KEYBOARD
#else // CONFIG_UI_NO_KEYBOARD
ui_state.input_number = input_getPressedNumber(msg);
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
// CTCSS Encode/Decode Selection
bool tone_tx_enable = state.channel.fm.txToneEn;
bool tone_rx_enable = state.channel.fm.rxToneEn;
@ -1171,7 +1171,7 @@ static void _ui_numberInputKeypad(uint32_t *num, kbd_msg_t msg)
{
long long now = getTick();
#ifdef UI_NO_KEYBOARD
#ifdef CONFIG_UI_NO_KEYBOARD
// If knob is turned, increment or Decrement
if (msg.keys & KNOB_LEFT)
{
@ -2140,10 +2140,10 @@ void ui_updateFSM(bool *sync_rtx)
{
case R_OFFSET:
// Handle offset frequency input
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if(msg.long_press && msg.keys & KEY_ENTER)
{
// Long press on UI_NO_KEYBOARD causes digits to advance by one
// Long press on CONFIG_UI_NO_KEYBOARD causes digits to advance by one
ui_state.new_offset /= 10;
#else
if(msg.keys & KEY_ENTER)
@ -2167,7 +2167,7 @@ void ui_updateFSM(bool *sync_rtx)
{
_ui_numberInputDel(&ui_state.new_offset);
}
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
else if(msg.keys & KNOB_LEFT || msg.keys & KNOB_RIGHT || msg.keys & KEY_ENTER)
#else
else if(input_isNumberPressed(msg))

Wyświetl plik

@ -1023,9 +1023,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
* If we have a keyboard installed draw all numbers, otherwise draw only the
* currently selected number.
*/
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 0)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
yellow_fab413, "1");
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
@ -1033,9 +1033,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
color_white, " %7.1f",
ctcss_tone[last_state.channel.fm.txTone]/10.0f);
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 1)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "2");
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
@ -1050,9 +1050,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "2");
}
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 2)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_RIGHT,
yellow_fab413, "3 ");
@ -1084,9 +1084,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
point_t pos_2 = {layout.line1_pos.x, layout.line1_pos.y +
(layout.line3_large_pos.y - layout.line1_pos.y)/2};
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 3)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_LEFT,
yellow_fab413, "4");
@ -1116,9 +1116,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
}
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 4)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "5");
@ -1139,18 +1139,18 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_CENTER,
color_white, mode_str);
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 5)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_RIGHT,
yellow_fab413, "6 ");
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_RIGHT,
color_white, "%.1gW", dBmToWatt(last_state.channel.power));
// Third row
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 6)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_LEFT,
yellow_fab413, "7");
#ifdef CONFIG_SCREEN_BRIGHTNESS
@ -1161,9 +1161,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
state.settings.brightness);
#endif
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 7)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "8");
#ifdef CONFIG_SCREEN_BRIGHTNESS
@ -1171,9 +1171,9 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
color_white, " B+");
#endif
#if defined(UI_NO_KEYBOARD)
#if defined(CONFIG_UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 8)
#endif // UI_NO_KEYBOARD
#endif // CONFIG_UI_NO_KEYBOARD
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_RIGHT,
yellow_fab413, "9 ");
if( ui_state->input_locked == true )

Wyświetl plik

@ -35,4 +35,4 @@ target_include_directories(app
${OPENRTX_ROOT}/subprojects/XPowersLib/src/REG
)
target_compile_definitions(app PRIVATE PLATFORM_TTWRPLUS CONFIG_SCREEN_BRIGHTNESS UI_NO_KEYBOARD)
target_compile_definitions(app PRIVATE PLATFORM_TTWRPLUS CONFIG_SCREEN_BRIGHTNESS CONFIG_UI_NO_KEYBOARD)