Skip to content

Commit

Permalink
Update to allow for font size as an option.
Browse files Browse the repository at this point in the history
  • Loading branch information
diyelectromusic committed May 7, 2024
1 parent 425b191 commit 90e81f5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ class CConfig // Configuration for MiniDexed
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;
unsigned GetST7789Backlight (void) const;
unsigned GetST7789Width (void) const;
unsigned GetST7789Height (void) const;
unsigned GetST7789Rotation (void) const;
bool GetST7789SmallFont (void) const;

unsigned GetLCDColumns (void) const;
unsigned GetLCDRows (void) const;
Expand Down Expand Up @@ -236,6 +237,7 @@ class CConfig // Configuration for MiniDexed
unsigned m_nST7789Width;
unsigned m_nST7789Height;
unsigned m_nST7789Rotation;
unsigned m_bST7789SmallFont;

unsigned m_nLCDColumns;
unsigned m_nLCDRows;
Expand Down
2 changes: 2 additions & 0 deletions src/minidexed.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -73,6 +74,7 @@ ST7789Backlight=
ST7789Width=240
ST7789Height=240
ST7789Rotation=0
ST7789SmallFont=0

# Default is 16x2 display (e.g. HD44780)
LCDColumns=16
Expand Down
3 changes: 2 additions & 1 deletion src/userinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion submod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90e81f5

Please sign in to comment.