From ff2996f0e6d272fe07c6cbbb2edc1df202976cb0 Mon Sep 17 00:00:00 2001 From: Samuel Date: Sat, 18 Apr 2026 14:08:52 +0200 Subject: [PATCH] Fusion des codes pour PAMI et carte de propulsion --- Asser_Moteurs.c | 1 + config_robot.h | 16 ++++++++++++++++ main.c | 1 + 3 files changed, 18 insertions(+) create mode 100644 config_robot.h diff --git a/Asser_Moteurs.c b/Asser_Moteurs.c index 4c13558..59263a5 100644 --- a/Asser_Moteurs.c +++ b/Asser_Moteurs.c @@ -1,3 +1,4 @@ +#include "config_robot.h" #include "QEI.h" #include "Moteurs.h" #include "Asser_Moteurs.h" diff --git a/config_robot.h b/config_robot.h new file mode 100644 index 0000000..9c7a436 --- /dev/null +++ b/config_robot.h @@ -0,0 +1,16 @@ +// Changer le define en fonction qu'on soit sur les PAMIs ou sur le robot principal + +#define ROBOT_PROPULSION_2026 +//#define ROBOT_TYPE_PAMI + +#ifndef ROBOT_PROPULSION_2026 +#ifndef ROBOT_TYPE_PAMI +#error "Vous devez choisir un type de robot" +#endif +#endif + +#ifdef ROBOT_PROPULSION_2026 +#ifdef ROBOT_TYPE_PAMI +#error "Vous devez choisir un seul type de robot" +#endif +#endif diff --git a/main.c b/main.c index 4de4ba4..236167d 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,7 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +#include "config_robot.h" #include "pico/stdlib.h" #include "pico/multicore.h" #include "hardware/adc.h"