marlin.py 535 B

1234567891011121314151617
  1. #
  2. # buildroot/share/PlatformIO/scripts/marlin.py
  3. # Helper module with some commonly-used functions
  4. #
  5. from SCons.Script import DefaultEnvironment
  6. env = DefaultEnvironment()
  7. def replace_define(field, value):
  8. envdefs = env['CPPDEFINES'].copy()
  9. for define in envdefs:
  10. if define[0] == field:
  11. env['CPPDEFINES'].remove(define)
  12. env['CPPDEFINES'].append((field, value))
  13. # Relocate the firmware to a new address, such as "0x08005000"
  14. def relocate_firmware(address):
  15. replace_define("VECT_TAB_ADDR", address)