57
57
#include "supervisor/shared/stack.h"
58
58
#include "supervisor/shared/status_leds.h"
59
59
#include "supervisor/shared/tick.h"
60
- #include "supervisor/shared/title_bar.h"
61
60
#include "supervisor/shared/traceback.h"
62
61
#include "supervisor/shared/translate/translate.h"
63
62
#include "supervisor/shared/workflow.h"
106
105
#include "shared-bindings/socketpool/__init__.h"
107
106
#endif
108
107
108
+ #if CIRCUITPY_STATUS_BAR
109
+ #include "supervisor/shared/status_bar.h"
110
+ #endif
111
+
109
112
#if CIRCUITPY_USB_HID
110
113
#include "shared-module/usb_hid/__init__.h"
111
114
#endif
@@ -208,6 +211,7 @@ STATIC const char *_current_executing_filename = NULL;
208
211
209
212
STATIC pyexec_result_t _exec_result = {0 , MP_OBJ_NULL , 0 };
210
213
214
+ #if CIRCUITPY_STATUS_BAR
211
215
void supervisor_execution_status (void ) {
212
216
mp_obj_exception_t * exception = MP_OBJ_TO_PTR (_exec_result .exception );
213
217
if (_current_executing_filename != NULL ) {
@@ -220,6 +224,7 @@ void supervisor_execution_status(void) {
220
224
serial_write_compressed (translate ("Done" ));
221
225
}
222
226
}
227
+ #endif
223
228
224
229
#define STRING_LIST (...) {__VA_ARGS__, ""}
225
230
@@ -245,13 +250,23 @@ STATIC bool maybe_run_list(const char *const *filenames) {
245
250
}
246
251
mp_hal_stdout_tx_str (_current_executing_filename );
247
252
serial_write_compressed (translate (" output:\n" ));
248
- supervisor_title_bar_update ();
253
+
254
+ #if CIRCUITPY_STATUS_BAR
255
+ supervisor_status_bar_update ();
256
+ #endif
257
+
249
258
pyexec_file (_current_executing_filename , & _exec_result );
259
+
250
260
#if CIRCUITPY_ATEXIT
251
261
shared_module_atexit_execute (& _exec_result );
252
262
#endif
263
+
253
264
_current_executing_filename = NULL ;
254
- supervisor_title_bar_update ();
265
+
266
+ #if CIRCUITPY_STATUS_BAR
267
+ supervisor_status_bar_update ();
268
+ #endif
269
+
255
270
return true;
256
271
}
257
272
@@ -443,6 +458,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re
443
458
444
459
// Finished executing python code. Cleanup includes filesystem flush and a board reset.
445
460
cleanup_after_vm (heap , _exec_result .exception );
461
+ _exec_result .exception = NULL ;
446
462
447
463
// If a new next code file was set, that is a reason to keep it (obviously). Stuff this into
448
464
// the options because it can be treated like any other reason-for-stickiness bit. The
@@ -749,8 +765,10 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
749
765
750
766
if (ok_to_run ) {
751
767
#ifdef CIRCUITPY_BOOT_OUTPUT_FILE
752
- // Turn off title bar updates when writing out to boot_out.txt.
753
- supervisor_title_bar_suspend ();
768
+ #if CIRCUITPY_STATUS_BAR
769
+ // Turn off status bar updates when writing out to boot_out.txt.
770
+ supervisor_status_bar_suspend ();
771
+ #endif
754
772
vstr_t boot_text ;
755
773
vstr_init (& boot_text , 512 );
756
774
boot_output = & boot_text ;
@@ -778,7 +796,9 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
778
796
FATFS * fs = & vfs -> fatfs ;
779
797
780
798
boot_output = NULL ;
781
- supervisor_title_bar_resume ();
799
+ #if CIRCUITPY_STATUS_BAR
800
+ supervisor_status_bar_resume ();
801
+ #endif
782
802
bool write_boot_output = true;
783
803
FIL boot_output_file ;
784
804
if (f_open (fs , & boot_output_file , CIRCUITPY_BOOT_OUTPUT_FILE , FA_READ ) == FR_OK ) {
@@ -822,6 +842,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
822
842
port_post_boot_py (true);
823
843
824
844
cleanup_after_vm (heap , _exec_result .exception );
845
+ _exec_result .exception = NULL ;
825
846
826
847
port_post_boot_py (false);
827
848
@@ -854,15 +875,23 @@ STATIC int run_repl(bool first_run) {
854
875
status_led_deinit ();
855
876
#endif
856
877
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL ) {
857
- supervisor_title_bar_suspend ();
878
+ #if CIRCUITPY_STATUS_BAR
879
+ supervisor_status_bar_suspend ();
880
+ #endif
858
881
exit_code = pyexec_raw_repl ();
859
- supervisor_title_bar_resume ();
882
+ #if CIRCUITPY_STATUS_BAR
883
+ supervisor_status_bar_resume ();
884
+ #endif
860
885
} else {
861
886
_current_executing_filename = "REPL" ;
862
- supervisor_title_bar_update ();
887
+ #if CIRCUITPY_STATUS_BAR
888
+ supervisor_status_bar_update ();
889
+ #endif
863
890
exit_code = pyexec_friendly_repl ();
864
891
_current_executing_filename = NULL ;
865
- supervisor_title_bar_update ();
892
+ #if CIRCUITPY_STATUS_BAR
893
+ supervisor_status_bar_update ();
894
+ #endif
866
895
}
867
896
#if CIRCUITPY_ATEXIT
868
897
pyexec_result_t result ;
@@ -910,6 +939,10 @@ int __attribute__((used)) main(void) {
910
939
911
940
stack_init ();
912
941
942
+ #if CIRCUITPY_STATUS_BAR
943
+ supervisor_status_bar_init ();
944
+ #endif
945
+
913
946
#if CIRCUITPY_BLEIO
914
947
// Early init so that a reset press can cause BLE public advertising.
915
948
supervisor_bluetooth_init ();
@@ -959,7 +992,10 @@ int __attribute__((used)) main(void) {
959
992
run_boot_py (safe_mode );
960
993
961
994
supervisor_workflow_start ();
962
- supervisor_title_bar_start ();
995
+
996
+ #if CIRCUITPY_STATUS_BAR
997
+ supervisor_status_bar_request_update (true);
998
+ #endif
963
999
964
1000
// Boot script is finished, so now go into REPL or run code.py.
965
1001
int exit_code = PYEXEC_FORCED_EXIT ;
0 commit comments