|
@@ -15,6 +15,13 @@ import serial.tools.list_ports as list_ports
|
|
|
class Main(App):
|
|
class Main(App):
|
|
|
def init(self):
|
|
def init(self):
|
|
|
self.parser.add_argument("-p", "--port", help="CDC Port", default="auto")
|
|
self.parser.add_argument("-p", "--port", help="CDC Port", default="auto")
|
|
|
|
|
+ self.parser.add_argument(
|
|
|
|
|
+ "-n",
|
|
|
|
|
+ "--no-launch",
|
|
|
|
|
+ dest="launch_app",
|
|
|
|
|
+ action="store_false",
|
|
|
|
|
+ help="Don't launch app",
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
self.parser.add_argument("fap_src_path", help="App file to upload")
|
|
self.parser.add_argument("fap_src_path", help="App file to upload")
|
|
|
self.parser.add_argument(
|
|
self.parser.add_argument(
|
|
@@ -84,11 +91,14 @@ class Main(App):
|
|
|
self.logger.error(f"Error: upload failed: {storage.last_error}")
|
|
self.logger.error(f"Error: upload failed: {storage.last_error}")
|
|
|
return -3
|
|
return -3
|
|
|
|
|
|
|
|
- storage.send_and_wait_eol(f'loader open "Applications" {fap_dst_path}\r')
|
|
|
|
|
- result = storage.read.until(storage.CLI_EOL)
|
|
|
|
|
- if len(result):
|
|
|
|
|
- self.logger.error(f"Unexpected response: {result.decode('ascii')}")
|
|
|
|
|
- return -4
|
|
|
|
|
|
|
+ if self.args.launch_app:
|
|
|
|
|
+ storage.send_and_wait_eol(
|
|
|
|
|
+ f'loader open "Applications" {fap_dst_path}\r'
|
|
|
|
|
+ )
|
|
|
|
|
+ result = storage.read.until(storage.CLI_EOL)
|
|
|
|
|
+ if len(result):
|
|
|
|
|
+ self.logger.error(f"Unexpected response: {result.decode('ascii')}")
|
|
|
|
|
+ return -4
|
|
|
|
|
|
|
|
return 0
|
|
return 0
|
|
|
finally:
|
|
finally:
|