Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
-D WLED_USE_SD_SPI
lib_deps = ${esp32s3.lib_deps}
board_build.partitions = ${esp32.large_partitions}
board_build.f_flash = 80000000L
Expand All @@ -608,7 +607,6 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
-D WLED_USE_SD_SPI
;; -DLOLIN_WIFI_FIX ;; uncomment if you have WiFi connectivity problems
monitor_filters = esp32_exception_decoder

Expand Down
37 changes: 37 additions & 0 deletions usermods/FSEQ/auto_fseq_sd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Import("env")

# Reference to the current build environment
projenv = env

# Read the custom_usermods option from platformio.ini (WLED 0.16 structure)
custom_usermods = projenv.GetProjectOption("custom_usermods", default="")

# Convert the string into a clean uppercase list
# Supports comma or space separated entries
usermod_list = [
u.strip().upper()
for u in custom_usermods.replace(",", " ").split()
]

# Get current CPPDEFINES (build flags)
cpp_defines = projenv.get("CPPDEFINES", [])

# Extract define names into a simple list
define_names = []
for d in cpp_defines:
if isinstance(d, tuple):
define_names.append(d[0])
else:
define_names.append(d)

# Check if MMC or SPI is already enabled
mmc_enabled = "WLED_USE_SD_MMC" in define_names
spi_enabled = "WLED_USE_SD_SPI" in define_names

# Logic:
# If FSEQ usermod is selected
# AND neither MMC nor SPI is already defined
# then automatically enable SPI
if "FSEQ" in usermod_list and not mmc_enabled and not spi_enabled:
print("FSEQ usermod detected -> enabling WLED_USE_SD_SPI")
projenv.Append(CPPDEFINES=["WLED_USE_SD_SPI"])
5 changes: 4 additions & 1 deletion usermods/FSEQ/library.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "FSEQ",
"build": { "libArchive": false }
"build": {
"libArchive": false,
"extraScript": "auto_fseq_sd.py"
},
}
Loading