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