Add binary relocate function to avoid random pio purging

This commit is contained in:
InsanityAutomation
2022-04-25 14:44:06 -04:00
parent 47222bcdde
commit b6ad2db3a9
4 changed files with 22 additions and 0 deletions
@@ -73,3 +73,13 @@ def encrypt_mks(source, target, env, new_name):
def add_post_action(action):
env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.bin"), action);
def add_post_action_hex(action):
env.AddPostAction(join("$BUILD_DIR", "${PROGNAME}.hex"), action);
import shutil
def mvHex(source, target, env) :
print("Moving Hex...");
shutil.copy2(target[0].path, target[0].dir.path + '/../../../binaries');
add_post_action_hex(mvHex);
@@ -0,0 +1,9 @@
import pioutil
import marlin
import shutil
Import("env")
def mvBinary(source, target, env) :
print("Moving Bin...");
shutil.copy2(target[0].path, target[0].dir.path + '/../../../binaries');
marlin.add_post_action(mvBinary)
+2
View File
@@ -17,6 +17,8 @@ platform = atmelavr@~3.4
build_flags = ${common.build_flags} -Wl,--relax
board_build.f_cpu = 16000000L
src_filter = ${common.default_src_filter} +<src/HAL/AVR>
extra_scripts = ${common.extra_scripts}
buildroot/share/PlatformIO/scripts/mvBin.py
#
# ATmega2560
+1
View File
@@ -30,6 +30,7 @@ extends = common_stm32
extra_scripts = ${common_stm32.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
buildroot/share/PlatformIO/scripts/offset_and_rename.py
buildroot/share/PlatformIO/scripts/mvBin.py
#
# USB Flash Drive mix-ins for STM32