From 3098f2d5b177366673821bda632481865b73f198 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Michalek" Date: Sun, 7 Jan 2024 12:20:27 -0500 Subject: [PATCH] VOR btn fixes: cycle Clock in HEM; Vbias elsewhere In Hemisphere, VOR button _down_ cycles clock state, with visual feedback. In all other apps, VOR button _release_ cycles Vbias like before. --- software/o_c_REV/APP_HEMISPHERE.ino | 28 ++++++++++++++++++++++------ software/o_c_REV/OC_ui.cpp | 6 ++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/software/o_c_REV/APP_HEMISPHERE.ino b/software/o_c_REV/APP_HEMISPHERE.ino index 1f6dc7285..4c2cf9407 100644 --- a/software/o_c_REV/APP_HEMISPHERE.ino +++ b/software/o_c_REV/APP_HEMISPHERE.ino @@ -325,18 +325,28 @@ public: } } + void DrawPopup() { + graphics.clearRect(24, 23, 80, 18); + graphics.drawFrame(25, 24, 78, 16); + + graphics.setPrintPos(29, 28); + graphics.print("Clock "); + if (clock_m->IsRunning()) + graphics.print("Start"); + else + graphics.print(clock_m->IsPaused() ? "Armed" : "Stop"); + } + void View() { if (config_menu) { DrawConfigMenu(); - return; + //return; } - - if (clock_setup) { + else if (clock_setup) { HS::clock_setup_applet.View(LEFT_HEMISPHERE); - return; + //return; } - - if (help_hemisphere > -1) { + else if (help_hemisphere > -1) { int index = my_applet[help_hemisphere]; HS::available_applets[index].View(help_hemisphere); } else { @@ -356,6 +366,10 @@ public: if (select_mode == LEFT_HEMISPHERE) graphics.drawFrame(0, 0, 64, 64); if (select_mode == RIGHT_HEMISPHERE) graphics.drawFrame(64, 0, 64, 64); } + + if (OC::CORE::ticks - popup_tick < HEMISPHERE_CURSOR_TICKS) { + DrawPopup(); + } } void DelegateEncoderPush(const UI::Event &event) { @@ -475,6 +489,7 @@ public: bool p = clock_m->IsPaused(); clock_m->Start( !p ); } + popup_tick = OC::CORE::ticks; } void ToggleClockSetup() { @@ -512,6 +527,7 @@ private: int help_hemisphere; // Which of the hemispheres (if any) is in help mode, or -1 if none uint32_t click_tick; // Measure time between clicks for double-click + uint32_t popup_tick; // for button feedback int first_click; // The first button pushed of a double-click set, to see if the same one is pressed ClockManager *clock_m = clock_m->get(); diff --git a/software/o_c_REV/OC_ui.cpp b/software/o_c_REV/OC_ui.cpp index 747ffcd90..19e3d28c7 100644 --- a/software/o_c_REV/OC_ui.cpp +++ b/software/o_c_REV/OC_ui.cpp @@ -123,6 +123,12 @@ UiMode Ui::DispatchEvents(const App *app) { switch (event.type) { case UI::EVENT_BUTTON_PRESS: +#ifdef VOR + if (OC::CONTROL_BUTTON_M == event.control) { + VBiasManager *vbias_m = vbias_m->get(); + vbias_m->AdvanceBias(); + } else +#endif app->HandleButtonEvent(event); break; case UI::EVENT_BUTTON_DOWN: