Skip to content

Commit

Permalink
add proto bard + fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
spectrenoir06 committed May 31, 2023
1 parent 4e13104 commit 2e91f92
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 5 deletions.
69 changes: 68 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ lib_deps =
; jfturcot/SimpleTimer@0.0.0-alpha+e2FTPServer



[env:Banane_V1]

extends = env:esp32
Expand Down Expand Up @@ -656,4 +655,72 @@ lib_deps =
; jfturcot/SimpleTimer@0.0.0-alpha+e2FTPServer



[env:Banane_V1_proto]

extends = env:esp32
; board_build.partitions = min_spiffs.csv

build_flags =
-D HOSTNAME='"Spectre Banane V1"'
; -D BOARD_HAS_PSRAM
; -mfix-esp32-psram-cache-issue

; -D USE_WIFI_MANAGER
-D USE_BLE
; -D USE_AP
; -D USE_WIFI
; -D USE_FTP
-D USE_ANIM
; -D USE_OTA

; -D PRINT_FPS
-D USE_SPIFFS
; -D USE_SD

; -D USE_UDP
-D USE_ZLIB
; -D MINIZ_USE_PSRAM

-D LED_TOTAL=2048
-D NUM_STRIPS=1
-D LED_SIZE=3

-D USE_HUB75
-D NO_GFX

-D PIXEL_COLOR_DEPTH_BITS=5

-D R1_PIN=25
-D G1_PIN=26
-D B1_PIN=27
-D R2_PIN=14
-D G2_PIN=12
-D B2_PIN=13
-D A_PIN=23
-D B_PIN=19
-D C_PIN=5
-D D_PIN=17
-D E_PIN=-1
-D CLK_PIN=16
-D LAT_PIN=4
-D OE_PIN=15

-D BRIGHTNESS=50

-D MATRIX_W=64
-D MATRIX_H=32
-D MATRIX_CHAIN=1
-D MATRIX_LATCH_BLANK=1

-D DMA_DOUBLE_BUFF=1

lib_deps =
https://github.com/spectrenoir06/artnet.git
https://github.com/spectrenoir06/AsyncUDP.git
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA
https://github.com/tzapu/WiFiManager.git
h2zero/NimBLE-Arduino@^1.3.7
; jfturcot/SimpleTimer@0.0.0-alpha+e2FTPServer


11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void set_all_pixel(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
// Serial.print(rxValue[i]);
// Serial.println();

if (rxValue.length() > 0 && rxValue[0] == '!') {
if (rxValue.length() > 0 && rxValue[0] == '!' && !image_receive_mode) {
switch (rxValue[1]) {
case 'B':
switch (rxValue[2]) {
Expand Down Expand Up @@ -326,15 +326,18 @@ void set_all_pixel(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
}
}

if (byte_to_store >= (img_receive_width * img_receive_height * (img_receive_color_depth/8))) {
if (image_receive_mode) {
Serial.printf("Byte receive: %d, wait: %d\n", byte_to_store, (img_receive_width * img_receive_height * (img_receive_color_depth / 8) - byte_to_store));
}

if (image_receive_mode && byte_to_store >= (img_receive_width * img_receive_height * (img_receive_color_depth / 8))) {
Serial.printf("Image complete\n");
display->fillScreenRGB888(0, 0, 0);
for (int i = 0; i < (img_receive_width * img_receive_height); i++) {
if (img_receive_color_depth == 16)
display->drawPixel((i) % img_receive_width, (i) / img_receive_width, leds[i * 2] + (leds[i * 2 + 1] << 8));
else {
else
display->drawPixelRGB888((i) % img_receive_width, (i) / img_receive_width, leds[i*3], leds[i*3+1], leds[i*3+2]);
}
}
flip_matrix();
image_receive_mode = false;
Expand Down

0 comments on commit 2e91f92

Please sign in to comment.