From 8d43c40311708867626120b9d7a57d5cdd8c9aed Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 10 Mar 2016 13:24:14 +0300 Subject: [PATCH] Move some Servo functions into IRAM (#1742) --- libraries/Servo/src/Servo.h | 2 +- libraries/Servo/src/esp8266/Servo.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/Servo/src/Servo.h b/libraries/Servo/src/Servo.h index 10cfd3283..b55fdb8f2 100644 --- a/libraries/Servo/src/Servo.h +++ b/libraries/Servo/src/Servo.h @@ -23,7 +23,7 @@ // The servos are pulsed in the background using the value most recently // written using the write() method. // -// This library uses time0 and timer1. +// This library uses timer0 and timer1. // Note that timer0 may be repurposed when the first servo is attached. // // Timers are seized as needed in groups of 12 servos - 24 servos use two diff --git a/libraries/Servo/src/esp8266/Servo.cpp b/libraries/Servo/src/esp8266/Servo.cpp index 7ca12102d..ef73f94d2 100644 --- a/libraries/Servo/src/esp8266/Servo.cpp +++ b/libraries/Servo/src/esp8266/Servo.cpp @@ -167,6 +167,7 @@ static void initISR(ServoTimerSequence timerId) #endif } +static void finISR(ServoTimerSequence timerId) ICACHE_RAM_ATTR; static void finISR(ServoTimerSequence timerId) { #if !defined (SERVO_EXCLUDE_TIMER0) @@ -180,6 +181,7 @@ static void finISR(ServoTimerSequence timerId) } // returns true if any servo is active on this timer +static boolean isTimerActive(ServoTimerSequence timerId) ICACHE_RAM_ATTR; static boolean isTimerActive(ServoTimerSequence timerId) { for (uint8_t channel = 0; channel < SERVOS_PER_TIMER; channel++) {