NBR_AVG_SAMPLES
int samples[NBR_AVG_SAMPLES];
time64_t time_stamps[NBR_AVG_SAMPLES];
if (avg->pos == NBR_AVG_SAMPLES)
if (avg->nbr_samples < NBR_AVG_SAMPLES)
for (i = 0; i < NBR_AVG_SAMPLES; i++) {
for (i = 0; i < NBR_AVG_SAMPLES; i++) {
avg->nbr_samples = NBR_AVG_SAMPLES;
avg->sum = sample * NBR_AVG_SAMPLES;