Skip to content

Commit

Permalink
Merge branch 'MoonModules:mdev' into downsample4x
Browse files Browse the repository at this point in the history
  • Loading branch information
troyhacks authored Jun 6, 2024
2 parents cb10c1b + fc173b3 commit 9436dee
Show file tree
Hide file tree
Showing 47 changed files with 1,509 additions and 555 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body:
attributes:
label: What version/release of MM WLED?
description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message"
placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b30.37_esp32_4MB_M.bin"
placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b31.38_esp32_4MB_M.bin"
validations:
required: true
- type: dropdown
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wled",
"version": "0.14.1-b30.37",
"version": "0.14.1-b31.38",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
Expand Down
19 changes: 17 additions & 2 deletions pio-scripts/obj-dump.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Little convenience script to get an object dump
# You may add "-S" to the objdump commandline (i.e. replace "-D -C " with "-d -S -C ")
# to get source code intermixed with disassembly (SLOW !)

Import('env')

def obj_dump_after_elf(source, target, env):
platform = env.PioPlatform()
board = env.BoardConfig()
mcu = board.get("build.mcu", "esp32")

print("Create firmware.asm")
env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm")

if mcu == "esp8266":
env.Execute("xtensa-lx106-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
if mcu == "esp32":
env.Execute("xtensa-esp32-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
if mcu == "esp32s2":
env.Execute("xtensa-esp32s2-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
if mcu == "esp32s3":
env.Execute("xtensa-esp32s3-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
if mcu == "esp32c3":
env.Execute("riscv32-esp-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")

env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf])
93 changes: 92 additions & 1 deletion pio-scripts/output_bins.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,93 @@ def _create_dirs(dirs=["firmware", "map"]):
if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)):
os.mkdir("{}{}".format(OUTPUT_DIR, d))


# trick for py2/3 compatibility
if 'basestring' not in globals():
basestring = str

# WLEDMM : custom print function
def print_my_item(items, flag = False):
if flag: print(" -D", end='')
else: print(" ", end='')
if isinstance(items, basestring):
# print a single string
print(items, end='')
else:
# print a list
first = True
for item in items:
if not first: print("=", end='')
print(item, end='')
first = False

# WLEDMM : dump out buildflags : usermods, disable, enable, use_..
def wledmm_print_build_info(env):
all_flags = env["CPPDEFINES"]
first = True

found = False
for item in all_flags:
if 'WLED_RELEASE_NAME' in item[0] or 'WLED_VERSION' in item[0] or 'ARDUINO_USB_CDC_ON_BOOT' in item[0]:
if first: print("\nUsermods and Features:")
print_my_item(item)
first = False
found = True
if found: print("")

found = False
for item in all_flags:
if 'USERMOD_' in item or 'UM_' in item:
if first: print("\nUsermods and Features:")
print_my_item(item)
first = False
found = True
if found: print("")

found = False
for item in all_flags:
if 'WLED_DISABLE' in item or 'WIFI_FIX' in item:
if first: print("\nUsermods and Features:")
print_my_item(item)
first = False
found = True
if found: print("")

found = False
for item in all_flags:
if 'WLED_' in item or 'WLED_' in item[0] or 'MAX_LED' in item[0]:
if not 'WLED_RELEASE_NAME' in item[0] and not 'WLED_VERSION' in item[0] and not 'WLED_WATCHDOG_TIMEOUT' in item[0] and not 'WLED_DISABLE' in item and not 'WLED_USE_MY_CONFIG' in item and not 'ARDUINO_PARTITION' in item:
if first: print("\nUsermods and Features:")
print_my_item(item)
first = False
found = True
if found: print("")

first = True
found = False
for item in all_flags:
if 'WLEDMM_' in item[0] or 'WLEDMM_' in item or 'TROYHACKS' in item:
if first: print("\nWLEDMM Features:")
print_my_item(item)
first = False
found = True
if found: print("\n")

def wledmm_print_all_defines(env):
all_flags = env["CPPDEFINES"]
found = False
for item in all_flags:
if not found: print("\nBuild Flags:")
print_my_item(item, True)
found = True
if found: print("\n")


def bin_rename_copy(source, target, env):
_create_dirs()
variant = env["PIOENV"]
builddir = os.path.join(env["PROJECT_BUILD_DIR"], variant)
source_map = os.path.join(builddir, env["PROGNAME"] + ".map")

# create string with location and file names based on variant
map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant)
Expand All @@ -48,7 +132,14 @@ def bin_rename_copy(source, target, env):

# copy firmware.map to map/<variant>.map
if os.path.isfile("firmware.map"):
shutil.move("firmware.map", map_file)
print("Found linker mapfile firmware.map")
shutil.copy("firmware.map", map_file)
if os.path.isfile(source_map):
print(f"Found linker mapfile {source_map}")
shutil.copy(source_map, map_file)

# wledmm_print_all_defines(env)
# wledmm_print_build_info(env)

def bin_gzip(source, target, env):
_create_dirs()
Expand Down
Loading

0 comments on commit 9436dee

Please sign in to comment.