2019-01-27 16:23:53 +00:00
|
|
|
//timer02.h
|
|
|
|
// use atmega timer2 as main system timer instead of timer0
|
|
|
|
// timer0 is used for fast pwm (OC0B output)
|
|
|
|
// original OVF handler is disabled
|
|
|
|
#ifndef TIMER02_H
|
|
|
|
#define TIMER02_H
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif //defined(__cplusplus)
|
|
|
|
|
2019-07-08 14:42:21 +00:00
|
|
|
///! Initializes TIMER0 for fast PWM mode-driven bed heating
|
|
|
|
extern void timer0_init(void);
|
2019-01-27 16:23:53 +00:00
|
|
|
|
2019-07-08 14:42:21 +00:00
|
|
|
///! Reimplemented original millis() using timer2
|
2019-01-27 21:48:51 +00:00
|
|
|
extern unsigned long millis2(void);
|
|
|
|
|
2019-07-08 14:42:21 +00:00
|
|
|
///! Reimplemented original micros() using timer2
|
2019-01-27 16:23:53 +00:00
|
|
|
extern unsigned long micros2(void);
|
|
|
|
|
2019-07-08 14:42:21 +00:00
|
|
|
///! Reimplemented original delay() using timer2
|
2019-01-27 16:23:53 +00:00
|
|
|
extern void delay2(unsigned long ms);
|
|
|
|
|
2019-07-08 14:42:21 +00:00
|
|
|
///! Reimplemented original tone() using timer2
|
|
|
|
///! Does not perform any PWM tone generation, it just sets the beeper pin to 1
|
2019-02-05 18:08:57 +00:00
|
|
|
extern void tone2(uint8_t _pin, unsigned int frequency/*, unsigned long duration*/);
|
|
|
|
|
2019-07-08 14:42:21 +00:00
|
|
|
///! Turn off beeping - set beeper pin to 0
|
2019-02-05 18:08:57 +00:00
|
|
|
extern void noTone2(uint8_t _pin);
|
|
|
|
|
2019-01-27 16:23:53 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif //defined(__cplusplus)
|
|
|
|
|
|
|
|
#endif //TIMER02_H
|