@@ -140,6 +140,8 @@ static void reset_devices(void) {
140
140
STATIC uint8_t * _heap ;
141
141
STATIC uint8_t * _pystack ;
142
142
143
+ STATIC const char line_clear [] = "\x1b[2K\x1b[0G" ;
144
+
143
145
#if MICROPY_ENABLE_PYSTACK || MICROPY_ENABLE_GC
144
146
STATIC uint8_t * _allocate_memory (safe_mode_t safe_mode , const char * env_key , size_t default_size , size_t * final_size ) {
145
147
* final_size = default_size ;
@@ -296,6 +298,7 @@ STATIC bool maybe_run_list(const char *const *filenames, size_t n_filenames) {
296
298
if (_current_executing_filename == NULL ) {
297
299
return false;
298
300
}
301
+ mp_hal_stdout_tx_str (line_clear );
299
302
mp_hal_stdout_tx_str (_current_executing_filename );
300
303
serial_write_compressed (MP_ERROR_TEXT (" output:\n" ));
301
304
@@ -409,6 +412,7 @@ STATIC void cleanup_after_vm(mp_obj_t exception) {
409
412
}
410
413
411
414
STATIC void print_code_py_status_message (safe_mode_t safe_mode ) {
415
+ mp_hal_stdout_tx_str (line_clear );
412
416
if (autoreload_is_enabled ()) {
413
417
serial_write_compressed (
414
418
MP_ERROR_TEXT ("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n" ));
@@ -1004,6 +1008,7 @@ int __attribute__((used)) main(void) {
1004
1008
1005
1009
// Start the debug serial
1006
1010
serial_early_init ();
1011
+ mp_hal_stdout_tx_str (line_clear );
1007
1012
1008
1013
// Wait briefly to give a reset window where we'll enter safe mode after the reset.
1009
1014
if (get_safe_mode () == SAFE_MODE_NONE ) {
@@ -1055,6 +1060,8 @@ int __attribute__((used)) main(void) {
1055
1060
// displays init after filesystem, since they could share the flash SPI
1056
1061
board_init ();
1057
1062
1063
+ mp_hal_stdout_tx_str (line_clear );
1064
+
1058
1065
// This is first time we are running CircuitPython after a reset or power-up.
1059
1066
supervisor_set_run_reason (RUN_REASON_STARTUP );
1060
1067
0 commit comments