File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 3939start () ->
4040 console :print (<<" AtomVM init.\n " >>),
4141
42- avm_pubsub :start (default_pubsub ),
43-
44- spawn (fun maybe_start_network /0 ),
45-
4642 io :format (" Starting application...~n " ),
4743
4844 Exit =
@@ -64,6 +60,10 @@ loop() ->
6460 loop ()
6561 end .
6662
63+ start_dev_mode () ->
64+ avm_pubsub :start (default_pubsub ),
65+ spawn (fun maybe_start_network /0 ).
66+
6767% %
6868% % Boot handling
6969% %
@@ -74,10 +74,14 @@ loop() ->
7474
7575boot () ->
7676 BootPath = get_boot_path (),
77- atomvm :add_avm_pack_file (BootPath , [{name , app }]),
78-
79- StartModule = get_start_module (),
80- StartModule :start ().
77+ case atomvm :add_avm_pack_file (BootPath , [{name , app }]) of
78+ ok ->
79+ StartModule = get_start_module (),
80+ StartModule :start ();
81+ {error , Reason } ->
82+ io :format (" Failed app start: ~p .~n " , [Reason ]),
83+ start_dev_mode ()
84+ end .
8185
8286get_boot_path () ->
8387 case esp :nvs_get_binary (atomvm , boot_path ) of
You can’t perform that action at this time.
0 commit comments