/* Keeps statistics about the operation of the system. */ #pragma once #include #include "main_logic.h" /* Load statistics from EEPROM */ void stats_load(); /* Save statistics to EEPROM */ void stats_save(); /* Reset the statistics back to zero. */ void stats_reset(); /* Record a reboot of the device */ void stats_add_reboot(); /* Record time spent in freefall (just for fun) */ void stats_add_freefall(int milliseconds); /* Record a single blink of the leds to the blink time histogram. */ void stats_add_blink(); /* Add an entry to the movement/temperature histograms */ /* Gets the data directly from sensor_task. */ void stats_add_histogram_entry(); /* Add time spent in given state. */ void stats_add_time(system_state_t state, int milliseconds); /* Add power usage to the statistics. */ void stats_add_power(int uA, int milliseconds); /* Print out the statistics as text. */ void stats_print(BaseSequentialStream *chp);