Update to allow for font size as an option.

pull/652/head
Kevin 11 months ago
parent 425b191bdc
commit 90e81f550d
  1. 5
      src/config.cpp
  2. 4
      src/config.h
  3. 2
      src/minidexed.ini
  4. 3
      src/userinterface.cpp
  5. 2
      submod.sh

@ -114,6 +114,7 @@ void CConfig::Load (void)
m_nST7789Width = m_Properties.GetNumber ("ST7789Width", 240);
m_nST7789Height = m_Properties.GetNumber ("ST7789Height", 240);
m_nST7789Rotation = m_Properties.GetNumber ("ST7789Rotation", 0);
m_bST7789SmallFont = m_Properties.GetNumber ("ST7789SmallFont", 0) != 0;
m_nLCDColumns = m_Properties.GetNumber ("LCDColumns", 16);
m_nLCDRows = m_Properties.GetNumber ("LCDRows", 2);
@ -367,6 +368,10 @@ unsigned CConfig::GetST7789Rotation (void) const
return m_nST7789Rotation;
}
bool CConfig::GetST7789SmallFont (void) const
{
return m_bST7789SmallFont;
}
unsigned CConfig::GetLCDColumns (void) const
{
return m_nLCDColumns;

@ -113,7 +113,7 @@ public:
unsigned GetSPIClockKHz (void) const;
// ST7789 LCD
bool GetST7789Enabled (void) const;
bool GetST7789Enabled (void) const;
unsigned GetST7789Data (void) const;
unsigned GetST7789Select (void) const;
unsigned GetST7789Reset (void) const;
@ -121,6 +121,7 @@ public:
unsigned GetST7789Width (void) const;
unsigned GetST7789Height (void) const;
unsigned GetST7789Rotation (void) const;
bool GetST7789SmallFont (void) const;
unsigned GetLCDColumns (void) const;
unsigned GetLCDRows (void) const;
@ -236,6 +237,7 @@ private:
unsigned m_nST7789Width;
unsigned m_nST7789Height;
unsigned m_nST7789Rotation;
unsigned m_bST7789SmallFont;
unsigned m_nLCDColumns;
unsigned m_nLCDRows;

@ -62,6 +62,7 @@ SSD1306LCDMirror=0
# Data = GPIO pin number
# Optional: Reset, Backlight = GPIO pin numbers
# Rotation=0,90,180,270
# SmallFont=0 (default), 1
#
# For a 240 wide display set LCDColumns=15 with LCDRows=2
SPIBus=
@ -73,6 +74,7 @@ ST7789Backlight=
ST7789Width=240
ST7789Height=240
ST7789Rotation=0
ST7789SmallFont=0
# Default is 16x2 display (e.g. HD44780)
LCDColumns=16

@ -95,7 +95,8 @@ bool CUserInterface::Initialize (void)
if (m_pST7789Display->Initialize())
{
m_pST7789Display->SetRotation (m_pConfig->GetST7789Rotation());
m_pST7789 = new CST7789Device (m_pSPIMaster, m_pST7789Display, m_pConfig->GetLCDColumns (), m_pConfig->GetLCDRows ());
bool bLargeFont = !(m_pConfig->GetST7789SmallFont());
m_pST7789 = new CST7789Device (m_pSPIMaster, m_pST7789Display, m_pConfig->GetLCDColumns (), m_pConfig->GetLCDRows (), bLargeFont, bLargeFont);
if (m_pST7789->Initialize())
{
LOGDBG ("LCD: ST7789");

@ -12,7 +12,7 @@ cd -
#
# Optional update submodules explicitly
cd circle-stdlib/libs/circle
git checkout f8c9026
git checkout 4155f43
cd -
cd circle-stdlib/libs/circle-newlib
#git checkout develop

Loading…
Cancel
Save