mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
4c313bc198
* Rename legacy/modern to ota/factory * Add modern/legacy in brackets
23 lines
699 B
Text
23 lines
699 B
Text
import shutil
|
|
|
|
# pylint: disable=E0602
|
|
Import("env") # noqa
|
|
|
|
|
|
def rp2040_copy_factory_uf2(source, target, env):
|
|
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.uf2")
|
|
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.uf2")
|
|
|
|
shutil.copyfile(firmware_name, new_file_name)
|
|
|
|
|
|
def rp2040_copy_ota_bin(source, target, env):
|
|
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
|
|
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.ota.bin")
|
|
|
|
shutil.copyfile(firmware_name, new_file_name)
|
|
|
|
|
|
# pylint: disable=E0602
|
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", rp2040_copy_factory_uf2) # noqa
|
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", rp2040_copy_ota_bin) # noqa
|