From a84ed760b527ddb7214454e4cb8feb69796cc7f2 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Mon, 8 May 2017 22:03:33 +0200 Subject: [PATCH] nrf5/modules/music: Including mphal.h before config guard in modmusic.c. Also changed name on config guard to MICROPY_PY_MUSIC. Missing PWM functions during linkage will show up if PWM module has not not configured. --- nrf5/modules/music/modmusic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nrf5/modules/music/modmusic.c b/nrf5/modules/music/modmusic.c index fb73b6e7a7..31e2bd2100 100644 --- a/nrf5/modules/music/modmusic.c +++ b/nrf5/modules/music/modmusic.c @@ -24,14 +24,15 @@ * THE SOFTWARE. */ -#if MICROPY_PY_MACHINE_SOFT_PWM || MICROPY_PY_MACHINE_HW_PWM +#include "py/mphal.h" + +#if MICROPY_PY_MUSIC // #include "microbitobj.h" // #include "microbitmusic.h" #include "py/obj.h" #include "py/runtime.h" #include "py/objstr.h" -#include "py/mphal.h" #include "modmusic.h" #include "musictunes.h" #include "drivers/pwm.h" @@ -495,4 +496,4 @@ const mp_obj_module_t music_module = { .globals = (mp_obj_dict_t*)µbit_music_locals_dict, }; -#endif // MICROPY_PY_MACHINE_SOFT_PWM || MICROPY_PY_MACHINE_HW_PWM +#endif // MICROPY_PY_MUSIC