mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Improve "uploadlazy" target for @SmartAnthill Project
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (2, 2, "1.dev0")
|
||||
VERSION = (2, 2, "1.dev1")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
@ -6,7 +6,8 @@ from glob import glob
|
||||
from os import getenv, listdir, sep, walk
|
||||
from os.path import basename, dirname, isdir, isfile, join, normpath
|
||||
|
||||
from SCons.Script import DefaultEnvironment, Exit, SConscript
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit,
|
||||
SConscript)
|
||||
from SCons.Util import case_sensitive_suffixes
|
||||
|
||||
from platformio.util import pioversion_to_intstr
|
||||
@ -155,7 +156,7 @@ def LookupSources(env, variant_dir, src_dir, duplicate=True, src_filter=None):
|
||||
|
||||
|
||||
def BuildFramework(env):
|
||||
if "FRAMEWORK" not in env:
|
||||
if "FRAMEWORK" not in env or "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
return
|
||||
|
||||
if env['FRAMEWORK'].lower() in ("arduino", "energia"):
|
||||
|
@ -25,10 +25,12 @@ class AtmelavrPlatform(BasePlatform):
|
||||
},
|
||||
|
||||
"tool-avrdude": {
|
||||
"alias": "uploader",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"tool-micronucleus": {
|
||||
"alias": "uploader",
|
||||
"default": True
|
||||
},
|
||||
|
||||
@ -51,11 +53,11 @@ class AtmelavrPlatform(BasePlatform):
|
||||
for v in variables:
|
||||
if "BOARD=" not in v:
|
||||
continue
|
||||
tuploader = "tool-avrdude"
|
||||
disable_tool = "tool-micronucleus"
|
||||
_, board = v.split("=")
|
||||
bdata = get_boards(board)
|
||||
if "digispark" in bdata['build']['core']:
|
||||
tuploader = "tool-micronucleus"
|
||||
self.PACKAGES[tuploader]['alias'] = "uploader"
|
||||
disable_tool = "tool-avrdude"
|
||||
del self.PACKAGES[disable_tool]['alias']
|
||||
break
|
||||
return BasePlatform.run(self, variables, targets, verbose)
|
||||
|
Reference in New Issue
Block a user