0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-04-25 08:51:55 +00:00
MarlinFirmware/buildroot/share/PlatformIO/scripts/marlin.py
2023-07-20 14:24:56 -05:00

17 lines
535 B
Python

#
# buildroot/share/PlatformIO/scripts/marlin.py
# Helper module with some commonly-used functions
#
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
def replace_define(field, value):
envdefs = env['CPPDEFINES'].copy()
for define in envdefs:
if define[0] == field:
env['CPPDEFINES'].remove(define)
env['CPPDEFINES'].append((field, value))
# Relocate the firmware to a new address, such as "0x08005000"
def relocate_firmware(address):
replace_define("VECT_TAB_ADDR", address)