61 lines
1.3 KiB
C
61 lines
1.3 KiB
C
#include "pico/stdlib.h"
|
|
#include <stdio.h>
|
|
#include "Monitoring.h"
|
|
|
|
uint32_t temps_cycle_min = UINT32_MAX;
|
|
uint32_t temps_cycle_max=0;
|
|
int lock=0;
|
|
uint32_t debug_var=0;
|
|
float debug_varf=0;
|
|
|
|
void temps_cycle_check(){
|
|
static uint32_t temps_old;
|
|
uint32_t temps, temps_cycle;
|
|
|
|
temps = time_us_32();
|
|
temps_cycle = temps - temps_old;
|
|
|
|
if(temps_cycle < temps_cycle_min){
|
|
temps_cycle_min = temps_cycle;
|
|
}
|
|
|
|
if(temps_cycle > temps_cycle_max){
|
|
temps_cycle_max = temps_cycle;
|
|
}
|
|
temps_old=time_us_32();
|
|
}
|
|
|
|
void temps_cycle_reset(){
|
|
temps_cycle_min = UINT32_MAX;
|
|
temps_cycle_max=0;
|
|
}
|
|
|
|
void Monitoring_display(){
|
|
temps_cycle_display();
|
|
}
|
|
|
|
void temps_cycle_display(){
|
|
uint32_t temps;
|
|
temps = time_us_32()/1000;
|
|
printf(">T_cycle_min(us):%ld:%d\n", temps, temps_cycle_min);
|
|
printf(">T_cycle_max(us):%ld:%d\n", temps, temps_cycle_max);
|
|
printf(">DebugVar:%ld:%d\n", temps, debug_var);
|
|
printf(">DebugVarf:%ld:%f\n", temps, debug_varf);
|
|
temps_cycle_reset();
|
|
}
|
|
|
|
uint32_t temps_cycle_get_min(){
|
|
return temps_cycle_min;
|
|
}
|
|
|
|
uint32_t temps_cycle_get_max(){
|
|
return temps_cycle_max;
|
|
}
|
|
|
|
void set_debug_var(uint32_t variable){
|
|
debug_var = variable;
|
|
}
|
|
|
|
void set_debug_varf(float variable){
|
|
debug_varf = variable;
|
|
} |