@@ -63,32 +63,25 @@ STATIC void mp_reset(void) {
63
63
pin_init0 ();
64
64
readline_init0 ();
65
65
dupterm_task_init ();
66
- #if MICROPY_MODULE_FROZEN
67
- pyexec_frozen_module ("_boot.py" );
68
- pyexec_file ("boot.py" );
69
- if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL ) {
70
- pyexec_file ("main.py" );
71
- }
72
- #endif
73
66
74
- // Check if there are any dupterm objects registered and if not then
75
- // activate UART(0), or else there will never be any chance to get a REPL
76
- size_t idx ;
77
- for (idx = 0 ; idx < MICROPY_PY_OS_DUPTERM ; ++ idx ) {
78
- if (MP_STATE_VM (dupterm_objs [idx ]) != MP_OBJ_NULL ) {
79
- break ;
80
- }
81
- }
82
- if (idx == MICROPY_PY_OS_DUPTERM ) {
67
+ // Activate UART(0) on dupterm slot 1 for the REPL
68
+ {
83
69
mp_obj_t args [2 ];
84
70
args [0 ] = MP_OBJ_NEW_SMALL_INT (0 );
85
71
args [1 ] = MP_OBJ_NEW_SMALL_INT (115200 );
86
72
args [0 ] = pyb_uart_type .make_new (& pyb_uart_type , 2 , 0 , args );
87
73
args [1 ] = MP_OBJ_NEW_SMALL_INT (1 );
88
74
extern mp_obj_t os_dupterm (size_t n_args , const mp_obj_t * args );
89
75
os_dupterm (2 , args );
90
- mp_hal_stdout_tx_str ("Activated UART(0) for REPL\r\n" );
91
76
}
77
+
78
+ #if MICROPY_MODULE_FROZEN
79
+ pyexec_frozen_module ("_boot.py" );
80
+ pyexec_file ("boot.py" );
81
+ if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL ) {
82
+ pyexec_file ("main.py" );
83
+ }
84
+ #endif
92
85
}
93
86
94
87
void soft_reset (void ) {
0 commit comments