File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,22 @@ loop() ->
6060 loop ()
6161 end .
6262
63+ maybe_start_dev_mode (SystemStatus ) ->
64+ case {SystemStatus , esp :nvs_get_binary (atomvm , dev_mode )} of
65+ {_ , <<" always" >>} ->
66+ start_dev_mode ();
67+ {_ , <<" never" >>} ->
68+ not_started ;
69+ {ok , undefined } ->
70+ not_started ;
71+ {failed_app_start , undefined } ->
72+ start_dev_mode ()
73+ end .
74+
6375start_dev_mode () ->
6476 avm_pubsub :start (default_pubsub ),
65- spawn (fun maybe_start_network /0 ).
77+ spawn (fun maybe_start_network /0 ),
78+ started .
6679
6780% %
6881% % Boot handling
@@ -77,10 +90,11 @@ boot() ->
7790 case atomvm :add_avm_pack_file (BootPath , [{name , app }]) of
7891 ok ->
7992 StartModule = get_start_module (),
93+ maybe_start_dev_mode (ok ),
8094 StartModule :start ();
8195 {error , Reason } ->
8296 io :format (" Failed app start: ~p .~n " , [Reason ]),
83- start_dev_mode ( )
97+ maybe_start_dev_mode ( failed_app_start )
8498 end .
8599
86100get_boot_path () ->
You can’t perform that action at this time.
0 commit comments