Skip to content

Commit

Permalink
Display on/off was not handled in Display::show() of the HalHub75Esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueAndi committed Jan 17, 2025
1 parent 54631a2 commit bc099c3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
26 changes: 26 additions & 0 deletions lib/HalHub75Esp32/src/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,32 @@ Display::~Display()
{
}

void Display::show()
{
if (true == m_isOn)
{
int16_t y;
int16_t x;

for(y = 0; y < Board::LedMatrix::height; ++y)
{
for(x = 0; x < Board::LedMatrix::width; ++x)
{
Color& color = m_ledMatrix.getColor(x, y);

#if CONFIG_DISPLAY_ROTATE180 != 0
m_panel.drawPixelRGB888(
Board::LedMatrix::width - x - 1,
Board::LedMatrix::height - y - 1,
color.getRed(), color.getGreen(), color.getBlue());
#else
m_panel.drawPixelRGB888(x, y, color.getRed(), color.getGreen(), color.getBlue());
#endif
}
}
}
}

void Display::off()
{
m_isOn = false;
Expand Down
23 changes: 1 addition & 22 deletions lib/HalHub75Esp32/src/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,7 @@ class Display : public IDisplay
* Show framebuffer on physical display. This may be synchronous
* or asynchronous.
*/
void show() final
{
int16_t y;
int16_t x;

for(y = 0; y < Board::LedMatrix::height; ++y)
{
for(x = 0; x < Board::LedMatrix::width; ++x)
{
Color& color = m_ledMatrix.getColor(x, y);

#if CONFIG_DISPLAY_ROTATE180 != 0
m_panel.drawPixelRGB888(
Board::LedMatrix::width - x - 1,
Board::LedMatrix::height - y - 1,
color.getRed(), color.getGreen(), color.getBlue());
#else
m_panel.drawPixelRGB888(x, y, color.getRed(), color.getGreen(), color.getBlue());
#endif
}
}
}
void show() final;

/**
* The display is ready, when the last physical pixel update is finished.
Expand Down

0 comments on commit bc099c3

Please sign in to comment.