new hal file selection concept

This commit is contained in:
Verkehrsrot 2019-06-30 17:48:24 +02:00
parent 20adc016b8
commit 197e2d0e80
22 changed files with 81 additions and 86 deletions

View File

@ -1,5 +1,5 @@
# build.py
# pre-build script, setting up build environment
# pre-build script, setting up build environment and fetch hal file for user's board
import sys
import os
@ -55,8 +55,20 @@ if os.path.isfile(otakeyfile) and os.access(otakeyfile, os.R_OK):
else:
sys.exit("Missing file " + otakeyfile + ", please create it! Aborting.")
# parse ota key file
# parse hal file
mykeys = {}
with open(halconfigfile) as myfile:
for line in myfile:
line2 = line.strip("// ")
key, value = line2.partition(" ")[::2]
mykeys[key.strip()] = str(value).strip()
myboard = mykeys["board"]
myuploadspeed = mykeys["upload_speed"]
env.Replace(BOARD=myboard)
env.Replace(UPLOAD_SPEED=myuploadspeed)
print '\033[94m' + "TARGET BOARD: " + myboard + " @ " + myuploadspeed + "bps" + '\033[0m'
# parse ota key file
with open(otakeyfile) as myfile:
for line in myfile:
key, value = line.partition("=")[::2]

View File

@ -5,88 +5,28 @@
; http://docs.platformio.org/page/projectconf.html
; ---> SELECT TARGET PLATFORM HERE! <---
; ---> SELECT THE TARGET PLATFORM HERE! <---
[board]
;halfile = ebox.h
;board = esp32dev
;upload_speed = 115200
;halfile = eboxtube.h
;board = esp32dev
;upload_speed = 115200
;halfile = ecopower.h
;board = esp32dev
;upload_speed = 921600
;halfile = heltec.h
;board = heltec_wifi_lora_32
;upload_speed = 921600
;halfile = heltecv2.h
;board = heltec_wifi_lora_32_V2
;upload_speed = 921600
;halfile = ttgov1.h
;board = ttgo-lora32-v1
;upload_speed = 115200
;halfile = ttgov2.h
;board = ttgo-lora32-v1
;upload_speed = 921600
;halfile = ttgov21old.h
;board = esp32dev
;upload_speed = 921600
;halfile = ttgov21new.h
;board = esp32dev
;upload_speed = 921600
;halfile = ttgofox.h
;board = esp32dev
;upload_speed = 921600
halfile = ttgobeam.h
board = ttgo-t-beam
upload_speed = 921600
;halfile = fipy.h
;board = esp32dev
;upload_speed = 921600
;halfile = lopy.h
;board = lopy
;upload_speed = 921600
;halfile = lopy4.h
;board = lopy4
;upload_speed = 921600
;halfile = lolin32litelora.h
;board = lolin32
;upload_speed = 921600
;halfile = lolin32lora.h
;board = lolin32
;upload_speed = 921600
;halfile = lolin32lite.h
;board = lolin32
;upload_speed = 921600
;halfile = wemos32oled.h
;board = lolin32
;upload_speed = 921600
;halfile = octopus32.h
;board = featheresp32
;upload_speed = 921600
;halfile = generic.h
;board = esp32dev
;upload_speed = 115200
;halfile = ebox.h
;halfile = eboxtube.h
;halfile = ecopower.h
;halfile = heltec.h
;halfile = heltecv2.h
;halfile = ttgov1.h
;halfile = ttgov2.h
;halfile = ttgov21old.h
;halfile = ttgov21new.h
;halfile = ttgofox.h
halfile = ttgobeam.h
;halfile = fipy.h
;halfile = lopy.h
;halfile = lopy4.h
;halfile = lolin32litelora.h
;halfile = lolin32lora.h
;halfile = lolin32lite.h
;halfile = wemos32oled.h
;halfile = octopus32.h
[platformio]
; upload firmware to board with usb cable
@ -97,7 +37,7 @@ default_envs = usb
;default_envs = dev
build_cache_dir = /tmp/platformio-shared-cache
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
description = Paxcounter is a device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
@ -111,7 +51,9 @@ lorakeyfile = loraconf.h
lmicconfigfile = lmic_config.h
platform_espressif32 = espressif32@1.9.0
board_build.partitions = min_spiffs.csv
board = esp32dev
monitor_speed = 115200
upload_speed = 115200
lib_deps_lora =
;MCCI LoRaWAN LMIC library@2.3.2
https://github.com/mcci-catena/arduino-lmic.git
@ -154,8 +96,8 @@ build_flags_all =
-mfix-esp32-psram-cache-issue
[env]
board = ${board.board}
upload_speed = ${board.upload_speed}
board = ${common.board}
upload_speed = ${common.upload_speed}
platform = ${common.platform_espressif32}
framework = arduino
board_build.partitions = ${common.board_build.partitions}
@ -173,6 +115,7 @@ upload_protocol = esptool
[env:dev]
upload_protocol = esptool
build_type = debug
platform = https://github.com/platformio/platform-espressif32.git#develop
platform_packages =
; use upstream Git version

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 115200
// board esp32dev
#ifndef _EBOX_H
#define _EBOX_H

View File

@ -1,4 +1,7 @@
// clang-format off
// upload_speed 115200
// board esp32dev
#ifndef _EBOXTUBE_H
#define _EBOXTUBE_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board esp32dev
#ifndef _GENERIC_H
#define _GENERIC_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board esp32dev
#ifndef _FIPY_H
#define _FIPY_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 115200
// board esp32dev
#ifndef _GENERIC_H
#define _GENERIC_H

View File

@ -1,5 +1,6 @@
// clang-format off
// upload_speed 921600
// board heltec_wifi_lora_32
#ifndef _HELTEC_H
#define _HELTEC_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board heltec_wifi_lora_32_V2
#ifndef _HELTECV2_H
#define _HELTECV2_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board lolin32
#ifndef _LOLINLITE_H
#define _LOLINLITE_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board lolin32
#ifndef _LOLINLITELORA_H
#define _LOLINLITELORA_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board lolin32
#ifndef _LOLINLORA_H
#define _LOLINLORA_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board lopy
#ifndef _LOPY_H
#define _LOPY_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board lopy4
#ifndef _LOPY4_H
#define _LOPY4_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board featheresp32
#ifndef _OCTOPUS_H
#define _OCTOPUS_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board ttgo-t-beam
#ifndef _TTGOBEAM_H
#define _TTGOBEAM_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board esp32dev
#ifndef _TTGOFOX_H
#define _TTGOFOX_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 115200
// board ttgo-lora32-v1
#ifndef _TTGOV1_H
#define _TTGOV1_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board ttgo-lora32-v1
#ifndef _TTGOV2_H
#define _TTGOV2_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board esp32dev
#ifndef _TTGOV21NEW_H
#define _TTGOV21NEW_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board esp32dev
#ifndef _TTGOV21OLD_H
#define _TTGOV21OLD_H

View File

@ -1,4 +1,6 @@
// clang-format off
// upload_speed 921600
// board lolin32
#ifndef _WEMOS32OLED_H
#define _WEMOS32OLED_H