Skip to content

Commit

Permalink
added double buffering for the S3
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Dec 20, 2024
1 parent 8ef7065 commit 8d91528
Show file tree
Hide file tree
Showing 5 changed files with 270 additions and 118 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/ZeDMD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
needs: [ version ]
strategy:
matrix:
panels: ['128x32', '256x64', '128x64', '128x32_wifi', '128x64_wifi', 'S3-N16R8_128x32', 'S3-N16R8_128x32_UART', 'S3-N16R8_128x32_wifi', 'S3-N16R8_256x64', 'S3-N16R8_256x64_UART', 'S3-N16R8_256x64_wifi', 'S3-N16R8_128x64', 'S3-N16R8_128x64_UART', 'S3-N16R8_128x64_wifi', 'LilygoS3Amoled_128x32','LilygoS3Amoled_128x32_wifi']
panels: ['128x32', '256x64', '128x64', 'S3-N16R8_128x32', 'S3-N16R8_128x32_UART', 'S3-N16R8_256x64', 'S3-N16R8_256x64_UART', 'S3-N16R8_128x64', 'S3-N16R8_128x64_UART', 'LilygoS3Amoled_128x32', 'LilygoS3Amoled_128x32_wifi']

name: ZeDMD ${{ matrix.panels }}

Expand All @@ -52,7 +52,7 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade platformio
- if: (matrix.panels == '128x32' || matrix.panels == '256x64'|| matrix.panels == '128x64' || matrix.panels == '128x32_wifi'|| matrix.panels == '128x64_wifi')
- if: (matrix.panels == '128x32' || matrix.panels == '256x64'|| matrix.panels == '128x64')
name: Build ZeDMD
run: |
pio run -e ${{ matrix.panels }}
Expand All @@ -64,7 +64,7 @@ jobs:
0x10000 .pio/build/${{ matrix.panels }}/firmware.bin \
0x210000 .pio/build/${{ matrix.panels }}/littlefs.bin
- if: (matrix.panels == 'S3-N16R8_128x32' || matrix.panels == 'S3-N16R8_256x64' || matrix.panels == 'S3-N16R8_128x64' || matrix.panels == 'S3-N16R8_128x32_UART' || matrix.panels == 'S3-N16R8_256x64_UART' || matrix.panels == 'S3-N16R8_128x64_UART' || matrix.panels == 'S3-N16R8_128x32_wifi' || matrix.panels == 'S3-N16R8_256x64_wifi' || matrix.panels == 'S3-N16R8_128x64_wifi' || matrix.panels == 'LilygoS3Amoled_128x32' || matrix.panels == 'LilygoS3Amoled_128x32_wifi')
- if: (matrix.panels == 'S3-N16R8_128x32' || matrix.panels == 'S3-N16R8_256x64' || matrix.panels == 'S3-N16R8_128x64' || matrix.panels == 'S3-N16R8_128x32_UART' || matrix.panels == 'S3-N16R8_256x64_UART' || matrix.panels == 'S3-N16R8_128x64_UART' || matrix.panels == 'LilygoS3Amoled_128x32' || matrix.panels == 'LilygoS3Amoled_128x32_wifi')
name: Build ZeDMD S3
run: |
pio run -e ${{ matrix.panels }}
Expand Down Expand Up @@ -99,12 +99,6 @@ jobs:
cd ../ZeDMD-128x64
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-128x64.zip ZeDMD.bin version.txt
cd ../ZeDMD-128x32_wifi
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-128x32_wifi.zip ZeDMD.bin version.txt
cd ../ZeDMD-128x64_wifi
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-128x64_wifi.zip ZeDMD.bin version.txt
cd ../ZeDMD-S3-N16R8_128x32
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-S3-N16R8_128x32.zip ZeDMD.bin version.txt
Expand All @@ -123,15 +117,6 @@ jobs:
cd ../ZeDMD-S3-N16R8_128x64_UART
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-S3-N16R8_128x64_UART.zip ZeDMD.bin version.txt
cd ../ZeDMD-S3-N16R8_128x32_wifi
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-S3-N16R8_128x32_wifi.zip ZeDMD.bin version.txt
cd ../ZeDMD-S3-N16R8_256x64_wifi
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-S3-N16R8_256x64_wifi.zip ZeDMD.bin version.txt
cd ../ZeDMD-S3-N16R8_128x64_wifi
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-S3-N16R8_128x64_wifi.zip ZeDMD.bin version.txt
cd ../ZeDMD-LilygoS3Amoled_128x32
echo "${{ needs.version.outputs.tag }}" > version.txt
zip ../ZeDMD-LilygoS3Amoled_128x32.zip ZeDMD.bin version.txt
Expand All @@ -148,16 +133,11 @@ jobs:
ZeDMD-128x32.zip
ZeDMD-256x64.zip
ZeDMD-128x64.zip
ZeDMD-128x32_wifi.zip
ZeDMD-128x64_wifi.zip
ZeDMD-S3-N16R8_128x32.zip
ZeDMD-S3-N16R8_256x64.zip
ZeDMD-S3-N16R8_128x64.zip
ZeDMD-S3-N16R8_128x32_UART.zip
ZeDMD-S3-N16R8_256x64_UART.zip
ZeDMD-S3-N16R8_128x64_UART.zip
ZeDMD-S3-N16R8_128x32_wifi.zip
ZeDMD-S3-N16R8_256x64_wifi.zip
ZeDMD-S3-N16R8_128x64_wifi.zip
ZeDMD-LilygoS3Amoled_128x32.zip
ZeDMD-LilygoS3Amoled_128x32_wifi.zip
31 changes: 31 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,34 @@ build_flags =
-DMINIZ_NO_ZLIB_COMPATIBLE_NAMES=1
-Os
build_unflags = -Og

