fix partition selection bug (#438)
This commit is contained in:
parent
cf6bb5c992
commit
1af4eb11a4
12
build.py
12
build.py
@ -7,15 +7,15 @@ import os.path
|
|||||||
import requests
|
import requests
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
from platformio import util
|
from platformio import util
|
||||||
|
from SCons.Script import DefaultEnvironment
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import configparser
|
import configparser
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import ConfigParser as configparser
|
import ConfigParser as configparser
|
||||||
|
|
||||||
Import("env")
|
|
||||||
|
|
||||||
# get platformio environment variables
|
# get platformio environment variables
|
||||||
|
env = DefaultEnvironment()
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read("platformio.ini")
|
config.read("platformio.ini")
|
||||||
|
|
||||||
@ -66,7 +66,15 @@ myboard = mykeys["board"]
|
|||||||
myuploadspeed = mykeys["upload_speed"]
|
myuploadspeed = mykeys["upload_speed"]
|
||||||
env.Replace(BOARD=myboard)
|
env.Replace(BOARD=myboard)
|
||||||
env.Replace(UPLOAD_SPEED=myuploadspeed)
|
env.Replace(UPLOAD_SPEED=myuploadspeed)
|
||||||
|
|
||||||
|
# re-set partition table
|
||||||
|
mypartitiontable = config.get("env", "board_build.partitions")
|
||||||
|
board = env.BoardConfig(myboard)
|
||||||
|
board.manifest['build']['partitions'] = mypartitiontable
|
||||||
|
|
||||||
|
# display target
|
||||||
print('\033[94m' + "TARGET BOARD: " + myboard + " @ " + myuploadspeed + "bps" + '\033[0m')
|
print('\033[94m' + "TARGET BOARD: " + myboard + " @ " + myuploadspeed + "bps" + '\033[0m')
|
||||||
|
print('\033[94m' + "Partition table: " + mypartitiontable + '\033[0m')
|
||||||
|
|
||||||
# parse ota key file
|
# parse ota key file
|
||||||
with open(otakeyfile) as myfile:
|
with open(otakeyfile) as myfile:
|
||||||
|
Loading…
Reference in New Issue
Block a user