PAMI_2024/Temps.c

24 lines
460 B
C
Raw Normal View History

2024-04-27 19:21:41 +00:00
#include <stdio.h>
#include "pico/stdlib.h"
#include "Temps.h"
uint32_t temps_ms=0;
bool temps_est_init=false;
struct repeating_timer timer;
bool Temps_increment(struct repeating_timer *t){
temps_ms++;
return true;
}
void Temps_init(void){
if(!temps_est_init){
temps_ms=0;
add_repeating_timer_ms(-1, Temps_increment, NULL, &timer);
temps_est_init = true;
}
}
uint32_t Temps_get_temps_ms(void){
return temps_ms;
}