Skip to content

Commit

Permalink
Merge branch 'phazerville' into dev/1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
djphazer committed Jan 7, 2024
2 parents fa5298f + 3098f2d commit cf692cc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
28 changes: 22 additions & 6 deletions software/o_c_REV/APP_HEMISPHERE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down Expand Up @@ -475,6 +489,7 @@ public:
bool p = clock_m->IsPaused();
clock_m->Start( !p );
}
popup_tick = OC::CORE::ticks;
}

void ToggleClockSetup() {
Expand Down Expand Up @@ -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();

Expand Down
6 changes: 6 additions & 0 deletions software/o_c_REV/OC_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cf692cc

Please sign in to comment.