Browse Source

pass on start_baud to terminal

* closes #49
Peter Magnusson 8 years ago
parent
commit
860372a1ae
2 changed files with 8 additions and 7 deletions
  1. 1 1
      nodemcu_uploader/main.py
  2. 7 6
      nodemcu_uploader/term.py

+ 1 - 1
nodemcu_uploader/main.py

@@ -224,7 +224,7 @@ def main_func():
 
     if args.operation == 'terminal':
         #uploader can not claim the port
-        terminal(args.port)
+        terminal(args.port, str(args.start_baud))
         return
 
     uploader = Uploader(args.port, args.baud, start_baud=args.start_baud)

+ 7 - 6
nodemcu_uploader/term.py

@@ -1,14 +1,15 @@
-#!/usr/bin/env python
 # -*- coding: utf-8 -*-
+"""Piggyback on pyserial terminal"""
+
 from serial.tools import miniterm
 import sys
 
 from .utils import default_port
 
-def terminal(port=default_port()):
-    testargs = ['nodemcu-uploader', port]
-    # TODO: modifying argv is no good 
+def terminal(port=default_port(), baud='9600'):
+    """Launch minterm from pyserial"""
+    testargs = ['nodemcu-uploader', port, baud]
+    # TODO: modifying argv is no good
     sys.argv = testargs
     # resuse miniterm on main function
-    miniterm.main()  
-    
+    miniterm.main()