From cb41178d87026d59d2175bf5ec1168cf1b58080f Mon Sep 17 00:00:00 2001 From: trotFunky Date: Sun, 17 Dec 2023 21:18:58 +0000 Subject: [PATCH] Build: Introduce prod/dev environments Platformio supports multiple environments and sharing a global configuration. Make use of this to easily allow switching between the production build, with HID, and the development build, with serial. Update the README with information on how to build those environments. --- README.md | 10 ++++++++++ platformio.ini | 10 +++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index abbd56f..3d9978f 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,16 @@ réalisé pour le rendre flexible sur ce point. Ce projet utilise [Platformio](https://platformio.org/) pour gérer la compilation, mise à jour et suivi des dépendances. +Pour mettre à jour la carte, une fois connectée, vous pouvez lancer la commande suivante : +```shell +platformio run -e prod -t upload +``` + +Pour utiliser l'environnement de développement et désactiver la communication HID, utilisez la commande suivante : +```shell +platformio run -e dev -t upload +``` + ## Carte cible La structure du code assume une carte Teensy. En particulier, il est conçu pour la diff --git a/platformio.ini b/platformio.ini index f348053..d25c624 100644 --- a/platformio.ini +++ b/platformio.ini @@ -8,7 +8,7 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:teensy41] +[env] platform = teensy board = teensy41 framework = arduino @@ -17,5 +17,9 @@ lib_deps = adafruit/Adafruit PCD8544 Nokia 5110 LCD library adafruit/Adafruit GFX Library adafruit/Adafruit BusIO -; Should be uncommented in production in order to use HID. -;build_flags = -D USB_RAWHID + +[env:dev] + + +[env:prod] +build_flags = -D USB_RAWHID