From 00e2f101bbd1082730ae6d8e07abb85c4c05c3f7 Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Tue, 18 Apr 2023 20:45:04 +0100 Subject: [PATCH] If running on a RPI 1 or single core Pi then default to the TG1 menu as the home menu. (#481) --- src/uimenu.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/uimenu.cpp b/src/uimenu.cpp index ee83016..035822f 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;