extruder/timer.h

00001 #ifndef _TIMER_H
00002 #define _TIMER_H
00003 
00004 #include  <stdint.h>
00005 #include  <avr/io.h>
00006 
00007 // time-related constants
00008 #define US  * (F_CPU / 1000000)
00009 #define MS  * (F_CPU / 1000)
00010 
00011 /*
00012 clock stuff
00013 */
00014 extern volatile uint8_t clock_flag;
00015 
00016 #define CLOCK_FLAG_10MS               1
00017 #define CLOCK_FLAG_250MS              2
00018 #define CLOCK_FLAG_1S                 4
00019 #define ifclock(F)  for (;clock_flag & (F);clock_flag &= ~(F))
00020 
00021 /*
00022 timer stuff
00023 */
00024 void timer_init(void) __attribute__ ((cold));
00025 
00026 void setTimer(uint32_t delay);
00027 
00028 void timer_stop(void);
00029 
00030 #endif  /* _TIMER_H */
 All Data Structures Files Functions Variables Defines