Minor fixes; full support of Windows

This commit is contained in:
Ivan Kravets
2014-06-11 21:31:36 +03:00
parent f5e452aaaf
commit bd3e0a9075
10 changed files with 29 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ board_mcu = atmega168
board_f_cpu = 16000000L
upload_port = /dev/tty.SLAB_USBtoUART
; upload_port = COM3
upload_protocol = arduino
upload_speed = 19200

View File

@@ -51,7 +51,7 @@ if not isdir(env['PLATFORMIOHOME_DIR']):
"`platformio install` command")
elif not isdir(env.subst("$PLATFORM_DIR")):
Exit("An '%s' platform hasn't been installed yet. Please use "
"`platformio install %s` command" % (env['PLATFORM'].upper(),
"`platformio install %s` command" % (env['PLATFORM'],
env['PLATFORM']))
SConscriptChdir(0)

View File

@@ -15,7 +15,7 @@ env = DefaultEnvironment()
env.Replace(
AR="avr-ar",
AS="avr-as",
AS="avr-gcc",
CC="avr-gcc",
CXX="avr-g++",
OBJCOPY="avr-objcopy",

View File

@@ -11,11 +11,13 @@ from os.path import join
from SCons.Script import (AlwaysBuild, Builder, Default, DefaultEnvironment,
SConscript, SConscriptChdir)
from platformio.util import get_system
env = DefaultEnvironment()
env.Replace(
AR="msp430-ar",
AS="msp430-as",
AS="msp430-gcc",
CC="msp430-gcc",
CXX="msp430-g++",
OBJCOPY="msp430-objcopy",
@@ -49,7 +51,7 @@ env.Replace(
UPLOADER=join("$PLATFORMTOOLS_DIR", "mspdebug", "mspdebug"),
UPLOADERFLAGS=[
"$UPLOAD_PROTOCOL",
"$UPLOAD_PROTOCOL" if get_system() != "windows32" else "tilib",
"--force-reset"
],
UPLOADCMD='$UPLOADER $UPLOADERFLAGS "prog $SOURCES"'

View File

@@ -15,7 +15,7 @@ env = DefaultEnvironment()
env.Replace(
AR="arm-none-eabi-ar",
AS="arm-none-eabi-as",
AS="arm-none-eabi-gcc",
CC="arm-none-eabi-gcc",
CXX="arm-none-eabi-g++",
OBJCOPY="arm-none-eabi-objcopy",
@@ -25,7 +25,7 @@ env.Replace(
ASFLAGS=[
"-g", # include debugging info (so errors include line numbers)
"-x", "-assembler-with-cpp",
"-x", "assembler-with-cpp",
"-Wall",
"-mthumb",
"-mcpu=cortex-m4",

View File

@@ -65,14 +65,20 @@ class FileDownloader(object):
if not sha1:
return
dlsha1 = None
try:
res = check_output(["shasum", self._destination])
res = check_output(["sha1sum", self._destination])
dlsha1 = res[:40]
except OSError:
try:
res = check_output(["shasum", "-a", "1", self._destination])
dlsha1 = res[:40]
if sha1 != dlsha1:
raise FDSHASumMismatch(dlsha1, self._fname, sha1)
except OSError:
pass
if dlsha1 and sha1 != dlsha1:
raise FDSHASumMismatch(dlsha1, self._fname, sha1)
def _preserve_filemtime(self, lmdate):
timedata = parsedate_tz(lmdate)
lmtime = mktime(timedata[:9])

View File

@@ -10,7 +10,7 @@ class TitivaPlatform(BasePlatform):
PACKAGES = {
"toolchain-titiva": {
"toolchain-gccarmnoneeabi": {
"path": join("tools", "toolchain"),
"default": True
},
@@ -22,7 +22,7 @@ class TitivaPlatform(BasePlatform):
"framework-energiativa": {
"path": join("frameworks", "energia"),
"default": False
"default": True
}
}

View File

@@ -44,6 +44,7 @@ def change_filemtime(path, time):
def exec_command(args):
p = Popen(args, stdout=PIPE, stderr=PIPE)
use_shell = get_system() == "windows32"
p = Popen(args, stdout=PIPE, stderr=PIPE, shell=use_shell)
out, err = p.communicate()
return dict(out=out.strip(), err=err.strip())

View File

@@ -17,6 +17,7 @@ setup(
license=__license__,
install_requires=[
"click",
"colorama",
"pyserial",
"requests",
# "SCons"

View File

@@ -1,5 +1,7 @@
[tox]
envlist = develop, lint
# toxworkdir = /tmp/.tox
# toxworkdir = C:\Users\User\Downloads\.tox
envlist = lint
[testenv]
envlogdir = /tmp/toxlogdir
@@ -12,6 +14,8 @@ usedevelop = True
deps =
isort
flake8
commands =
pip install --egg scons
[testenv:lint]
deps =