Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/wifi_ng'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Dec 21, 2023
2 parents 82682c5 + ce52fbc commit 4e9f806
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lib_deps =
thomasfredericks/Bounce2
build_flags =
-DNO_GFX=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DPIXEL_COLOR_DEPTH_BITS=7
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand Down Expand Up @@ -65,7 +65,7 @@ lib_deps =
build_flags =
-DNO_GFX=1
-DZEDMD_WIFI=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DPIXEL_COLOR_DEPTH_BITS=7
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand Down
20 changes: 12 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@
#define TOTAL_WIDTH_PLANE (TOTAL_WIDTH >> 3)
#define TOTAL_HEIGHT PANEL_HEIGHT
#define TOTAL_BYTES (TOTAL_WIDTH * TOTAL_HEIGHT * 3)
#define ZONES_PER_ROW (TOTAL_WIDTH / 16)
#define TOTAL_ZONES ((TOTAL_HEIGHT / 8) * ZONES_PER_ROW)
#define ZONE_SIZE (16 * 8 * 3)
#define ZONE_WIDTH (TOTAL_WIDTH / 16)
#define ZONE_HEIGHT (TOTAL_HEIGHT / 8)
#define ZONES_PER_ROW (TOTAL_WIDTH / ZONE_WIDTH)
#define TOTAL_ZONES ((TOTAL_HEIGHT / ZONE_HEIGHT) * ZONES_PER_ROW)
#define ZONE_SIZE (ZONE_WIDTH * ZONE_HEIGHT * 3)
#define MAX_COLOR_ROTATIONS 8
#define LED_CHECK_DELAY 1000 // ms per color

Expand Down Expand Up @@ -610,14 +612,14 @@ void ScaleImage(uint8_t colors)

void fillZoneRaw(uint8_t idx, uint8_t *pBuffer)
{
uint8_t yOffset = (idx / ZONES_PER_ROW) * 8;
uint8_t xOffset = (idx % ZONES_PER_ROW) * 16;
uint8_t yOffset = (idx / ZONES_PER_ROW) * ZONE_HEIGHT;
uint8_t xOffset = (idx % ZONES_PER_ROW) * ZONE_WIDTH;

for (uint8_t y = 0; y < 8; y++)
for (uint8_t y = 0; y < ZONE_HEIGHT; y++)
{
for (uint8_t x = 0; x < 16; x++)
for (uint8_t x = 0; x < ZONE_WIDTH; x++)
{
uint16_t pos = (y * 16 + x) * 3;
uint16_t pos = (y * ZONE_WIDTH + x) * 3;

dma_display->drawPixelRGB888(
x + xOffset,
Expand Down Expand Up @@ -1545,6 +1547,7 @@ void loop()
break;
}

#if !defined(ZEDMD_WIFI)
case 4: // mode RGB24 zones streaming
{
renderBuffer = (uint8_t *)malloc(TOTAL_ZONES * ZONE_SIZE + ZONES_PER_ROW);
Expand All @@ -1563,6 +1566,7 @@ void loop()
free(renderBuffer);
break;
}
#endif

#if !defined(ZEDMD_WIFI) && !defined(ZEDMD_HD)
case 3: // mode RGB24
Expand Down

0 comments on commit 4e9f806

Please sign in to comment.