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:
parent
f8ae6b7bfc
commit
67b57bebec
|
@ -61,6 +61,11 @@
|
||||||
#include "ble_uart.h"
|
#include "ble_uart.h"
|
||||||
#endif
|
#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) {
|
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);
|
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);
|
||||||
if (lex == NULL) {
|
if (lex == NULL) {
|
||||||
|
@ -206,6 +211,23 @@ pin_init0();
|
||||||
}
|
}
|
||||||
#endif
|
#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 (;;) {
|
for (;;) {
|
||||||
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
|
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
|
||||||
if (pyexec_raw_repl() != 0) {
|
if (pyexec_raw_repl() != 0) {
|
||||||
|
|
Loading…
Reference in New Issue