timer02.h 813 B

123456789101112131415161718192021222324252627282930313233
  1. //timer02.h
  2. // use atmega timer2 as main system timer instead of timer0
  3. // timer0 is used for fast pwm (OC0B output)
  4. // original OVF handler is disabled
  5. #ifndef TIMER02_H
  6. #define TIMER02_H
  7. #include <inttypes.h>
  8. #if defined(__cplusplus)
  9. extern "C" {
  10. #endif //defined(__cplusplus)
  11. ///! Initializes TIMER0 for fast PWM mode-driven bed heating
  12. extern void timer0_init(void);
  13. ///! Initializes TIMER2 for time keeping and temperature interrupt
  14. extern void timer2_init(void);
  15. ///! Reimplemented original millis() using timer2
  16. extern unsigned long millis2(void);
  17. ///! Reimplemented original micros() using timer2
  18. extern unsigned long micros2(void);
  19. ///! Reimplemented original delay() using timer2
  20. extern void delay2(unsigned long ms);
  21. #if defined(__cplusplus)
  22. }
  23. #endif //defined(__cplusplus)
  24. #endif //TIMER02_H