nrf: Update main.c to init relevant board drivers, if enabled.

If the board has these drivers then they will be initialized:
- softpwm (implicit ticker)
- music module
- board specific module
This commit is contained in:
Glenn Ruben Bakke 2017-11-25 01:09:18 +01:00 committed by Damien George
parent f8ae6b7bfc
commit 67b57bebec
1 changed files with 22 additions and 0 deletions

View File

@ -61,6 +61,11 @@
#include "ble_uart.h"
#endif
#if MICROPY_PY_MACHINE_SOFT_PWM
#include "ticker.h"
#include "softpwm.h"
#endif
void do_str(const char *src, mp_parse_input_kind_t input_kind) {
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);
if (lex == NULL) {
@ -206,6 +211,23 @@ pin_init0();
}
#endif
#if MICROPY_PY_MACHINE_SOFT_PWM
ticker_init0();
softpwm_init0();
#endif
#if MICROPY_PY_MUSIC
microbit_music_init0();
#endif
#if BOARD_SPECIFIC_MODULES
board_modules_init0();
#endif
#if MICROPY_PY_MACHINE_SOFT_PWM
ticker_start();
pwm_start();
#endif
for (;;) {
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
if (pyexec_raw_repl() != 0) {