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 if you use it send me an email" license. Oh, and 00012 if it breaks, you get to keep both pieces. 00013 00014 */ 00015 #ifndef __pic_tick_h 00016 #define __pic_tick_h 00017 00018 #include "pic_utils.h" 00019 00021 static uns16 tick = 0; 00022 00028 uns16 tick_get_count(); 00035 uns16 tick_calc_diff(uns16 a, uns16 b); 00036 00044 void handle_tick(); 00045 00054 inline void handle_tick_inline() { 00055 tick++; // we assume that interrupts are off at this point 00056 } 00057 00058 #endif