Save events to memory in the main task loop, not in an interrupt handler.  Log longs.  Fix missing ; in scheduler.c
Save a time along with each event.