@@ -94,7 +94,7 @@ static WVFState wvfState;
9494#pragma GCC optimize ("Os")
9595
9696// Interrupt on/off control
97- static IRAM_ATTR void timer1Interrupt ();
97+ static void timer1Interrupt ();
9898static bool timerRunning = false ;
9999
100100static __attribute__ ((noinline)) void initTimer() {
@@ -108,7 +108,7 @@ static __attribute__((noinline)) void initTimer() {
108108 }
109109}
110110
111- static IRAM_ATTR void forceTimerInterrupt () {
111+ static void IRAM_ATTR forceTimerInterrupt () {
112112 if (T1L > microsecondsToClockCycles (10 )) {
113113 T1L = microsecondsToClockCycles (10 );
114114 }
@@ -145,7 +145,7 @@ static uint32_t _pwmPeriod = microsecondsToClockCycles(1000000UL) / _pwmFreq;
145145
146146// If there are no more scheduled activities, shut down Timer 1.
147147// Otherwise, do nothing.
148- static IRAM_ATTR void disableIdleTimer () {
148+ static void IRAM_ATTR disableIdleTimer () {
149149 if (timerRunning && !wvfState.waveformEnabled && !pwmState.cnt && !wvfState.timer1CB ) {
150150 ETS_FRC_TIMER1_NMI_INTR_ATTACH (NULL );
151151 timer1_disable ();
@@ -156,7 +156,7 @@ static IRAM_ATTR void disableIdleTimer() {
156156
157157// Notify the NMI that a new PWM state is available through the mailbox.
158158// Wait for mailbox to be emptied (either busy or delay() as needed)
159- static IRAM_ATTR void _notifyPWM (PWMState *p, bool idle) {
159+ static void IRAM_ATTR _notifyPWM (PWMState *p, bool idle) {
160160 p->pwmUpdate = nullptr ;
161161 pwmState.pwmUpdate = p;
162162 MEMBARRIER ();
@@ -238,7 +238,7 @@ static void _cleanAndRemovePWM(PWMState *p, int pin) {
238238
239239// Disable PWM on a specific pin (i.e. when a digitalWrite or analogWrite(0%/100%))
240240extern bool _stopPWM_weak (uint8_t pin) __attribute__((weak));
241- IRAM_ATTR bool _stopPWM_weak (uint8_t pin) {
241+ bool IRAM_ATTR _stopPWM_weak (uint8_t pin) {
242242 if (!((1 <<pin) & pwmState.mask )) {
243243 return false ; // Pin not actually active
244244 }
@@ -261,7 +261,7 @@ IRAM_ATTR bool _stopPWM_weak(uint8_t pin) {
261261 return true ;
262262}
263263static bool _stopPWM_bound (uint8_t pin) __attribute__((weakref(" _stopPWM_weak" )));
264- IRAM_ATTR bool _stopPWM (uint8_t pin) {
264+ bool IRAM_ATTR _stopPWM (uint8_t pin) {
265265 return _stopPWM_bound (pin);
266266}
267267
@@ -431,7 +431,7 @@ void setTimer1Callback(uint32_t (*fn)()) {
431431
432432// Stops a waveform on a pin
433433extern int stopWaveform_weak (uint8_t pin) __attribute__((weak));
434- IRAM_ATTR int stopWaveform_weak (uint8_t pin) {
434+ int IRAM_ATTR stopWaveform_weak (uint8_t pin) {
435435 // Can't possibly need to stop anything if there is no timer active
436436 if (!timerRunning) {
437437 return false ;
@@ -455,7 +455,7 @@ IRAM_ATTR int stopWaveform_weak(uint8_t pin) {
455455 return true ;
456456}
457457static int stopWaveform_bound (uint8_t pin) __attribute__((weakref(" stopWaveform_weak" )));
458- IRAM_ATTR int stopWaveform (uint8_t pin) {
458+ int IRAM_ATTR stopWaveform (uint8_t pin) {
459459 return stopWaveform_bound (pin);
460460}
461461
@@ -465,14 +465,14 @@ IRAM_ATTR int stopWaveform(uint8_t pin) {
465465// Normally would not want two copies like this, but due to different
466466// optimization levels the inline attribute gets lost if we try the
467467// other version.
468- static inline IRAM_ATTR uint32_t GetCycleCountIRQ () {
468+ static inline uint32_t IRAM_ATTR GetCycleCountIRQ () {
469469 uint32_t ccount;
470470 __asm__ __volatile__ (" rsr %0,ccount" :" =a" (ccount));
471471 return ccount;
472472}
473473
474474// Find the earliest cycle as compared to right now
475- static inline IRAM_ATTR uint32_t earliest (uint32_t a, uint32_t b) {
475+ static inline uint32_t IRAM_ATTR earliest (uint32_t a, uint32_t b) {
476476 uint32_t now = GetCycleCountIRQ ();
477477 int32_t da = a - now;
478478 int32_t db = b - now;
@@ -497,7 +497,7 @@ static inline IRAM_ATTR uint32_t earliest(uint32_t a, uint32_t b) {
497497// When the time to the next edge is greater than this, RTI and set another IRQ to minimize CPU usage
498498#define MINIRQTIME microsecondsToClockCycles (4 )
499499
500- static IRAM_ATTR void timer1Interrupt() {
500+ static void IRAM_ATTR timer1Interrupt() {
501501 // Flag if the core is at 160 MHz, for use by adjust()
502502 bool turbo = (*(uint32_t *)0x3FF00014 ) & 1 ? true : false ;
503503
0 commit comments