def prepare(address, ldname, fwname): import pioutil if pioutil.is_pio_build(): import marlin def encrypt(source, target, env): marlin.encrypt_mks(source, target, env, fwname) marlin.relocate_firmware(address) marlin.custom_ld_script(ldname) marlin.add_post_action(encrypt)
# # common-cxxflags.py # Convenience script to apply customizations to CPP flags # import pioutil if pioutil.is_pio_build(): Import("env") cxxflags = [ #"-Wno-incompatible-pointer-types", #"-Wno-unused-const-variable", #"-Wno-maybe-uninitialized", #"-Wno-sign-compare" ] if "teensy" not in env['PIOENV']: cxxflags += ["-Wno-register"] env.Append(CXXFLAGS=cxxflags) # # Add CPU frequency as a compile time constant instead of a runtime variable # def add_cpu_freq(): if 'BOARD_F_CPU' in env: env['BUILD_FLAGS'].append('-DBOARD_F_CPU=' + env['BOARD_F_CPU']) # Useful for JTAG debugging # # It will separate release and debug build folders. # It useful to keep two live versions: a debug version for debugging and another for # release, for flashing when upload is not done automatically by jlink/stlink. # Without this, PIO needs to recompile everything twice for any small change.