mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Handle AVR Symbols when initialising project for IDE // Resolve #216
This commit is contained in:
@ -8,10 +8,12 @@ Release History
|
|||||||
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
|
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
|
||||||
* Pass to API requests information about Continuous Integration system. This
|
* Pass to API requests information about Continuous Integration system. This
|
||||||
information will be used by PlatformIO-API.
|
information will be used by PlatformIO-API.
|
||||||
* Use ``include`` directories from toolchain when exporting project for IDE
|
* Use ``include`` directories from toolchain when initialising project for IDE
|
||||||
(`issue #210 <https://github.com/platformio/platformio/issues/210>`_)
|
(`issue #210 <https://github.com/platformio/platformio/issues/210>`_)
|
||||||
* Updated `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
|
* Updated `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
|
||||||
1.6.4 version (`issue #212 <https://github.com/platformio/platformio/issues/212>`_)
|
1.6.4 version (`issue #212 <https://github.com/platformio/platformio/issues/212>`_)
|
||||||
|
* Handle Atmel AVR Symbols when initialising project for IDE
|
||||||
|
(`issue #216 <https://github.com/platformio/platformio/issues/216>`_)
|
||||||
* Fixed bug with converting ``*.ino`` to ``*.cpp``
|
* Fixed bug with converting ``*.ino`` to ``*.cpp``
|
||||||
|
|
||||||
2.0.0 (2015-05-22)
|
2.0.0 (2015-05-22)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
VERSION = (2, 0, "1.dev1")
|
VERSION = (2, 0, "1a1")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -64,16 +64,7 @@ def BuildFirmware(env):
|
|||||||
Exit()
|
Exit()
|
||||||
|
|
||||||
if "idedata" in COMMAND_LINE_TARGETS:
|
if "idedata" in COMMAND_LINE_TARGETS:
|
||||||
_data = {"defines": [], "includes": []}
|
print json.dumps(env.DumpIDEData())
|
||||||
for item in env.get("VARIANT_DIRS", []):
|
|
||||||
_data['includes'].append(env.subst(item[1]))
|
|
||||||
for item in glob(env.subst(
|
|
||||||
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN",
|
|
||||||
"*", "include"))):
|
|
||||||
_data['includes'].append(item)
|
|
||||||
for item in env.get("CPPDEFINES", []):
|
|
||||||
_data['defines'].append(env.subst(item))
|
|
||||||
print json.dumps(_data)
|
|
||||||
Exit()
|
Exit()
|
||||||
|
|
||||||
return firmenv.Program(
|
return firmenv.Program(
|
||||||
@ -421,6 +412,38 @@ def ConvertInoToCpp(env):
|
|||||||
atexit.register(delete_tmpcpp_file, tmpcpp_file)
|
atexit.register(delete_tmpcpp_file, tmpcpp_file)
|
||||||
|
|
||||||
|
|
||||||
|
def DumpIDEData(env):
|
||||||
|
data = {
|
||||||
|
"defines": [],
|
||||||
|
"includes": []
|
||||||
|
}
|
||||||
|
|
||||||
|
# includes from framework and libs
|
||||||
|
for item in env.get("VARIANT_DIRS", []):
|
||||||
|
data['includes'].append(env.subst(item[1]))
|
||||||
|
|
||||||
|
# includes from toolchain
|
||||||
|
for item in glob(env.subst(
|
||||||
|
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN",
|
||||||
|
"*", "include"))):
|
||||||
|
data['includes'].append(item)
|
||||||
|
|
||||||
|
# global symbols
|
||||||
|
for item in env.get("CPPDEFINES", []):
|
||||||
|
data['defines'].append(env.subst(item))
|
||||||
|
|
||||||
|
# special symbol for Atmel AVR MCU
|
||||||
|
board = env.get("BOARD_OPTIONS", {})
|
||||||
|
if board and board['platform'] == "atmelavr":
|
||||||
|
data['defines'].append(
|
||||||
|
"__AVR_%s__" % board['build']['mcu'].upper()
|
||||||
|
.replace("ATMEGA", "ATmega")
|
||||||
|
.replace("ATTINY", "ATtiny")
|
||||||
|
)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
def exists(_):
|
def exists(_):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -435,4 +458,5 @@ def generate(env):
|
|||||||
env.AddMethod(BuildLibrary)
|
env.AddMethod(BuildLibrary)
|
||||||
env.AddMethod(BuildDependentLibraries)
|
env.AddMethod(BuildDependentLibraries)
|
||||||
env.AddMethod(ConvertInoToCpp)
|
env.AddMethod(ConvertInoToCpp)
|
||||||
|
env.AddMethod(DumpIDEData)
|
||||||
return env
|
return env
|
||||||
|
Reference in New Issue
Block a user