[env:LilygoS3Amoled_128x32_wifi]
framework = arduino
platform = [email protected]
board = lilygo-t-display-s3
board_build.partitions = partitions_lily.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
debug_tool = esp-builtin
debug_speed = 4000
debug_build_flags = -O0 -ggdb3 -g3
build_type = release
lib_deps =
thomasfredericks/Bounce2
bodmer/TFT_eSPI@^2.5.43
ESP Async WebServer
bitbank2/JPEGDEC@^1.6.1
build_flags =
-DBOARD_HAS_PSRAM
-UARDUINO_USB_CDC_ON_BOOT ;//Disable serial output
;-DARDUINO_USB_CDC_ON_BOOT=1 ;//Leave this for debugging
-DZEDMD_WIFI=1
-DDISPLAY_RM67162_AMOLED=1
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
-DMINIZ_NO_ARCHIVE_APIS=1
-DMINIZ_NO_ARCHIVE_WRITING_APIS=1
-DMINIZ_NO_ZLIB_COMPATIBLE_NAMES=1
-Os
build_unflags = -Og
12 changes: 6 additions & 6 deletions src/displays/LEDMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ void LedMatrix::DisplayText(const char *text, uint16_t x, uint16_t y, uint8_t r,
}

void IRAM_ATTR LedMatrix::FillZoneRaw(uint8_t idx, uint8_t *pBuffer) {
uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;
const uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
const uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;

for (uint8_t y = 0; y < ZONE_HEIGHT; y++) {
for (uint8_t x = 0; x < ZONE_WIDTH; x++) {
Expand All @@ -100,8 +100,8 @@ void IRAM_ATTR LedMatrix::FillZoneRaw(uint8_t idx, uint8_t *pBuffer) {
}

void IRAM_ATTR LedMatrix::FillZoneRaw565(uint8_t idx, uint8_t *pBuffer) {
uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;
const uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
const uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;

for (uint8_t y = 0; y < ZONE_HEIGHT; y++) {
for (uint8_t x = 0; x < ZONE_WIDTH; x++) {
Expand All @@ -114,8 +114,8 @@ void IRAM_ATTR LedMatrix::FillZoneRaw565(uint8_t idx, uint8_t *pBuffer) {
}

void IRAM_ATTR LedMatrix::ClearZone(uint8_t idx) {
uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;
const uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
const uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;

for (uint8_t y = 0; y < ZONE_HEIGHT; y++) {
for (uint8_t x = 0; x < ZONE_WIDTH; x++) {
Expand Down
Loading

0 comments on commit 8d91528

Please sign in to comment.