[gnoduino] fix serial ports scanning
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino] fix serial ports scanning
- Date: Thu, 18 Dec 2014 18:37:14 +0000 (UTC)
commit 806115dbc9d786f0de0c1e0f4505f31f01ccce77
Author: Lucian Langa <lucilanga gnome org>
Date: Thu Dec 18 19:20:55 2014 +0100
fix serial ports scanning
src/serialio.py | 1 +
src/ui.py | 7 ++++---
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/serialio.py b/src/serialio.py
index 242be25..a9c3adb 100644
--- a/src/serialio.py
+++ b/src/serialio.py
@@ -46,6 +46,7 @@ class sconsole:
ports = []
tryports = glob.glob('/dev/ttyS*') + glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyACM*')
for i in tryports:
+ if i == config.cur_serial_port: continue
try:
s = serial.Serial(i)
ports.append(s.portstr)
diff --git a/src/ui.py b/src/ui.py
index 1bf3ecd..add88ef 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -704,6 +704,7 @@ def setSerial(w, id):
ser.resetBoard()
ser.serial.close()
ser.serial.port = id
+ ser.serial.baudrate = config.serial_baud_rate
ser.serial.open()
p.setValue("serial.port", id)
p.saveValues()
@@ -959,11 +960,11 @@ def run():
misc.setConsoleTags(tw)
"""setup default serial port"""
- getSerialPorts()
- populateSerialPortMenu()
- sertime = glib.timeout_add(1000, getSerialPorts)
if config.serial_baud_rate == -1:
config.serial_baud_rate = p.getSafeValue("serial.debug_rate",
p.getDefaultValue("serial.debug_rate"))
+ getSerialPorts()
+ populateSerialPortMenu()
+ glib.timeout_add(1000, getSerialPorts)
createRecentMenu()
populateExamples()
populateImport()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]