Убрал ошибку при одновременной сборки с ФС

This commit is contained in:
Mit4el
2023-08-09 23:33:34 +03:00
parent af0f7a219b
commit 768669a635

View File

@@ -2,6 +2,17 @@
import os import os
import configparser import configparser
def before_build(): # source, target, env
print("Current Build targets", BUILD_TARGETS)
# Это всё потому что не работает "buildprog". При сборке прошивки Targets пустой, на всякий случай исключим все остальные
if (BUILD_TARGETS == ['upload'] or
BUILD_TARGETS == ['buildfs'] or
BUILD_TARGETS == ['uploadfs'] or
BUILD_TARGETS == ['uploadfsota'] or
BUILD_TARGETS == ['size']):
return
print("Clear BUILD_TIME, delete main.o !")
config = configparser.ConfigParser() # создаём объекта парсера INI config = configparser.ConfigParser() # создаём объекта парсера INI
config.read("platformio.ini") config.read("platformio.ini")
deviceName = config["platformio"]["default_envs"] deviceName = config["platformio"]["default_envs"]
@@ -11,3 +22,7 @@ try:
except OSError as e: except OSError as e:
# If it fails, inform the user. # If it fails, inform the user.
print("Error: %s - %s." % (e.filename, e.strerror)) print("Error: %s - %s." % (e.filename, e.strerror))
#env.AddPreAction("buildprog", before_build) # $BUILD_DIR/src/main.cpp.o
before_build()