From d7fbf056cf58690fdea7dd33d4e2b25272e7a4c3 Mon Sep 17 00:00:00 2001 From: Samuel Date: Mon, 26 Sep 2022 21:54:06 +0200 Subject: [PATCH] =?UTF-8?q?Gyro=20globallement=20fonctionnel,=20mais=20la?= =?UTF-8?q?=20pr=C3=A9cision=20laisse=20=C3=A0=20d=C3=A9sirer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temps.c | 20 ++++++++++++++++++++ Temps.h | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 Temps.c create mode 100644 Temps.h diff --git a/Temps.c b/Temps.c new file mode 100644 index 0000000..a56af36 --- /dev/null +++ b/Temps.c @@ -0,0 +1,20 @@ +#include +#include "pico/stdlib.h" +#include "Temps.h" + +uint32_t temps_ms=0; +struct repeating_timer timer; + +bool Temps_increment(struct repeating_timer *t){ + temps_ms++; + return true; +} + +void Temps_init(void){ + temps_ms=0; + add_repeating_timer_ms(-1, Temps_increment, NULL, &timer); +} + +uint32_t Temps_get_temps_ms(void){ + return temps_ms; +} \ No newline at end of file diff --git a/Temps.h b/Temps.h new file mode 100644 index 0000000..0a575a3 --- /dev/null +++ b/Temps.h @@ -0,0 +1,5 @@ +#include "pico/stdlib.h" + +bool Temps_increment(struct repeating_timer *t); +void Temps_init(void); +uint32_t Temps_get_temps_ms(void); \ No newline at end of file