Skip to content

Commit

Permalink
fixed brightness on start, fixed some S3 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Jan 12, 2025
1 parent 3c188bb commit ac52b04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
28 changes: 3 additions & 25 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ platform = [email protected]
board = esp32dev
board_build.partitions = partitions.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
ESP Async WebServer
build_flags =
-DNO_GFX=1
-DDISPLAY_LED_MATRIX=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DNO_FAST_FUNCTIONS=1
-DDISPLAY_LED_MATRIX=1
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand All @@ -42,7 +41,6 @@ platform = [email protected]
board = esp32dev
board_build.partitions = partitions.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
Expand All @@ -68,7 +66,6 @@ platform = [email protected]
board = esp32dev
board_build.partitions = partitions.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
Expand All @@ -95,17 +92,15 @@ platform = [email protected]
board = esp32-s3-wroom-1-n16r8
board_build.partitions = partitions_16MB.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
ESP Async WebServer
build_flags =
-DNO_GFX=1
-DDISPLAY_LED_MATRIX=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DNO_FAST_FUNCTIONS=1
-DDISPLAY_LED_MATRIX=1
-DSPIRAM_FRAMEBUFFER=1
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand All @@ -121,17 +116,15 @@ platform = [email protected]
board = esp32-s3-wroom-1-n16r8-uart
board_build.partitions = partitions_16MB.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
ESP Async WebServer
build_flags =
-DNO_GFX=1
-DDISPLAY_LED_MATRIX=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DNO_FAST_FUNCTIONS=1
-DDISPLAY_LED_MATRIX=1
-DSPIRAM_FRAMEBUFFER=1
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand Down Expand Up @@ -197,7 +190,6 @@ platform = [email protected]
board = esp32-s3-wroom-1-n16r8
board_build.partitions = partitions_16MB.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
Expand All @@ -208,7 +200,6 @@ build_flags =
-DDISPLAY_LED_MATRIX=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DNO_FAST_FUNCTIONS=1
-DSPIRAM_FRAMEBUFFER=1
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand All @@ -224,7 +215,6 @@ platform = [email protected]
board = esp32-s3-wroom-1-n16r8-uart
board_build.partitions = partitions_16MB.csv
board_build.filesystem = littlefs
board_build.flash_mode = qio
lib_deps =
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.11
thomasfredericks/Bounce2
Expand All @@ -235,7 +225,6 @@ build_flags =
-DDISPLAY_LED_MATRIX=1
-DPIXEL_COLOR_DEPTH_BITS=8
-DNO_FAST_FUNCTIONS=1
-DSPIRAM_FRAMEBUFFER=1
-DMINIZ_NO_STDIO=1
-DMINIZ_NO_TIME=1
-DMINIZ_NO_DEFLATE_APIS=1
Expand All @@ -251,11 +240,6 @@ 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
Expand All @@ -279,16 +263,10 @@ 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
Expand Down
29 changes: 19 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ static uint8_t currentBuffer __attribute__((aligned(4))) = NUM_BUFFERS - 1;
static uint8_t lastBuffer __attribute__((aligned(4))) = currentBuffer;
static uint8_t processingBuffer __attribute__((aligned(4))) = NUM_BUFFERS - 1;

uint8_t lumstep = 5; // Init display on medium brightness, otherwise it starts
// up black on some displays
// Init display on a low brightness to avoid power issues, but bright enough to
// see something.
#ifdef DISPLAY_RM67162_AMOLED
uint8_t lumstep = 5;
#else
uint8_t lumstep = 2;
#endif

uint8_t settingsMenu = 0;

String ssid;
Expand Down Expand Up @@ -1050,6 +1056,7 @@ void setup() {
#elif defined(DISPLAY_LED_MATRIX)
display = new LedMatrix(); // For LED matrix display
#endif
display->SetBrightness(lumstep);

if (!fileSystemOK) {
display->DisplayText("Error reading file system!", 0, 0, 255, 0, 0);
Expand Down Expand Up @@ -1104,7 +1111,7 @@ void setup() {
if (++position > 4) position = 1;

switch (position) {
case 1: {
case 1: { // Exit
DisplayLum();
DisplayRGB();
display->DisplayText(
Expand All @@ -1117,7 +1124,7 @@ void setup() {
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
break;
}
case 2: {
case 2: { // Brightness
DisplayLum(255, 191, 0);
DisplayRGB();
display->DisplayText(
Expand All @@ -1130,7 +1137,7 @@ void setup() {
(TOTAL_HEIGHT / 2) - 3, 128, 128, 128);
break;
}
case 3: {
case 3: { // Transport
DisplayLum();
DisplayRGB();
display->DisplayText(
Expand All @@ -1143,7 +1150,7 @@ void setup() {
(TOTAL_HEIGHT / 2) - 3, 128, 128, 128);
break;
}
case 4: {
case 4: { // RGB order
DisplayLum();
DisplayRGB(255, 191, 0);
display->DisplayText(
Expand All @@ -1162,22 +1169,22 @@ void setup() {
rgbOrderButton->update();
if (rgbOrderButton->pressed()) {
switch (position) {
case 1: {
case 1: { // Exit
settingsMenu = false;
SaveSettingsMenu();
delay(10);
Restart();
break;
}
case 2: {
case 2: { // Brightness
lumstep++;
if (lumstep >= 16) lumstep = 1;
display->SetBrightness(lumstep);
DisplayLum(255, 191, 0);
SaveLum();
break;
}
case 3: {
case 3: { // Transport
if (++transport > TRANSPORT_SPI) transport = TRANSPORT_USB;
display->DisplayText(
transport == TRANSPORT_USB
Expand All @@ -1187,7 +1194,7 @@ void setup() {
SaveTransport();
break;
}
case 4: {
case 4: { // RGB order
if (rgbModeLoaded != 0) {
rgbMode = 0;
SaveRgbOrder();
Expand All @@ -1202,6 +1209,8 @@ void setup() {
}
}
}

delay(10);
}
}

Expand Down

0 comments on commit ac52b04

Please sign in to comment.