diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbd4bdd..8941812 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,14 @@ jobs: run: | set -ex git submodule update --init --recursive - - name: Use Circle develop branch for WM8960 and i2c display support until it is merged upstream + - name: Use Circle develop branch for SSD1306 display rotation support until it is merged upstream run: | set -ex + cd circle-stdlib/ + git checkout e318f89 # Needed to support Circle develop? + cd - cd circle-stdlib/libs/circle - git checkout 646c362 # develop + git checkout ec09d7e # develop cd - - name: Install toolchains run: | diff --git a/src/config.cpp b/src/config.cpp index 1143476..5c52852 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -84,6 +84,8 @@ void CConfig::Load (void) m_nSSD1306LCDI2CAddress = m_Properties.GetNumber ("SSD1306LCDI2CAddress", 0); m_nSSD1306LCDWidth = m_Properties.GetNumber ("SSD1306LCDWidth", 128); m_nSSD1306LCDHeight = m_Properties.GetNumber ("SSD1306LCDHeight", 32); + m_bSSD1306LCDRotate = m_Properties.GetNumber ("SSD1306LCDRotate", 0) != 0; + m_bSSD1306LCDMirror = m_Properties.GetNumber ("SSD1306LCDMirror", 0) != 0; m_nLCDColumns = m_Properties.GetNumber ("LCDColumns", 16); m_nLCDRows = m_Properties.GetNumber ("LCDRows", 2); @@ -231,6 +233,16 @@ unsigned CConfig::GetSSD1306LCDHeight (void) const return m_nSSD1306LCDHeight; } +bool CConfig::GetSSD1306LCDRotate (void) const +{ + return m_bSSD1306LCDRotate; +} + +bool CConfig::GetSSD1306LCDMirror (void) const +{ + return m_bSSD1306LCDMirror; +} + unsigned CConfig::GetLCDColumns (void) const { return m_nLCDColumns; diff --git a/src/config.h b/src/config.h index be75100..eb14918 100644 --- a/src/config.h +++ b/src/config.h @@ -93,6 +93,8 @@ public: unsigned GetSSD1306LCDI2CAddress (void) const; unsigned GetSSD1306LCDWidth (void) const; unsigned GetSSD1306LCDHeight (void) const; + bool GetSSD1306LCDRotate (void) const; + bool GetSSD1306LCDMirror (void) const; unsigned GetLCDColumns (void) const; unsigned GetLCDRows (void) const; @@ -167,6 +169,8 @@ private: unsigned m_nSSD1306LCDI2CAddress; unsigned m_nSSD1306LCDWidth; unsigned m_nSSD1306LCDHeight; + bool m_bSSD1306LCDRotate; + bool m_bSSD1306LCDMirror; unsigned m_nLCDColumns; unsigned m_nLCDRows; diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 0e70b9c..5f2ad9d 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -948,13 +948,7 @@ void CMiniDexed::ProcessSound (void) assert (CConfig::ToneGenerators == 8); - // swap stereo channels if needed uint8_t indexL=0, indexR=1; - if (m_bChannelsSwapped) - { - indexL=1; - indexR=0; - } // BEGIN TG mixing float32_t tmp_float[nFrames*2]; @@ -1003,6 +997,13 @@ void CMiniDexed::ProcessSound (void) } // END adding reverb + // swap stereo channels if needed prior to writing back out + if (m_bChannelsSwapped) + { + indexL=1; + indexR=0; + } + // Convert dual float array (left, right) to single int16 array (left/right) for(uint16_t i=0; iGetLCDI2CAddress (); unsigned ssd1306addr = m_pConfig->GetSSD1306LCDI2CAddress (); if (ssd1306addr != 0) { - m_pSSD1306 = new CSSD1306Device (m_pConfig->GetSSD1306LCDWidth (), m_pConfig->GetSSD1306LCDHeight (), m_pI2CMaster, ssd1306addr); + m_pSSD1306 = new CSSD1306Device (m_pConfig->GetSSD1306LCDWidth (), m_pConfig->GetSSD1306LCDHeight (), + m_pI2CMaster, ssd1306addr, + m_pConfig->GetSSD1306LCDRotate (), m_pConfig->GetSSD1306LCDMirror ()); LOGDBG ("LCD: SSD1306"); if (!m_pSSD1306->Initialize ()) {