mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-26 07:02:15 +03:00
@ -101,13 +101,29 @@ void yield(void);
|
||||
#define timer1_enabled() ((T1C & (1 << TCTE)) != 0)
|
||||
#define timer1_interrupted() ((T1C & (1 << TCIS)) != 0)
|
||||
|
||||
typedef void(*timercallback)(void);
|
||||
|
||||
void timer1_isr_init(void);
|
||||
void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload);
|
||||
void timer1_disable(void);
|
||||
void timer1_attachInterrupt(void (*userFunc)(void));
|
||||
void timer1_attachInterrupt(timercallback userFunc);
|
||||
void timer1_detachInterrupt(void);
|
||||
void timer1_write(uint32_t ticks); //maximum ticks 8388607
|
||||
|
||||
// timer0 is a special CPU timer that has very high resolution but with
|
||||
// limited control.
|
||||
// it uses CCOUNT (ESP.GetCycleCount()) as the non-resetable timer counter
|
||||
// it does not support divide, type, or reload flags
|
||||
// it is auto-disabled when the compare value matches CCOUNT
|
||||
// it is auto-enabled when the compare value changes
|
||||
#define timer0_interrupted() (ETS_INTR_PENDING() & (_BV(ETS_COMPARE0_INUM)))
|
||||
#define timer0_read() ((__extension__({uint32_t count;__asm__ __volatile__("esync; rsr %0,ccompare0":"=a" (count));count;})))
|
||||
#define timer0_write(count) __asm__ __volatile__("wsr %0,ccompare0; esync"::"a" (count) : "memory")
|
||||
|
||||
void timer0_isr_init(void);
|
||||
void timer0_attachInterrupt(timercallback userFunc);
|
||||
void timer0_detachInterrupt(void);
|
||||
|
||||
// undefine stdlib's abs if encountered
|
||||
#ifdef abs
|
||||
#undef abs
|
||||
|
Reference in New Issue
Block a user