@@ -14,6 +14,7 @@ class PWMDriverESP32;
14
14
*/
15
15
using PWMDriver = PWMDriverESP32;
16
16
static PWMDriverESP32 *accessAudioPWM = nullptr ;
17
+ void IRAM_ATTR defaultPWMAudioOutputCallback ();
17
18
18
19
19
20
/* *
@@ -36,8 +37,8 @@ typedef PinInfoESP32 PinInfo;
36
37
*/
37
38
38
39
class PWMDriverESP32 : public DriverPWMBase {
39
- friend void defaultPWMAudioOutputCallback ();
40
40
public:
41
+ friend void defaultPWMAudioOutputCallback ();
41
42
42
43
PWMDriverESP32 (){
43
44
TRACED ();
@@ -103,7 +104,7 @@ class PWMDriverESP32 : public DriverPWMBase {
103
104
LOGI (" -> timer counter is %zu" , counter);
104
105
LOGD (" -> timerAttachInterrupt" );
105
106
bool interrupt_edge_type = true ;
106
- timerAttachInterrupt (timer, & defaultPWMAudioOutputCallback, interrupt_edge_type);
107
+ timerAttachInterrupt (timer, defaultPWMAudioOutputCallback, interrupt_edge_type);
107
108
LOGD (" -> timerAlarmWrite" );
108
109
bool auto_reload = true ;
109
110
timerAlarmWrite (timer, counter, auto_reload); // Timer fires at ~44100Hz [40Mhz / 907]
@@ -146,16 +147,16 @@ class PWMDriverESP32 : public DriverPWMBase {
146
147
147
148
148
149
};
149
-
150
- // / timer callback: write the next frame to the pins
151
- inline void IRAM_ATTR defaultPWMAudioOutputCallback () {
150
+ // / timer callback: write the next frame to the pins
151
+ void IRAM_ATTR defaultPWMAudioOutputCallback () {
152
152
if (accessAudioPWM!=nullptr ){
153
153
portENTER_CRITICAL_ISR (&(accessAudioPWM->timerMux ));
154
154
accessAudioPWM->playNextFrame ();
155
155
portEXIT_CRITICAL_ISR (&(accessAudioPWM->timerMux ));
156
156
}
157
157
}
158
158
159
+
159
160
}
160
161
161
162
#endif
0 commit comments