1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Move timer ISR handlers and PWM handler into RAM (fix #819)

This commit is contained in:
Ivan Grokhotkov 2015-10-06 13:26:21 +03:00
parent 0873ae22d3
commit 0c703b3baf
2 changed files with 9 additions and 12 deletions

View File

@ -29,7 +29,7 @@
static volatile timercallback timer1_user_cb = NULL; static volatile timercallback timer1_user_cb = NULL;
void timer1_isr_handler(void *para){ void ICACHE_RAM_ATTR timer1_isr_handler(void *para){
if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
T1I = 0; T1I = 0;
if (timer1_user_cb) { if (timer1_user_cb) {
@ -61,7 +61,7 @@ void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){
T1I = 0; T1I = 0;
} }
void timer1_write(uint32_t ticks){ void ICACHE_RAM_ATTR timer1_write(uint32_t ticks){
T1L = ((ticks)& 0x7FFFFF); T1L = ((ticks)& 0x7FFFFF);
if ((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable if ((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable
} }
@ -76,7 +76,7 @@ void timer1_disable(){
static volatile timercallback timer0_user_cb = NULL; static volatile timercallback timer0_user_cb = NULL;
void timer0_isr_handler(void* para){ void ICACHE_RAM_ATTR timer0_isr_handler(void* para){
if (timer0_user_cb) { if (timer0_user_cb) {
// to make ISR compatible to Arduino AVR model where interrupts are disabled // to make ISR compatible to Arduino AVR model where interrupts are disabled
// we disable them before we call the client ISR // we disable them before we call the client ISR
@ -99,6 +99,3 @@ void timer0_detachInterrupt() {
timer0_user_cb = NULL; timer0_user_cb = NULL;
ETS_CCOMPARE0_DISABLE(); ETS_CCOMPARE0_DISABLE();
} }

View File

@ -88,7 +88,7 @@ void prep_pwm_steps(){
ETS_FRC1_INTR_ENABLE(); ETS_FRC1_INTR_ENABLE();
} }
void pwm_timer_isr(){ void ICACHE_RAM_ATTR pwm_timer_isr(){
static uint8_t current_step = 0; static uint8_t current_step = 0;
static uint8_t stepcount = 0; static uint8_t stepcount = 0;
static uint16_t steps[17]; static uint16_t steps[17];