update from 2.0.x
This commit is contained in:
@@ -29,7 +29,7 @@ if pioutil.is_pio_build():
|
||||
# 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.
|
||||
if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink']:
|
||||
if env.GetBuildType() == "debug" and env.get('UPLOAD_PROTOCOL') not in ['jlink', 'stlink', 'custom']:
|
||||
env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug'
|
||||
|
||||
# On some platform, F_CPU is a runtime variable. Since it's used to convert from ns
|
||||
|
||||
@@ -45,15 +45,11 @@
|
||||
#define HAS_SAVED_POSITIONS
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT) && DISABLED(EMERGENCY_PARSER)
|
||||
#define HAS_GCODE_M876
|
||||
#endif
|
||||
|
||||
#if ENABLED(DUET_SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD)
|
||||
#define HAS_SMART_EFF_MOD
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#if HAS_MARLINUI_MENU
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
#define HAS_MENU_BACKLASH
|
||||
#endif
|
||||
|
||||
@@ -57,6 +57,6 @@ if pioutil.is_pio_build():
|
||||
|
||||
def rename_target(source, target, env):
|
||||
firmware = os.path.join(target[0].dir.path, board.get("build.rename"))
|
||||
os.rename(target[0].path, firmware)
|
||||
os.replace(target[0].path, firmware)
|
||||
|
||||
marlin.add_post_action(rename_target)
|
||||
|
||||
@@ -102,6 +102,10 @@ if pioutil.is_pio_build():
|
||||
for f in [ "ultralcd_DOGM.cpp", "ultralcd_DOGM.h" ]:
|
||||
if os.path.isfile(os.path.join(p, f)):
|
||||
mixedin += [ f ]
|
||||
p = os.path.join(env['PROJECT_DIR'], "Marlin", "src", "feature", "bedlevel", "abl")
|
||||
for f in [ "abl.cpp", "abl.h" ]:
|
||||
if os.path.isfile(os.path.join(p, f)):
|
||||
mixedin += [ f ]
|
||||
if mixedin:
|
||||
err = "ERROR: Old files fell into your Marlin folder. Remove %s and try again" % ", ".join(mixedin)
|
||||
raise SystemExit(err)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#
|
||||
import subprocess,os,re
|
||||
|
||||
nocache = 1
|
||||
verbose = 0
|
||||
|
||||
def blab(str):
|
||||
@@ -50,7 +51,7 @@ def run_preprocessor(env, fn=None):
|
||||
#
|
||||
def search_compiler(env):
|
||||
|
||||
ENV_BUILD_PATH = os.path.join(env.Dictionary('PROJECT_BUILD_DIR'), env['PIOENV'])
|
||||
ENV_BUILD_PATH = os.path.join(env['PROJECT_BUILD_DIR'], env['PIOENV'])
|
||||
GCC_PATH_CACHE = os.path.join(ENV_BUILD_PATH, ".gcc_path")
|
||||
|
||||
try:
|
||||
@@ -60,14 +61,17 @@ def search_compiler(env):
|
||||
except:
|
||||
pass
|
||||
|
||||
if os.path.exists(GCC_PATH_CACHE):
|
||||
# Warning: The cached .gcc_path will obscure a newly-installed toolkit
|
||||
if not nocache and os.path.exists(GCC_PATH_CACHE):
|
||||
blab("Getting g++ path from cache")
|
||||
with open(GCC_PATH_CACHE, 'r') as f:
|
||||
return f.read()
|
||||
|
||||
# Find the current platform compiler by searching the $PATH
|
||||
# which will be in a platformio toolchain bin folder
|
||||
path_regex = re.escape(env['PROJECT_PACKAGES_DIR'])
|
||||
# Find a platform compiler by searching $PATH items
|
||||
# A native target will search all PATH bin folders.
|
||||
# Others look only within $HOME/.platformio.
|
||||
path_regex = "" if env.GetProjectOption('platform') == 'native' else re.escape(env['PROJECT_PACKAGES_DIR'])
|
||||
|
||||
gcc = "g++"
|
||||
if env['PLATFORM'] == 'win32':
|
||||
path_separator = ';'
|
||||
@@ -87,7 +91,7 @@ def search_compiler(env):
|
||||
# Use entire path to not rely on env PATH
|
||||
filepath = os.path.sep.join([pathdir, filepath])
|
||||
# Cache the g++ path to no search always
|
||||
if os.path.exists(ENV_BUILD_PATH):
|
||||
if not nocache and os.path.exists(ENV_BUILD_PATH):
|
||||
blab("Caching g++ for current env")
|
||||
with open(GCC_PATH_CACHE, 'w+') as f:
|
||||
f.write(filepath)
|
||||
|
||||
@@ -163,7 +163,9 @@ def compute_build_signature(env):
|
||||
|
||||
# Generate a C source file for storing this array
|
||||
with open('Marlin/src/mczip.h','wb') as result_file:
|
||||
result_file.write(b'#warning "Generated file \'mc.zip\' is embedded"\n')
|
||||
result_file.write(b'#ifndef NO_CONFIGURATION_EMBEDDING_WARNING\n')
|
||||
result_file.write(b' #warning "Generated file \'mc.zip\' is embedded (Define NO_CONFIGURATION_EMBEDDING_WARNING to suppress this warning.)"\n')
|
||||
result_file.write(b'#endif\n')
|
||||
result_file.write(b'const unsigned char mc_zip[] PROGMEM = {\n ')
|
||||
count = 0
|
||||
for b in open(os.path.join(build_dir, 'mc.zip'), 'rb').read():
|
||||
|
||||
Reference in New Issue
Block a user