Skip to content

Commit

Permalink
move timer functions to iram (#6466)
Browse files Browse the repository at this point in the history
  • Loading branch information
luffykesh authored and devyte committed Sep 2, 2019
1 parent 0399bb1 commit 07d8128
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cores/esp8266/core_esp8266_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ICACHE_RAM_ATTR timer1_isr_init(){
ETS_FRC_TIMER1_INTR_ATTACH(timer1_isr_handler, NULL);
}

void timer1_attachInterrupt(timercallback userFunc) {
void ICACHE_RAM_ATTR timer1_attachInterrupt(timercallback userFunc) {
timer1_user_cb = userFunc;
ETS_FRC1_INTR_ENABLE();
}
Expand All @@ -59,7 +59,7 @@ void ICACHE_RAM_ATTR timer1_detachInterrupt() {
ETS_FRC1_INTR_DISABLE();
}

void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){
void ICACHE_RAM_ATTR timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){
T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
T1I = 0;
}
Expand Down Expand Up @@ -90,11 +90,11 @@ void ICACHE_RAM_ATTR timer0_isr_handler(void* para){
}
}

void timer0_isr_init(){
void ICACHE_RAM_ATTR timer0_isr_init(){
ETS_CCOMPARE0_INTR_ATTACH(timer0_isr_handler, NULL);
}

void timer0_attachInterrupt(timercallback userFunc) {
void ICACHE_RAM_ATTR timer0_attachInterrupt(timercallback userFunc) {
timer0_user_cb = userFunc;
ETS_CCOMPARE0_ENABLE();
}
Expand Down

0 comments on commit 07d8128

Please sign in to comment.