Skip to content

Commit 6470c96

Browse files
authored
Merge pull request #20 from tronbyt/main_pixoicker_merge
merge changes to support devices with no psram tested on all three devices.
2 parents b86f1ec + f1f277f commit 6470c96

19 files changed

+519
-53
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.pio
2+
sdkconfig
23
sdkconfig.old
34
.vscode
45
.production

boards/max_app_4mb.csv

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, factory, 0x10000, 0x3E0000,
5+
coredump, data, coredump,0x3F0000,0x10000,

boards/wroom32.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"build": {
3+
"core": "esp32",
4+
"f_cpu": "240000000L",
5+
"f_flash": "40000000L",
6+
"flash_mode": "dio",
7+
"mcu": "esp32",
8+
"partitions": "boards/max_app_4mb.csv",
9+
"variant": "esp32",
10+
"esp-idf": {
11+
"sdkconfig_path": "sdkconfig"
12+
}
13+
},
14+
"connectivity": [
15+
"wifi",
16+
"bluetooth",
17+
"ethernet",
18+
"can"
19+
],
20+
"debug": {
21+
"default_tool": "ftdi",
22+
"onboard_tools": [
23+
"ftdi"
24+
],
25+
"openocd_board": "esp32-wrover.cfg"
26+
},
27+
"frameworks": [
28+
"arduino",
29+
"espidf"
30+
],
31+
"name": "Espressif ESP32 Dev Module",
32+
"upload": {
33+
"flash_size": "4MB",
34+
"maximum_ram_size": 327680,
35+
"maximum_size": 8388608,
36+
"require_upload_port": true,
37+
"speed": 921600,
38+
"protocols": [
39+
"esptool",
40+
"ftdi"
41+
]
42+
},
43+
"url": "https://tidbyt.com",
44+
"vendor": "Tidbyt"
45+
}

extra_scripts/pre.py

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ def main() -> None:
1010
# copy libwebp's library.json to the lib directory
1111
env.Execute(Copy("$PROJECT_LIBDEPS_DIR/$PIOENV/libwebp/library.json", "$PROJECT_DIR/lib/webp/library.json"))
1212

13+
sdkconfig_path = os.path.join(env["PROJECT_DIR"], "sdkconfig")
14+
if os.path.exists(sdkconfig_path):
15+
print(f"Deleting existing {sdkconfig_path} to force regeneration...")
16+
os.remove(sdkconfig_path)
17+
1318
# if secrets.h file exists
1419
if os.path.exists("secrets.json"):
1520
# read secrets.h file

extra_scripts/reset.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
PRODUCTION_VERSION = {
77
"tidbyt": "v10/35833",
8+
"pixoticker": "v10/35833",
89
"tidbyt-gen2": "v11/35369"
910
}[env["PIOENV"]]
1011

File renamed without changes.

extra_scripts/webp_to_c.h.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
# Read the binary WebP file
1212
input_file = args.input_file
1313
output_file = args.output_file
14+
print(f"input file is {input_file}")
1415

1516
with open(input_file, "rb") as f:
1617
binary_data = f.read()
1718

1819
# Create C header file content
19-
header_name = "ASSET_NOAPPS_WEBP"
20+
header_name = "ASSET_BOOT_WEBP"
2021
line_length = 16 # Number of bytes per line in the array
2122
hex_lines = []
2223

