Skip to content

Commit a84ed76

Browse files
committed
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.
1 parent 24e902a commit a84ed76

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nrf5/modules/music/modmusic.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#if MICROPY_PY_MACHINE_SOFT_PWM || MICROPY_PY_MACHINE_HW_PWM
27+
#include "py/mphal.h"
28+
29+
#if MICROPY_PY_MUSIC
2830

2931
// #include "microbitobj.h"
3032
// #include "microbitmusic.h"
3133
#include "py/obj.h"
3234
#include "py/runtime.h"
3335
#include "py/objstr.h"
34-
#include "py/mphal.h"
3536
#include "modmusic.h"
3637
#include "musictunes.h"
3738
#include "drivers/pwm.h"
@@ -495,4 +496,4 @@ const mp_obj_module_t music_module = {
495496
.globals = (mp_obj_dict_t*)&microbit_music_locals_dict,
496497
};
497498

498-
#endif // MICROPY_PY_MACHINE_SOFT_PWM || MICROPY_PY_MACHINE_HW_PWM
499+
#endif // MICROPY_PY_MUSIC

0 commit comments

Comments
 (0)