The v2 PlatformIO firmware is the one in production — complete the 48V voltage-class support started in config.h: - config.h: imbalance tolerance 2 V in 48V class (x13/7 of the 1 V @7s fleet policy). - BatteryParallelator.h / INAHandler.h: member defaults now come from the config.h class macros instead of hardcoded 24000/30000 (they are overwritten by setters at setup(), defensive only). - platformio.ini: new kxkm-s3-16MB-48v and kxkm-v3-16MB-48v envs extending the production envs with -DBATTERY_PACK_CLASS_48V. Validated: pio run green for kxkm-s3-16MB-48v and kxkm-s3-16MB (default 24V unchanged), sim-host tests 13/13 pass.
120 lines
3.2 KiB
INI
120 lines
3.2 KiB
INI
; PlatformIO Project Configuration File — KXKM Batterie Parallelator
|
|
; Kill_LIFE compatible (native test env séparé du framework arduino)
|
|
|
|
[platformio]
|
|
default_envs = kxkm-s3-16MB
|
|
src_dir = firmware/src
|
|
test_dir = firmware/test
|
|
lib_dir = firmware/lib
|
|
data_dir = firmware/data
|
|
|
|
[env]
|
|
monitor_speed = 115200
|
|
test_framework = unity
|
|
|
|
[arduino_base]
|
|
platform = https://github.com/platformio/platform-espressif32
|
|
framework = arduino
|
|
board_build.f_cpu = 240000000L
|
|
board_build.f_flash = 80000000L
|
|
board_build.flash_mode = qio
|
|
build_flags =
|
|
|
|
lib_deps =
|
|
Wire
|
|
https://github.com/adafruit/Adafruit_BusIO
|
|
https://github.com/JChristensen/Timer
|
|
https://github.com/josephlarralde/ArduinoEventEmitter
|
|
EEPROM
|
|
WiFi
|
|
SPI
|
|
Ethernet
|
|
https://github.com/hideakitai/ArtNet #0.2.12
|
|
https://github.com/marian-craciunescu/ESP32Ping
|
|
FS
|
|
Arduino_JSON
|
|
https://github.com/me-no-dev/AsyncTCP.git
|
|
https://github.com/me-no-dev/ESPAsyncWebServer.git
|
|
https://github.com/RobTillaart/INA226.git
|
|
https://github.com/knolleary/pubsubclient.git
|
|
https://github.com/arduino-libraries/NTPClient.git
|
|
https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino.git
|
|
https://github.com/Links2004/arduinoWebSockets.git
|
|
https://github.com/bblanchon/ArduinoJson.git
|
|
https://github.com/mobizt/ESP_SSLClient.git
|
|
|
|
lib_extra_dirs =
|
|
|
|
|
|
[env:esp-wrover-kit]
|
|
extends = arduino_base
|
|
board = esp-wrover-kit
|
|
|
|
; --- Target ESP32-S3 (board cible production) ---
|
|
[env:kxkm-s3-16MB]
|
|
extends = arduino_base
|
|
board = adafruit_feather_esp32s3_nopsram
|
|
upload_speed = 921600
|
|
board_upload.flash_size = 16MB
|
|
board_build.partitions = firmware/partitions_16MB.csv
|
|
build_flags =
|
|
${arduino_base.build_flags}
|
|
-DHW_VERSION=3
|
|
lib_deps =
|
|
${arduino_base.lib_deps}
|
|
https://github.com/karl-mohring/TCA95x5_driver.git
|
|
https://github.com/RobTillaart/TCA9555.git
|
|
lib_extra_dirs =
|
|
${arduino_base.lib_extra_dirs}
|
|
|
|
; --- Legacy v3 (esp-wrover-kit, gardé pour compatibilité) ---
|
|
[env:kxkm-v3-16MB]
|
|
extends = arduino_base
|
|
board = esp-wrover-kit
|
|
upload_speed = 512000
|
|
board_upload.flash_size = 16MB
|
|
board_build.partitions = firmware/partitions_16MB.csv
|
|
build_flags =
|
|
${arduino_base.build_flags}
|
|
-DHW_ENABLE_STM32=1
|
|
lib_deps =
|
|
${arduino_base.lib_deps}
|
|
https://github.com/karl-mohring/TCA95x5_driver.git
|
|
https://github.com/RobTillaart/TCA9555.git
|
|
lib_extra_dirs =
|
|
${arduino_base.lib_extra_dirs}
|
|
|
|
; --- Variante 48V (packs 13s Li-ion, hardware BMU-v2-48v) ---
|
|
; Seuils : 44600/55200 mV, déséquilibre 2 V — cf. firmware/src/config.h
|
|
[env:kxkm-s3-16MB-48v]
|
|
extends = env:kxkm-s3-16MB
|
|
build_flags =
|
|
${env:kxkm-s3-16MB.build_flags}
|
|
-DBATTERY_PACK_CLASS_48V
|
|
|
|
[env:kxkm-v3-16MB-48v]
|
|
extends = env:kxkm-v3-16MB
|
|
build_flags =
|
|
${env:kxkm-v3-16MB.build_flags}
|
|
-DBATTERY_PACK_CLASS_48V
|
|
|
|
[env:native]
|
|
platform = native
|
|
build_flags =
|
|
-DNATIVE_TEST
|
|
lib_deps =
|
|
throwtheswitch/Unity @ ^2.6.1
|
|
; sim_s3 et sim_validation sont des programmes standalone (g++), pas des tests Unity
|
|
; test_tca_ina dépend du matériel/stack Arduino (INA226/TCA9555), non exécutable en host natif
|
|
test_ignore = test_s3_sim, test_tca_ina
|
|
|
|
[env:sim-host]
|
|
extends = env:native
|
|
test_build_src = yes
|
|
build_src_filter =
|
|
+<InfluxBufferCodec.cpp>
|
|
+<BatteryRouteValidation.cpp>
|
|
+<WebMutationRateLimit.cpp>
|
|
+<WebRouteSecurity.cpp>
|
|
+<I2CRecoveryPolicy.cpp>
|