@@ -31,7 +32,7 @@
3132
#include <stdint.h>
3233
const size_t {header_name}_LEN = {len(binary_data)};
3334
const uint8_t {header_name}[] =
34-
{',\n'.join(hex_lines)};
35+
{'\n'.join(hex_lines)};
3536
"""
3637

3738
# Write to an output file

lib/assets/assets.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
#include <stddef.h>
44
#include <stdint.h>
55

6-
extern const uint8_t ASSET_NOAPPS_WEBP[];
7-
extern size_t ASSET_NOAPPS_WEBP_LEN;
6+
extern const uint8_t ASSET_BOOT_WEBP[];
7+
extern const size_t ASSET_BOOT_WEBP_LEN;
8+
9+
#ifdef BOOT_WEBP_PARROT
10+
#include "lib/assets/parrot_c"
11+
#else
12+
#include "lib/assets/tronbyt_c"
13+
#endif

lib/assets/noapps_webp.c.orig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Generated by 'tbt dev firmware-asset', don't edit manually!
22
#include <stddef.h>
33
#include <stdint.h>
4-
const size_t ASSET_NOAPPS_WEBP_LEN = 24530;
5-
const uint8_t ASSET_NOAPPS_WEBP[] =
4+
const size_t ASSET_BOOT_WEBP_LEN = 24530;
5+
const uint8_t ASSET_BOOT_WEBP[] =
66
"\x52\x49\x46\x46\xCA\x5F\x00\x00\x57\x45\x42\x50\x56\x50\x38\x58\x0A"
77
"\x00\x00\x00\x12\x00\x00\x00\x3F\x00\x00\x1F\x00\x00\x41\x4E\x49\x4D"
88
"\x06\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x00\x41\x4E\x4D\x46\x26\x00\x00"

lib/assets/parrot_c

+293
Large diffs are not rendered by default.
File renamed without changes.

lib/assets/noapps_webp.c renamed to lib/assets/tronbyt_c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Tronbyt xscreensaver boot screen!
22
#include <stddef.h>
33
#include <stdint.h>
4-
const size_t ASSET_NOAPPS_WEBP_LEN = 174330;
5-
const uint8_t ASSET_NOAPPS_WEBP[] =
4+
const size_t ASSET_BOOT_WEBP_LEN = 174330;
5+
const uint8_t ASSET_BOOT_WEBP[] =
66
"\x52\x49\x46\x46\xF2\xA8\x02\x00\x57\x45\x42\x50\x56\x50\x38\x58"
77
"\x0A\x00\x00\x00\x12\x00\x00\x00\x3F\x00\x00\x1F\x00\x00\x41\x4E"
88
"\x49\x4D\x06\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x00\x41\x4E\x4D\x46"

platformio.ini

+67-1
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,90 @@ extra_scripts =
2020
monitor_filters =
2121
direct
2222

23+
24+
; _____ ______ _ _ __
25+
; / ____| ____| \ | | /_ |
26+
; | | __| |__ | \| |______| |
27+
; | | |_ | __| | . ` |______| |
28+
; | |__| | |____| |\ | | |
29+
; \_____|______|_| \_| |_|
30+
;###################################################################################
31+
;###################################################################################
2332
[env:tidbyt]
2433
board = tidbyt
2534
board_build.partitions = boards/default_8mb.csv
35+
board_build.cmake_extra_args =
36+
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;"
2637
build_flags =
2738
-DNO_GFX
2839
-DNO_FAST_FUNCTIONS
29-
-DSWAP_COLORS
40+
;-DSWAP_COLORS
41+
;-DBOOT_WEBP_PARROT
42+
-DHTTP_BUFFER_SIZE_MAX=220000
43+
-DHTTP_BUFFER_SIZE_DEFAULT=100000
3044
lib_deps =
3145
https://github.com/webmproject/libwebp.git#1d86819f49edc8237fa2b844543081bcb8ef8a92
3246
https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aed04adfcda1838bf85c629a8c3b560919b3a327 ; commit as of 20250320
3347

48+
;###################################################################################
49+
;###################################################################################
50+
51+
52+
53+
; _____ ______ _ _ ___
54+
; / ____| ____| \ | | |__ \
55+
; | | __| |__ | \| |______ ) |
56+
; | | |_ | __| | . ` |______/ /
57+
; | |__| | |____| |\ | / /_
58+
; \_____|______|_| \_| |____|
59+
;###################################################################################
60+
;###################################################################################
3461
[env:tidbyt-gen2]
3562
board = gen2
3663
board_build.partitions = boards/default_8mb.csv
64+
board_build.cmake_extra_args =
65+
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;"
3766
build_flags =
3867
-DNO_GFX
3968
-DNO_FAST_FUNCTIONS
4069
-DTIDBYT_GEN2
70+
-DBOOT_WEBP_TRONBYT ; not required as this is the default
71+
-DHTTP_BUFFER_SIZE_MAX=220000
72+
-DHTTP_BUFFER_SIZE_DEFAULT=100000
73+
lib_deps =
74+
https://github.com/webmproject/libwebp.git#1d86819f49edc8237fa2b844543081bcb8ef8a92
75+
https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aed04adfcda1838bf85c629a8c3b560919b3a327 ; commit as of 20250320
76+
;###################################################################################
77+
;###################################################################################
78+
79+
80+
81+
; _____ _______ ______ _______ _____ _____ _ ________ _____
82+
; | __ \_ _\ \ / / __ \__ __|_ _/ ____| |/ / ____| __ \
83+
; | |__) || | \ V / | | | | | | || | | ' /| |__ | |__) |
84+
; | ___/ | | > <| | | | | | | || | | < | __| | _ /
85+
; | | _| |_ / . \ |__| | | | _| || |____| . \| |____| | \ \
86+
; |_| |_____/_/ \_\____/ |_| |_____\_____|_|\_\______|_| \_\ 4MB flash, no PSRAM
87+
;###################################################################################
88+
;###################################################################################
89+
[env:pixoticker]
90+
board = wroom32
91+
board_build.partitions = boards/max_app_4mb.csv
92+
board_build.flash_size = 4MB
93+
board_build.cmake_extra_args =
94+
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.pixoticker.defaults"
95+
build_flags =
96+
-DNO_GFX
97+
-DNO_FAST_FUNCTIONS
98+
-DSWAP_COLORS
99+
-DPIXOTICKER
100+
-DHTTP_BUFFER_SIZE_MAX=30000
101+
-DHTTP_BUFFER_SIZE_DEFAULT=10000
102+
-DBOOT_WEBP_PARROT ; smaller size boot for pixoticker
103+
41104
lib_deps =
42105
https://github.com/webmproject/libwebp.git#1d86819f49edc8237fa2b844543081bcb8ef8a92
43106
https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aed04adfcda1838bf85c629a8c3b560919b3a327 ; commit as of 20250320
107+
;###################################################################################
108+
;###################################################################################
109+
File renamed without changes.

sdkconfig.pixoticker.defaults

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# modified config change for pixoticker. 4MB flash size and no PSRAM
2+
3+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=n
4+
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
5+
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
6+
7+
CONFIG_SPIRAM=n
8+
CONFIG_SPI_MASTER_ISR_IN_IRAM=n
9+
CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=n
10+
11+
CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y
12+
CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=n

src/display.cpp

+31-16
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,37 @@
22

33
#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h>
44
#ifdef TIDBYT_GEN2
5-
#define R1 5
6-
#define G1 23
7-
#define BL1 4
8-
#define R2 2
9-
#define G2 22
10-
#define BL2 32
11-
12-
#define CH_A 25
13-
#define CH_B 21
14-
#define CH_C 26
15-
#define CH_D 19
16-
#define CH_E -1 // assign to pin 14 if using more than two panels
17-
18-
#define LAT 18
19-
#define OE 27
20-
#define CLK 15
5+
#define R1 5
6+
#define G1 23
7+
#define BL1 4
8+
#define R2 2
9+
#define G2 22
10+
#define BL2 32
11+
12+
#define CH_A 25
13+
#define CH_B 21
14+
#define CH_C 26
15+
#define CH_D 19
16+
#define CH_E -1 // assign to pin 14 if using more than two panels
17+
18+
#define LAT 18
19+
#define OE 27
20+
#define CLK 15
21+
#elif defined(PIXOTICKER)
22+
#define R1 2
23+
#define G1 4
24+
#define BL1 15
25+
#define R2 16
26+
#define G2 17
27+
#define BL2 27
28+
#define CH_A 5
29+
#define CH_B 18
30+
#define CH_C 19
31+
#define CH_D 21
32+
#define CH_E 12
33+
#define CLK 22
34+
#define LAT 26
35+
#define OE 25
2136
#else
2237
#ifdef SWAP_COLORS
2338
#define R1 21

0 commit comments

Comments
 (0)