From 16b4658a713db57435f29a49e1f973137dc80d99 Mon Sep 17 00:00:00 2001 From: diyelectromusic <68612569+diyelectromusic@users.noreply.github.com> Date: Mon, 17 Apr 2023 20:50:49 +0100 Subject: [PATCH] If running on a RPI 1 or single core Pi then default to the TG1 menu as the home menu. --- src/uimenu.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/uimenu.cpp b/src/uimenu.cpp index ee830166..035822f7 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -338,6 +338,23 @@ CUIMenu::CUIMenu (CUserInterface *pUI, CMiniDexed *pMiniDexed) m_nCurrentParameter (0), m_nCurrentMenuDepth (0) { +#ifndef ARM_ALLOW_MULTI_CORE + // If there is just one core, then there is only a single + // tone generator so start on the TG1 menu... + m_pParentMenu = s_MainMenu; + m_pCurrentMenu = s_TGMenu; + m_nCurrentMenuItem = 0; + m_nCurrentSelection = 0; + m_nCurrentParameter = 0; + m_nCurrentMenuDepth = 1; + + // Place the "root" menu at the top of the stack + m_MenuStackParent[0] = s_MenuRoot; + m_MenuStackMenu[0] = s_MainMenu; + m_nMenuStackItem[0] = 0; + m_nMenuStackSelection[0] = 0; + m_nMenuStackParameter[0] = 0; +#endif } void CUIMenu::EventHandler (TMenuEvent Event) @@ -360,13 +377,28 @@ void CUIMenu::EventHandler (TMenuEvent Event) break; case MenuEventHome: +#ifdef ARM_ALLOW_MULTI_CORE m_pParentMenu = s_MenuRoot; m_pCurrentMenu = s_MainMenu; m_nCurrentMenuItem = 0; m_nCurrentSelection = 0; m_nCurrentParameter = 0; m_nCurrentMenuDepth = 0; - +#else + // "Home" is the TG0 menu if only one TG active + m_pParentMenu = s_MainMenu; + m_pCurrentMenu = s_TGMenu; + m_nCurrentMenuItem = 0; + m_nCurrentSelection = 0; + m_nCurrentParameter = 0; + m_nCurrentMenuDepth = 1; + // Place the "root" menu at the top of the stack + m_MenuStackParent[0] = s_MenuRoot; + m_MenuStackMenu[0] = s_MainMenu; + m_nMenuStackItem[0] = 0; + m_nMenuStackSelection[0] = 0; + m_nMenuStackParameter[0] = 0; +#endif EventHandler (MenuEventUpdate); break;