mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
removed EMSESP_PLATFORM
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
Import("env")
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import re
|
||||
import os
|
||||
Import("env")
|
||||
|
||||
OUTPUT_DIR = "build{}".format(os.path.sep)
|
||||
|
||||
|
||||
def bin_copy(source, target, env):
|
||||
|
||||
# get the build info
|
||||
bag = {}
|
||||
exprs = [
|
||||
(re.compile(r'^#define EMSESP_APP_VERSION\s+"(\S+)"'), 'app_version'),
|
||||
(re.compile(r'^#define EMSESP_PLATFORM\s+"(\S+)"'), 'platform'),
|
||||
]
|
||||
exprs = [(re.compile(r'^#define EMSESP_APP_VERSION\s+"(\S+)"'), 'app_version')]
|
||||
with open('./src/version.h', 'r') as f:
|
||||
for l in f.readlines():
|
||||
for expr, var in exprs:
|
||||
@@ -21,7 +19,7 @@ def bin_copy(source, target, env):
|
||||
bag[var] = m.group(1)
|
||||
|
||||
app_version = bag.get('app_version')
|
||||
platform = bag.get("platform")
|
||||
platform = "ESP32"
|
||||
|
||||
# print(env.Dump())
|
||||
# my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
@@ -59,4 +57,5 @@ def bin_copy(source, target, env):
|
||||
# copy firmware.bin to firmware/<variant>.bin
|
||||
shutil.copy(str(target[0]), bin_file)
|
||||
|
||||
|
||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_copy])
|
||||
|
||||
Reference in New Issue
Block a user