#include "mcc_generated_files/mcc.h" static uint16_t ms_counter; static void inc_ms_counter(void) { ms_counter++; } void init_timekeeping(void) { TMR0_SetInterruptHandler(inc_ms_counter); } uint16_t millis(void) { return ms_counter; }