@@ -94,7 +94,7 @@ static WVFState wvfState;
94
94
#pragma GCC optimize ("Os")
95
95
96
96
// Interrupt on/off control
97
- static IRAM_ATTR void timer1Interrupt ();
97
+ static void timer1Interrupt ();
98
98
static bool timerRunning = false ;
99
99
100
100
static __attribute__ ((noinline)) void initTimer() {
@@ -108,7 +108,7 @@ static __attribute__((noinline)) void initTimer() {
108
108
}
109
109
}
110
110
111
- static IRAM_ATTR void forceTimerInterrupt () {
111
+ static void IRAM_ATTR forceTimerInterrupt () {
112
112
if (T1L > microsecondsToClockCycles (10 )) {
113
113
T1L = microsecondsToClockCycles (10 );
114
114
}
@@ -145,7 +145,7 @@ static uint32_t _pwmPeriod = microsecondsToClockCycles(1000000UL) / _pwmFreq;
145
145
146
146
// If there are no more scheduled activities, shut down Timer 1.
147
147
// Otherwise, do nothing.
148
- static IRAM_ATTR void disableIdleTimer () {
148
+ static void IRAM_ATTR disableIdleTimer () {
149
149
if (timerRunning && !wvfState.waveformEnabled && !pwmState.cnt && !wvfState.timer1CB ) {
150
150
ETS_FRC_TIMER1_NMI_INTR_ATTACH (NULL );
151
151
timer1_disable ();
@@ -156,7 +156,7 @@ static IRAM_ATTR void disableIdleTimer() {
156
156
157
157
// Notify the NMI that a new PWM state is available through the mailbox.
158
158
// 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) {
160
160
p->pwmUpdate = nullptr ;
161
161
pwmState.pwmUpdate = p;
162
162
MEMBARRIER ();
@@ -238,7 +238,7 @@ static void _cleanAndRemovePWM(PWMState *p, int pin) {
238
238
239
239
// Disable PWM on a specific pin (i.e. when a digitalWrite or analogWrite(0%/100%))
240
240
extern 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) {
242
242
if (!((1 <<pin) & pwmState.mask )) {
243
243
return false ; // Pin not actually active
244
244
}
@@ -261,7 +261,7 @@ IRAM_ATTR bool _stopPWM_weak(uint8_t pin) {
261
261
return true ;
262
262
}
263
263
static 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) {
265
265
return _stopPWM_bound (pin);
266
266
}
267
267
@@ -431,7 +431,7 @@ void setTimer1Callback(uint32_t (*fn)()) {
431
431
432
432
// Stops a waveform on a pin
433
433
extern 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) {
435
435
// Can't possibly need to stop anything if there is no timer active
436
436
if (!timerRunning) {
437
437
return false ;
@@ -455,7 +455,7 @@ IRAM_ATTR int stopWaveform_weak(uint8_t pin) {
455
455
return true ;
456
456
}
457
457
static 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) {
459
459
return stopWaveform_bound (pin);
460
460
}
461
461
@@ -465,14 +465,14 @@ IRAM_ATTR int stopWaveform(uint8_t pin) {
465
465
// Normally would not want two copies like this, but due to different
466
466
// optimization levels the inline attribute gets lost if we try the
467
467
// other version.
468
- static inline IRAM_ATTR uint32_t GetCycleCountIRQ () {
468
+ static inline uint32_t IRAM_ATTR GetCycleCountIRQ () {
469
469
uint32_t ccount;
470
470
__asm__ __volatile__ (" rsr %0,ccount" :" =a" (ccount));
471
471
return ccount;
472
472
}
473
473
474
474
// 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) {
476
476
uint32_t now = GetCycleCountIRQ ();
477
477
int32_t da = a - now;
478
478
int32_t db = b - now;
@@ -497,7 +497,7 @@ static inline IRAM_ATTR uint32_t earliest(uint32_t a, uint32_t b) {
497
497
// When the time to the next edge is greater than this, RTI and set another IRQ to minimize CPU usage
498
498
#define MINIRQTIME microsecondsToClockCycles (4 )
499
499
500
- static IRAM_ATTR void timer1Interrupt() {
500
+ static void IRAM_ATTR timer1Interrupt() {
501
501
// Flag if the core is at 160 MHz, for use by adjust()
502
502
bool turbo = (*(uint32_t *)0x3FF00014 ) & 1 ? true : false ;
503
503
0 commit comments