From f8ae6b7bfcc069a5c4272c4be2290dfd76136d67 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sat, 25 Nov 2017 01:07:13 +0100 Subject: [PATCH] nrf/modules/music: Remove init of softpwm/ticker upon music module load. Also update microbit_music_init0 to register low priority ticker callback for the music module. --- ports/nrf/modules/music/modmusic.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ports/nrf/modules/music/modmusic.c b/ports/nrf/modules/music/modmusic.c index c2afc341cb..3aaf3960c0 100644 --- a/ports/nrf/modules/music/modmusic.c +++ b/ports/nrf/modules/music/modmusic.c @@ -77,10 +77,7 @@ extern volatile uint32_t ticks; STATIC uint32_t start_note(const char *note_str, size_t note_len, const pin_obj_t *pin); void microbit_music_init0(void) { - softpwm_init(); - ticker_init(microbit_music_tick); - ticker_start(); - pwm_start(); + ticker_register_low_pri_callback(microbit_music_tick); } void microbit_music_tick(void) { @@ -460,8 +457,6 @@ MP_DEFINE_CONST_FUN_OBJ_KW(microbit_music_set_tempo_obj, 0, microbit_music_set_t static mp_obj_t music_init(void) { - microbit_music_init0(); - music_data = m_new_obj(music_data_t); music_data->bpm = DEFAULT_BPM; music_data->ticks = DEFAULT_TICKS;