@@ -226,7 +226,7 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self,
226
226
}
227
227
228
228
void common_hal_audiomp3_mp3file_set_file (audiomp3_mp3file_obj_t * self , pyb_file_obj_t * file ) {
229
- background_callback_begin_critical_section ();
229
+ background_callback_prevent ();
230
230
231
231
self -> file = file ;
232
232
f_lseek (& self -> file -> fp , 0 );
@@ -244,7 +244,7 @@ void common_hal_audiomp3_mp3file_set_file(audiomp3_mp3file_obj_t *self, pyb_file
244
244
memset (self -> buffers [1 ], 0 , MAX_BUFFER_LEN );
245
245
MP3FrameInfo fi ;
246
246
bool result = mp3file_get_next_frame_info (self , & fi );
247
- background_callback_end_critical_section ();
247
+ background_callback_allow ();
248
248
if (!result ) {
249
249
mp_raise_msg (& mp_type_RuntimeError ,
250
250
MP_ERROR_TEXT ("Failed to parse MP3 file" ));
@@ -296,7 +296,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t *self,
296
296
}
297
297
// We don't reset the buffer index in case we're looping and we have an odd number of buffer
298
298
// loads
299
- background_callback_begin_critical_section ();
299
+ background_callback_prevent ();
300
300
f_lseek (& self -> file -> fp , 0 );
301
301
self -> inbuf_offset = self -> inbuf_length ;
302
302
self -> eof = 0 ;
@@ -305,7 +305,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t *self,
305
305
mp3file_update_inbuf_half (self );
306
306
mp3file_skip_id3v2 (self );
307
307
mp3file_find_sync_word (self );
308
- background_callback_end_critical_section ();
308
+ background_callback_allow ();
309
309
}
310
310
311
311
audioio_get_buffer_result_t audiomp3_mp3file_get_buffer (audiomp3_mp3file_obj_t * self ,
0 commit comments