00001 /* 00002 00003 \file pic_tick.h 00004 00005 Timer helper routines 00006 00007 Ian Harris 2008 00008 imharris [at] gmail.com 00009 00010 Released under the "do whatever you like with this 00011 but it breaks, you get to keep both pieces" license. 00012 00013 */ 00014 #ifndef __pic_tick_h 00015 #define __pic_tick_h 00016 00017 #include "pic_utils.h" 00018 00020 static uns16 tick = 0; 00021 00027 uns16 tick_get_count(); 00034 uns16 tick_calc_diff(uns16 a, uns16 b); 00035 00043 void handle_tick(); 00044 00053 inline void handle_tick_inline() { 00054 tick++; // we assume that interrupts are off at this point 00055 } 00056 00057 #endif