@@ -47,41 +47,13 @@ enum TIM_DIV_ENUM {
47
47
TIM_DIV256 = 3 // 312.5 / 625 Khz (1 tick = 3.2 / 1.6 us - 26843542.4 us max)
48
48
};
49
49
50
-
51
50
//timer int_types
52
51
#define TIM_EDGE 0
53
52
#define TIM_LEVEL 1
54
53
//timer reload values
55
54
#define TIM_SINGLE 0 //on interrupt routine you need to write a new value to start the timer again
56
55
#define TIM_LOOP 1 //on interrupt the counter will start with the same value again
57
56
58
- #define timer1_read() (T1V)
59
- #define timer1_enabled() ((T1C & (1 << TCTE)) != 0)
60
- #define timer1_interrupted() ((T1C & (1 << TCIS)) != 0)
61
-
62
- typedef void(*timercallback)(void);
63
-
64
- void timer1_isr_init(void);
65
- void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload);
66
- void timer1_disable(void);
67
- void timer1_attachInterrupt(timercallback userFunc);
68
- void timer1_detachInterrupt(void);
69
- void timer1_write(uint32_t ticks); //maximum ticks 8388607
70
-
71
- // timer0 is a special CPU timer that has very high resolution but with
72
- // limited control.
73
- // it uses CCOUNT (ESP.GetCycleCount()) as the non-resetable timer counter
74
- // it does not support divide, type, or reload flags
75
- // it is auto-disabled when the compare value matches CCOUNT
76
- // it is auto-enabled when the compare value changes
77
- #define timer0_interrupted() (ETS_INTR_PENDING() & (_BV(ETS_COMPARE0_INUM)))
78
- #define timer0_read() ((__extension__({uint32_t count;__asm__ __volatile__("esync; rsr %0,ccompare0":"=a" (count));count;})))
79
- #define timer0_write(count) __asm__ __volatile__("wsr %0,ccompare0; esync"::"a" (count) : "memory")
80
-
81
- void timer0_isr_init(void);
82
- void timer0_attachInterrupt(timercallback userFunc);
83
- void timer0_detachInterrupt(void);
84
-
85
57
*/
86
58
87
59
// ESP8266 only has one usable timer1, max count is only 8,388,607. So to get longer time, we use max available 256 divider
0 commit comments