Skip to content

Commit

Permalink
removed obsolote functions from display drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Dec 19, 2024
1 parent a318bae commit 53ec6a9
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 95 deletions.
12 changes: 0 additions & 12 deletions src/displayDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,6 @@ class DisplayDriver {
/// @return
virtual void FillPanelRaw(uint8_t *pBuffer) = 0;

/// @brief Fill fullscreen with pallete
/// @return
virtual void FillPanelUsingPalette(uint8_t *pBuffer, uint8_t *palette) = 0;
#if !defined(ZEDMD_WIFI)
/// @brief Fill fullscreen with changed palette
/// @param pBuffer Pixel buffer RGB888
/// @param palette Palette
/// @param paletteAffected Affected palette
virtual void FillPanelUsingChangedPalette(uint8_t *pBuffer, uint8_t *palette,
bool *paletteAffected) = 0;
#endif

virtual ~DisplayDriver() {} // Virtual destructor
};

Expand Down
32 changes: 0 additions & 32 deletions src/displays/LEDMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,37 +137,5 @@ void IRAM_ATTR LedMatrix::FillPanelRaw(uint8_t *pBuffer) {
}
}

void LedMatrix::FillPanelUsingPalette(uint8_t *pBuffer, uint8_t *palette) {
uint16_t pos;

for (uint16_t y = 0; y < TOTAL_HEIGHT; y++) {
for (uint16_t x = 0; x < TOTAL_WIDTH; x++) {
pos = pBuffer[y * TOTAL_WIDTH + x] * 3;

dma_display->drawPixelRGB888(x, y, palette[pos], palette[pos + 1],
palette[pos + 2]);
}
}
}

#if !defined(ZEDMD_WIFI)

void LedMatrix::FillPanelUsingChangedPalette(uint8_t *pBuffer, uint8_t *palette,
bool *paletteAffected) {
uint16_t pos;

for (uint16_t y = 0; y < TOTAL_HEIGHT; y++) {
for (uint16_t x = 0; x < TOTAL_WIDTH; x++) {
pos = pBuffer[y * TOTAL_WIDTH + x];
if (paletteAffected[pos]) {
pos *= 3;
dma_display->drawPixelRGB888(x, y, palette[pos], palette[pos + 1],
palette[pos + 2]);
}
}
}
}
#endif

LedMatrix::~LedMatrix() { delete dma_display; }
#endif
5 changes: 0 additions & 5 deletions src/displays/LEDMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ class LedMatrix : public DisplayDriver {
void FillZoneRaw565(uint8_t idx, uint8_t *pBuffer);
void ClearZone(uint8_t idx);
void FillPanelRaw(uint8_t *pBuffer) override;
void FillPanelUsingPalette(uint8_t *pBuffer, uint8_t *palette);
#if !defined(ZEDMD_WIFI)
virtual void FillPanelUsingChangedPalette(uint8_t *pBuffer, uint8_t *palette,
bool *paletteAffected);
#endif

~LedMatrix(); // Destructor
};
Expand Down
41 changes: 0 additions & 41 deletions src/displays/Rm67162Amoled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,47 +372,6 @@ void IRAM_ATTR Rm67162Amoled::FillPanelRaw(uint8_t *pBuffer) {
lcd_PushColors(0, 0, 536, 240, (uint16_t *)sprite.getPointer());
}

void Rm67162Amoled::FillPanelUsingPalette(uint8_t *pBuffer, uint8_t *palette) {
uint16_t pos;

for (uint16_t y = 0; y < TOTAL_HEIGHT; y++) {
for (uint16_t x = 0; x < TOTAL_WIDTH; x++) {
pos = pBuffer[y * TOTAL_WIDTH + x] * 3;

uint16_t color =
sprite.color565(palette[pos], palette[pos + 1], palette[pos + 2]);

sprite.fillRect(x * DISPLAY_SCALE, y * DISPLAY_SCALE, DISPLAY_SCALE,
DISPLAY_SCALE, color);
}
}
lcd_PushColors(0, 0, 536, 240, (uint16_t *)sprite.getPointer());
}

#if !defined(ZEDMD_WIFI)
void Rm67162Amoled::FillPanelUsingChangedPalette(uint8_t *pBuffer,
uint8_t *palette,
bool *paletteAffected) {
uint16_t pos;

for (uint16_t y = 0; y < TOTAL_HEIGHT; y++) {
for (uint16_t x = 0; x < TOTAL_WIDTH; x++) {
pos = pBuffer[y * TOTAL_WIDTH + x];
if (paletteAffected[pos]) {
pos *= 3;

uint16_t color =
sprite.color565(palette[pos], palette[pos + 1], palette[pos + 2]);

sprite.fillRect(x * DISPLAY_SCALE, y * DISPLAY_SCALE, DISPLAY_SCALE,
DISPLAY_SCALE, color);
}
}
}
lcd_PushColors(0, 0, 536, 240, (uint16_t *)sprite.getPointer());
}
#endif

Rm67162Amoled::~Rm67162Amoled() {
// Clean up resources if necessary
}
Expand Down
5 changes: 0 additions & 5 deletions src/displays/Rm67162Amoled.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ class Rm67162Amoled : public DisplayDriver {
void FillZoneRaw565(uint8_t idx, uint8_t *pBuffer);
void ClearZone(uint8_t idx);
void FillPanelRaw(uint8_t *pBuffer);
void FillPanelUsingPalette(uint8_t *pBuffer, uint8_t *palette);
#if !defined(ZEDMD_WIFI)
void FillPanelUsingChangedPalette(uint8_t *pBuffer, uint8_t *palette,
bool *paletteAffected);
#endif

~Rm67162Amoled();
};
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <LittleFS.h>
#include <WiFi.h>

#include <cstring>

#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED)
#include "S3Specific.h"
#endif
Expand Down

0 comments on commit 53ec6a9

Please sign in to comment.