initial commit
This commit is contained in:
commit
7241619782
7
.clang-tidy
Normal file
7
.clang-tidy
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Clangtidy configuration file (not used until PIO 6)
|
||||||
|
---
|
||||||
|
Checks: 'abseil-*,boost-*,bugprone-*,cert-*,cppcoreguidelines-*,clang-analyzer-*,google-*,hicpp-*,modernize-*,performance-*,portability-*,readability-*,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-cppcoreguidelines-init-variables'
|
||||||
|
WarningsAsErrors: false
|
||||||
|
HeaderFilterRegex: ''
|
||||||
|
AnalyzeTemporaryDtors: false
|
||||||
|
FormatStyle: google
|
39
.editorconfig
Normal file
39
.editorconfig
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
# Base Configuration
|
||||||
|
[*]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
max_line_length = 120
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
|
# Yaml Standard
|
||||||
|
[*.{yaml,yml}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Markdown Standards
|
||||||
|
[*.md]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
# Java, Kotlin, Gradle, XML Standards
|
||||||
|
[*.{java,kt,kts,gradle,xml,pro}]
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
|
||||||
|
# C++ Files
|
||||||
|
[*.{cpp,h,ino}]
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
# PHP files
|
||||||
|
[*.php]
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
|
# INI Files
|
||||||
|
[*.ini]
|
||||||
|
indent_style = space
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
* text=auto eol=lf
|
11
.github/ISSUE_TEMPLATE/autre.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/autre.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
name: Autre
|
||||||
|
description: Tout autre éléments liée au projet
|
||||||
|
title: ""
|
||||||
|
labels: []
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: detail
|
||||||
|
attributes:
|
||||||
|
label: Details
|
||||||
|
validations:
|
||||||
|
required: true
|
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# fichier non pris en compte pour le moment :(
|
||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Discussions sur Git & Discord
|
||||||
|
url: https://discord.gg/TWKy76TptD
|
||||||
|
about: Pour discuter du projet on priorise le direct si possible :D
|
21
.github/ISSUE_TEMPLATE/idee_amelioration.yml
vendored
Normal file
21
.github/ISSUE_TEMPLATE/idee_amelioration.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: Fonctionalité
|
||||||
|
description: Une nouvelle fonctionalité ou amélioration d'un élément du logiciel
|
||||||
|
title: "amélioration: "
|
||||||
|
labels: []
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
id: needs
|
||||||
|
attributes:
|
||||||
|
label: Besoins de la fonctionalité
|
||||||
|
description: Indiquez quelle sont les besoins pour la fonctionalité
|
||||||
|
options:
|
||||||
|
- label: Code
|
||||||
|
- label: Design
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: detail
|
||||||
|
attributes:
|
||||||
|
label: Details
|
||||||
|
description: Détaillez la fonctionnalité voulu
|
||||||
|
validations:
|
||||||
|
required: false
|
31
.github/ISSUE_TEMPLATE/rapport_de_bug.yml
vendored
Normal file
31
.github/ISSUE_TEMPLATE/rapport_de_bug.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: Rapport de bug
|
||||||
|
description: Un problème dans le logiciel
|
||||||
|
title: "bug: "
|
||||||
|
labels: [type/bug]
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
id: needs
|
||||||
|
attributes:
|
||||||
|
label: Localisation du bug
|
||||||
|
description: Dans quel environement le bug a été vu
|
||||||
|
options:
|
||||||
|
- label: Production
|
||||||
|
- label: Développement
|
||||||
|
- label: Figma/Design
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: detail
|
||||||
|
attributes:
|
||||||
|
label: Details
|
||||||
|
description: Détaillez le bug qui a été vu
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: reproduce
|
||||||
|
attributes:
|
||||||
|
label: Reproduction
|
||||||
|
description: Comment reproduire le bug
|
||||||
|
placeholder: "1. démarrer l'application\n2. Cliquer ...\n3. Faire ..."
|
||||||
|
validations:
|
||||||
|
required: true
|
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
Bravo pour la PR, quelque note pour que tout se passe au mieux :D
|
||||||
|
|
||||||
|
- Lier la PR a une issue si elle existe!
|
||||||
|
- Assurez-vous que le nom de la PR respecte les règles (voir CONTRIBUTING.md)
|
||||||
|
- faites des rebase pour valider la PR
|
||||||
|
- Assurez-vous que le CI/CD est au vert
|
||||||
|
-->
|
41
.github/workflows/test_build.yml
vendored
Normal file
41
.github/workflows/test_build.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout project
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# - name: Cache pip
|
||||||
|
# uses: actions/cache@v3
|
||||||
|
# with:
|
||||||
|
# path: ~/.cache/pip
|
||||||
|
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
# restore-keys: |
|
||||||
|
# ${{ runner.os }}-pip-
|
||||||
|
|
||||||
|
# # this cache the platformio binaries and not the .pio folder
|
||||||
|
# - name: Cache PlatformIO
|
||||||
|
# uses: actions/cache@v3
|
||||||
|
# with:
|
||||||
|
# path: ~/.platformio
|
||||||
|
# key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: https://github.com/actions/setup-python@v3
|
||||||
|
|
||||||
|
- name: Install PlatformIO
|
||||||
|
run: pip install platformio
|
||||||
|
|
||||||
|
- name: Build the project
|
||||||
|
run: platformio run
|
||||||
|
|
||||||
|
- name: Test the project
|
||||||
|
run: platformio check --fail-on-defect high
|
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Platformio specifics
|
||||||
|
.pio
|
||||||
|
.vscode/.browse.c_cpp.db*
|
||||||
|
.vscode/c_cpp_properties.json
|
||||||
|
.vscode/launch.json
|
||||||
|
.vscode/ipch
|
||||||
|
|
||||||
|
# Aptatio/Platformio specifics
|
||||||
|
secrets.ini
|
10
.vscode/extensions.json
vendored
Normal file
10
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
|
// for the documentation about the extensions.json format
|
||||||
|
"recommendations": [
|
||||||
|
"platformio.platformio-ide"
|
||||||
|
],
|
||||||
|
"unwantedRecommendations": [
|
||||||
|
"ms-vscode.cpptools-extension-pack"
|
||||||
|
]
|
||||||
|
}
|
57
CONTRIBUTING.md
Normal file
57
CONTRIBUTING.md
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# Fonctionnement
|
||||||
|
|
||||||
|
## Labels
|
||||||
|
|
||||||
|
- `Type/Amélioration`: Issue/PR lié à une amélioration d'une fonctionalité
|
||||||
|
- `Type/Bug`: Issue/PR lié à un bug présent dans le logiciel a corriger
|
||||||
|
- `Type/Documentation`: Issue/PR lié à un changement dans la documentation technique et/ou le design UI/UX
|
||||||
|
- `Type/Fonctionnalité`: Issue/PR lié à une nouvelle fonctionnalité
|
||||||
|
- `Type/Sécurité`: Issue/PR lié a la sécurité du logiciel
|
||||||
|
- `Type/Tests`: Issue/PR lié a des tests
|
||||||
|
|
||||||
|
- `Status/Besoin d'infos`: Feedback nécessaire pour avancer
|
||||||
|
- `Status/Bloqué`: Issue/PR bloqué par quelque chose
|
||||||
|
|
||||||
|
- `Tech/Logiciel`: issue ou PR qui est liée a du logiciel (Code)
|
||||||
|
- `Tech/Mécatronique`:Issue qui est dans le hard (Éléctronique, Mécanique)
|
||||||
|
|
||||||
|
- `Priorité/Critique`: issue critique dans l'usage du logiciel
|
||||||
|
- `Priorité/Haute`: issue importante
|
||||||
|
- `Priorité/Moyenne`: issue moyenement importante
|
||||||
|
- `Priorité/Basse`: Issue non/peu importante
|
||||||
|
|
||||||
|
- `Revue/Confirmé`: Issue validé qui est à faire
|
||||||
|
- `Revue/Dupliqué`: Issue fermé car elle est déjà éxistante
|
||||||
|
- `Revue/Invalide`: Issue invalide (raison en commentaire)
|
||||||
|
- `Revue/Non Corrigable`: Issue non corrigable (raison en commentaire)
|
||||||
|
|
||||||
|
## Workflow d'un issue
|
||||||
|
|
||||||
|
- Ajout d'une issue
|
||||||
|
- trie selon le type de l'issue avec les labels
|
||||||
|
- Affectassion a un milestone si possible
|
||||||
|
- travail sur l'issue
|
||||||
|
- fermeture de l'issue avec une liaison avec un commit/PR si relié
|
||||||
|
|
||||||
|
## Branches/Tags
|
||||||
|
|
||||||
|
_Basé sur `Git Flow` mais en plus simplifié_
|
||||||
|
|
||||||
|
- `branch/master`: Branche principal qui contient le code mergé final et fonctionnel
|
||||||
|
- `branch/blablabla`: Branche liée a une **Pull Request** qui contient du code non stable selon l'avancement
|
||||||
|
- `tags/*.*.*`: Chaque tag est sa version et doit Respecter le format `semver` alias `MAJOR.MINOR.PATCH` toute les versions en dessous de `1.0.0` seront considéré comme non-stable
|
||||||
|
|
||||||
|
## Commits/PR
|
||||||
|
|
||||||
|
_basé sur `Conventional Commits` mais en plus simplifié_
|
||||||
|
|
||||||
|
Globalement c'est recommendé d'utiliser sa pour **TOUT** les commits _mais_ au minimum a utiliser pour nommer la **PR** pour garder la branche principal clean
|
||||||
|
|
||||||
|
architecture: `prefix: description`
|
||||||
|
trois partis pour un commit/pr:
|
||||||
|
- prefix
|
||||||
|
- `feat`: grosso modo c'est le label `fonctionnalité`
|
||||||
|
- `fix`: c'est le label `bug` ou un amélioration de perfs
|
||||||
|
- `docs`: Changement au niveau de la documentation technique
|
||||||
|
- `chore`: Changement autre (dépendances, CI/CD)
|
||||||
|
- `description`: texte en anglais commencant par un verbe indiquant ce qui a été fait (ex: `allow`,`send`, `change`, etc)
|
19
README.md
Normal file
19
README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Nom du projet
|
||||||
|
|
||||||
|
Description du projet
|
||||||
|
|
||||||
|
_note: voir le fichier SETUP.md pour setup le template dans un nouveau repo_
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
Description sur la façon dont on installe le logiciel/lib
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Description rapide de l'usage du logiciel
|
||||||
|
|
||||||
|
## Règles de contributions
|
||||||
|
|
||||||
|
Voir le fichier CONTRIBUTING.md
|
10
SETUP.md
Normal file
10
SETUP.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
1. Activer la protection de branche pour `master`
|
||||||
|
2. `Enabled Branch Protection`
|
||||||
|
3. `Disable Push`
|
||||||
|
4. `Enable Merge Whitelist`
|
||||||
|
5. `Whitelisted teams for merging` = `owners` + `you`
|
||||||
|
6. `Required approvals` = `1`
|
||||||
|
7. `Block merge on rejected reviews`
|
||||||
|
8. `Dismiss stale approvals`
|
||||||
|
9. `Block merge id pull request is outdated`
|
||||||
|
10. Delete this file and `UPDATE.md` :D
|
15
UPDATE.md
Normal file
15
UPDATE.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# How to update a child repo from this template
|
||||||
|
|
||||||
|
run this script and remove the possibly added files
|
||||||
|
```
|
||||||
|
git push -d fix/update-template
|
||||||
|
git branch -D fix/update-template
|
||||||
|
git checkout -b fix/update-template
|
||||||
|
git clone ssh://git@git.dzeio.com:8022/aptatio/template-2.git tpl
|
||||||
|
rm -rf tpl/.git tpl/SETUP.md tpl/UPDATE.md tpl/README.md
|
||||||
|
yes | cp tpl/{.,}* ./ -r
|
||||||
|
rm -rf tpl
|
||||||
|
git add .
|
||||||
|
git commit -m "misc: update template"
|
||||||
|
git push -u origin fix/update-template
|
||||||
|
```
|
19
config.cppcheck
Normal file
19
config.cppcheck
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- CPP Check configuation file -->
|
||||||
|
<project version="1">
|
||||||
|
<builddir>.cppcheck-build</builddir>
|
||||||
|
<platform>Unspecified</platform>
|
||||||
|
<analyze-all-vs-configs>false</analyze-all-vs-configs>
|
||||||
|
<check-headers>true</check-headers>
|
||||||
|
<check-unused-templates>false</check-unused-templates>
|
||||||
|
<max-ctu-depth>10</max-ctu-depth>
|
||||||
|
<exclude>
|
||||||
|
<path name=".pio/"/>
|
||||||
|
</exclude>
|
||||||
|
<suppressions>
|
||||||
|
<suppression>noCopyConstructor</suppression>
|
||||||
|
<suppression>noExplicitConstructor</suppression>
|
||||||
|
<suppression>unusedFunction</suppression>
|
||||||
|
<suppression>noOperatorEq</suppression>
|
||||||
|
</suppressions>
|
||||||
|
</project>
|
19
config.ini
Normal file
19
config.ini
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
; Project configuration file
|
||||||
|
|
||||||
|
[config]
|
||||||
|
; Hardware Serial baud rate
|
||||||
|
; Also available in the code as `MONITOR_SPEED`
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
; Software Config
|
||||||
|
; note: additionnal flags are added by Platform.io (see total amount in `.vscode/c_cpp_properties.json` in the `defines` section)
|
||||||
|
; notworthy ones:
|
||||||
|
; __PLATFORMIO_BUILD_DEBUG__ = debug mode
|
||||||
|
build_flags =
|
||||||
|
; DO NOT TOUCH --- START
|
||||||
|
-D MONITOR_SPEED=${config.monitor_speed}
|
||||||
|
; DO NOT TOUCH --- END
|
||||||
|
|
||||||
|
-D EXAMPLE_NUMBER=69
|
||||||
|
|
||||||
|
-D EXAMPLE_STRING=\"Pouet\"
|
18
docs/README.md
Normal file
18
docs/README.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Docs
|
||||||
|
|
||||||
|
Documentation Technique du projet
|
||||||
|
|
||||||
|
## fichiers .puml
|
||||||
|
|
||||||
|
Les fichiers en .puml sont des fichiers UMLs sous forme de code
|
||||||
|
|
||||||
|
Afin d'en avoir le résultat graphique :
|
||||||
|
|
||||||
|
1. Ouvrez un navigateur
|
||||||
|
2. lancer le lien suivant [https://www.plantuml.com/plantuml/uml/](https://www.plantuml.com/plantuml/uml/)
|
||||||
|
3. Copiez/Collez le contenu du fichier .puml dans le voite de texte
|
||||||
|
4. Cliquez sur `Submit`
|
||||||
|
|
||||||
|
ou si vous utilisez `VSCode`:
|
||||||
|
1. installez l'extensions [PlantUML](https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml) _jebbs.plantuml_
|
||||||
|
2. `ALT+D` lorsque vous êtes dans un fichier .puml
|
15
envs.ini
Normal file
15
envs.ini
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
; Add additionnal environments in this file
|
||||||
|
|
||||||
|
; Default production environment
|
||||||
|
[env:prod]
|
||||||
|
|
||||||
|
; Debug environemnt
|
||||||
|
[env:debug]
|
||||||
|
build_type = debug
|
||||||
|
|
||||||
|
|
||||||
|
; Example additionnal env
|
||||||
|
; [env:example]
|
||||||
|
; ; note: keep the `${env.build_flags}` to includes others build flags
|
||||||
|
; build_flags = ${env.build_flags}
|
||||||
|
; -D POUET
|
19
include/Program.h
Normal file
19
include/Program.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef PROGRAM_H
|
||||||
|
#define PROGRAM_H
|
||||||
|
|
||||||
|
#include "Arduino.h"
|
||||||
|
|
||||||
|
class Program {
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Program startup
|
||||||
|
*/
|
||||||
|
Program();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Program main loop
|
||||||
|
*/
|
||||||
|
void loop();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
4
include/README.md
Normal file
4
include/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Dossier pour les fichiers `headers` de CPP
|
||||||
|
|
||||||
|
en savoir plus: https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
27
lib/README.md
Normal file
27
lib/README.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Librairies maisons utilisé pour ce projet
|
||||||
|
|
||||||
|
Architecture fichiers:
|
||||||
|
```
|
||||||
|
|--lib
|
||||||
|
| |
|
||||||
|
| |--Bar
|
||||||
|
| | |--docs
|
||||||
|
| | |--examples
|
||||||
|
| | |--src
|
||||||
|
| | |- Bar.c
|
||||||
|
| | |- Bar.h
|
||||||
|
| | |- library.json voir: https://docs.platformio.org/page/librarymanager/config.html
|
||||||
|
| |
|
||||||
|
| |--Foo
|
||||||
|
| | |- Foo.c
|
||||||
|
| | |- Foo.h
|
||||||
|
| |
|
||||||
|
| |- README --> THIS FILE
|
||||||
|
|
|
||||||
|
|- platformio.ini
|
||||||
|
|--src
|
||||||
|
|- main.cpp
|
||||||
|
|- Program.cpp
|
||||||
|
```
|
||||||
|
|
||||||
|
En savoir plus: https://docs.platformio.org/en/latest/librarymanager/quickstart.html
|
73
platformio.ini
Normal file
73
platformio.ini
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
; PlatformIO Project Configuration File
|
||||||
|
|
||||||
|
; WARNING: Items containing version number MUST be the version NOT A RANGE
|
||||||
|
|
||||||
|
; Additionnal files
|
||||||
|
; `secrets.ini`: Secret Build Flags that will be ignored in git (content: `[secrets]\nbuild_flags = `)
|
||||||
|
; `envs.ini`: Build environments
|
||||||
|
; `config.ini`: Global Configuration File
|
||||||
|
|
||||||
|
; Defaults
|
||||||
|
[secrets]
|
||||||
|
build_flags =
|
||||||
|
|
||||||
|
[platformio]
|
||||||
|
default_envs = debug
|
||||||
|
extra_configs =
|
||||||
|
secrets.ini
|
||||||
|
config.ini
|
||||||
|
envs.ini
|
||||||
|
|
||||||
|
; Cache folder
|
||||||
|
build_cache_dir = ./.pio/cache
|
||||||
|
|
||||||
|
[env]
|
||||||
|
; build Envs
|
||||||
|
build_flags = ${config.build_flags} ${secrets.build_flags}
|
||||||
|
|
||||||
|
; Add scripts for more functionnalities
|
||||||
|
; see individual scripts for more informations
|
||||||
|
extra_scripts = pre:scripts/get_additionnal_envs.py
|
||||||
|
|
||||||
|
; Device Settings (make sure to fix versions where possible!)
|
||||||
|
platform = espressif32@4.2.0
|
||||||
|
board = esp32dev
|
||||||
|
framework = arduino
|
||||||
|
|
||||||
|
; Monitoring settings
|
||||||
|
monitor_speed = ${config.monitor_speed}
|
||||||
|
|
||||||
|
; note: make sure to rebuild after changing it (log2file add a .log file containing the monitor logs)
|
||||||
|
monitor_filters = esp32_exception_decoder, time, send_on_enter, default ;, log2file
|
||||||
|
|
||||||
|
; Ask the monitor to echo the content written
|
||||||
|
monitor_echo = yes
|
||||||
|
|
||||||
|
; upload settings
|
||||||
|
; upload_port = COM1
|
||||||
|
|
||||||
|
upload_speed = 921600
|
||||||
|
|
||||||
|
; librairies (make sure to fix versions where possible!)
|
||||||
|
lib_deps =
|
||||||
|
; example:
|
||||||
|
; erropix/ESP32 AnalogWrite@0.2
|
||||||
|
|
||||||
|
; Checker settings
|
||||||
|
check_tool = clangtidy, cppcheck
|
||||||
|
|
||||||
|
; Filters for checkers
|
||||||
|
check_src_filters =
|
||||||
|
+<src/>
|
||||||
|
+<include/>
|
||||||
|
+<lib/>
|
||||||
|
+<test/>
|
||||||
|
-<.pio/>
|
||||||
|
|
||||||
|
; Ask pio to not scan `./.pio` files
|
||||||
|
check_skip_packages = yes
|
||||||
|
|
||||||
|
; use config files for clangtidy and cppcheck
|
||||||
|
check_flags =
|
||||||
|
clangtidy: --config-file=.clang-tidy
|
||||||
|
cppcheck: --project=config.cppcheck --inline-suppr -i=".pio"
|
41
scripts/get_additionnal_envs.py
Normal file
41
scripts/get_additionnal_envs.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
"""
|
||||||
|
Add additionnal ENVs to the program
|
||||||
|
|
||||||
|
GIT_COMMIT: the git commit ID
|
||||||
|
GIT_BRANCH: the current git branch
|
||||||
|
GIT_TAG: the current git tag or "dev"
|
||||||
|
|
||||||
|
_note: to get the full list of env at build time run: `pio run -t envdump > pouet.log` and look at "BUILD_FLAGS_
|
||||||
|
"""
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
Import("env")
|
||||||
|
|
||||||
|
def run_command(command):
|
||||||
|
"""
|
||||||
|
run a command on the system
|
||||||
|
"""
|
||||||
|
return subprocess.run(command, stdout=subprocess.PIPE, text=True).stdout
|
||||||
|
|
||||||
|
def get_additionnal_envs():
|
||||||
|
"""
|
||||||
|
get the git commit/branch/tag of the project and return them
|
||||||
|
"""
|
||||||
|
commit = run_command(["git", "rev-parse", "HEAD"])[:7]
|
||||||
|
branch = run_command(["git", "rev-parse", "--abbrev-ref", "HEAD"])
|
||||||
|
tag = run_command(["git", "tag", "-l", "--points-at", "HEAD"])
|
||||||
|
|
||||||
|
items = [
|
||||||
|
f"-D GIT_COMMIT=\\\"{commit}\\\"",
|
||||||
|
f"-D GIT_BRANCH=\\\"{branch.strip()}\\\""
|
||||||
|
]
|
||||||
|
if tag != "":
|
||||||
|
items.append(f"-D GIT_TAG=\\\"{tag.strip()}\\\"")
|
||||||
|
else:
|
||||||
|
items.append("-D GIT_TAG=\\\"dev\\\"")
|
||||||
|
return items
|
||||||
|
|
||||||
|
env.Append(
|
||||||
|
BUILD_FLAGS=get_additionnal_envs()
|
||||||
|
)
|
6
secrets.ini.example
Normal file
6
secrets.ini.example
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
; Add secrets token/logins/etc `secrets.ini`
|
||||||
|
; Add the sames values as blank in `secrets.ini.example
|
||||||
|
; To be able to reproduce it
|
||||||
|
|
||||||
|
[secrets]
|
||||||
|
build_flags =
|
10
src/Program.cpp
Normal file
10
src/Program.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include "Program.h"
|
||||||
|
|
||||||
|
Program::Program() {
|
||||||
|
// Startup
|
||||||
|
Serial.begin(MONITOR_SPEED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Program::loop() {
|
||||||
|
// Loop
|
||||||
|
}
|
3
src/README.md
Normal file
3
src/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Code source du projet
|
||||||
|
|
||||||
|
En savoir plus: https://docs.platformio.org/en/latest/core/quickstart.html
|
11
src/main.cpp
Normal file
11
src/main.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "Program.h"
|
||||||
|
|
||||||
|
Program* program;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
program = new Program();
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
program->loop();
|
||||||
|
}
|
4
test/README.md
Normal file
4
test/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
# Fichiers de tests unitaire de PlatformIO
|
||||||
|
|
||||||
|
En savoir plus: https://docs.platformio.org/page/plus/unit-testing.html
|
Loading…
x
Reference in New Issue
Block a user