@@ -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,7 +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
}
299
- mp_hal_stdout_tx_str ("\x1b[2K\x1b[0G" ); // Clear line of junk text
301
+ mp_hal_stdout_tx_str (line_clear );
300
302
mp_hal_stdout_tx_str (_current_executing_filename );
301
303
serial_write_compressed (MP_ERROR_TEXT (" output:\n" ));
302
304
@@ -410,7 +412,7 @@ STATIC void cleanup_after_vm(mp_obj_t exception) {
410
412
}
411
413
412
414
STATIC void print_code_py_status_message (safe_mode_t safe_mode ) {
413
- mp_hal_stdout_tx_str ("\x1b[2K\x1b[0G" ); // Clear line
415
+ mp_hal_stdout_tx_str (line_clear );
414
416
if (autoreload_is_enabled ()) {
415
417
serial_write_compressed (
416
418
MP_ERROR_TEXT ("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\n" ));
@@ -1006,7 +1008,7 @@ int __attribute__((used)) main(void) {
1006
1008
1007
1009
// Start the debug serial
1008
1010
serial_early_init ();
1009
- mp_hal_stdout_tx_str ("\x1b[2K\x1b[0G" ); // Clear line
1011
+ mp_hal_stdout_tx_str (line_clear );
1010
1012
1011
1013
// Wait briefly to give a reset window where we'll enter safe mode after the reset.
1012
1014
if (get_safe_mode () == SAFE_MODE_NONE ) {
@@ -1058,7 +1060,7 @@ int __attribute__((used)) main(void) {
1058
1060
// displays init after filesystem, since they could share the flash SPI
1059
1061
board_init ();
1060
1062
1061
- mp_hal_stdout_tx_str ("\x1b[2K\x1b[0G" ); // Clear line
1063
+ mp_hal_stdout_tx_str (line_clear );
1062
1064
1063
1065
// This is first time we are running CircuitPython after a reset or power-up.
1064
1066
supervisor_set_run_reason (RUN_REASON_STARTUP );
0 commit comments