File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 31
31
#include "common-hal/audiobusio/I2SOut.h"
32
32
#include "shared-bindings/audiobusio/I2SOut.h"
33
33
#include "shared-module/audiocore/__init__.h"
34
+ #include "supervisor/shared/tick.h"
34
35
35
36
#include "py/obj.h"
36
37
#include "py/runtime.h"
@@ -211,6 +212,8 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self,
211
212
NRF_I2S -> CONFIG .ALIGN = I2S_CONFIG_ALIGN_ALIGN_Left ;
212
213
NRF_I2S -> CONFIG .FORMAT = left_justified ? I2S_CONFIG_FORMAT_FORMAT_Aligned
213
214
: I2S_CONFIG_FORMAT_FORMAT_I2S ;
215
+
216
+ supervisor_enable_tick ();
214
217
}
215
218
216
219
bool common_hal_audiobusio_i2sout_deinited (audiobusio_i2sout_obj_t * self ) {
@@ -230,6 +233,7 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) {
230
233
reset_pin_number (self -> data_pin_number );
231
234
self -> data_pin_number = 0xff ;
232
235
instance = NULL ;
236
+ supervisor_disable_tick ();
233
237
}
234
238
235
239
void common_hal_audiobusio_i2sout_play (audiobusio_i2sout_obj_t * self ,
@@ -340,5 +344,8 @@ void i2s_reset(void) {
340
344
NRF_I2S -> PSEL .LRCK = 0xFFFFFFFF ;
341
345
NRF_I2S -> PSEL .SDOUT = 0xFFFFFFFF ;
342
346
NRF_I2S -> PSEL .SDIN = 0xFFFFFFFF ;
347
+ if (instance ) {
348
+ supervisor_disable_tick ();
349
+ }
343
350
instance = NULL ;
344
351
}
Original file line number Diff line number Diff line change 36
36
#include "shared-bindings/audiopwmio/PWMAudioOut.h"
37
37
#include "shared-bindings/microcontroller/__init__.h"
38
38
#include "shared-bindings/microcontroller/Pin.h"
39
+ #include "supervisor/shared/tick.h"
39
40
#include "supervisor/shared/translate.h"
40
41
41
42
// TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that
@@ -67,6 +68,7 @@ STATIC void activate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) {
67
68
for (size_t i = 0 ; i < MP_ARRAY_SIZE (active_audio ); i ++ ) {
68
69
if (!active_audio [i ]) {
69
70
active_audio [i ] = self ;
71
+ supervisor_enable_tick ();
70
72
break ;
71
73
}
72
74
}
@@ -77,12 +79,16 @@ STATIC void deactivate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) {
77
79
for (size_t i = 0 ; i < MP_ARRAY_SIZE (active_audio ); i ++ ) {
78
80
if (active_audio [i ] == self ) {
79
81
active_audio [i ] = NULL ;
82
+ supervisor_disable_tick ();
80
83
}
81
84
}
82
85
}
83
86
84
87
void audiopwmout_reset () {
85
88
for (size_t i = 0 ; i < MP_ARRAY_SIZE (active_audio ); i ++ ) {
89
+ if (active_audio [i ]) {
90
+ supervisor_disable_tick ();
91
+ }
86
92
active_audio [i ] = NULL ;
87
93
}
88
94
}
You can’t perform that action at this time.
0 commit comments