Skip to content

Commit 07d8128

Browse files
luffykeshdevyte
authored andcommitted
move timer functions to iram (#6466)
1 parent 0399bb1 commit 07d8128

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: cores/esp8266/core_esp8266_timer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void ICACHE_RAM_ATTR timer1_isr_init(){
4848
ETS_FRC_TIMER1_INTR_ATTACH(timer1_isr_handler, NULL);
4949
}
5050

51-
void timer1_attachInterrupt(timercallback userFunc) {
51+
void ICACHE_RAM_ATTR timer1_attachInterrupt(timercallback userFunc) {
5252
timer1_user_cb = userFunc;
5353
ETS_FRC1_INTR_ENABLE();
5454
}
@@ -59,7 +59,7 @@ void ICACHE_RAM_ATTR timer1_detachInterrupt() {
5959
ETS_FRC1_INTR_DISABLE();
6060
}
6161

62-
void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){
62+
void ICACHE_RAM_ATTR timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){
6363
T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
6464
T1I = 0;
6565
}
@@ -90,11 +90,11 @@ void ICACHE_RAM_ATTR timer0_isr_handler(void* para){
9090
}
9191
}
9292

93-
void timer0_isr_init(){
93+
void ICACHE_RAM_ATTR timer0_isr_init(){
9494
ETS_CCOMPARE0_INTR_ATTACH(timer0_isr_handler, NULL);
9595
}
9696

97-
void timer0_attachInterrupt(timercallback userFunc) {
97+
void ICACHE_RAM_ATTR timer0_attachInterrupt(timercallback userFunc) {
9898
timer0_user_cb = userFunc;
9999
ETS_CCOMPARE0_ENABLE();
100100
}

0 commit comments

Comments
 (0)