Skip to content
Snippets Groups Projects
Commit 67b57beb authored by Glenn Ruben Bakke's avatar Glenn Ruben Bakke Committed by Damien George
Browse files

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
parent f8ae6b7b
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment