From 829871567f2a218261b33aaca1927517845cce8c Mon Sep 17 00:00:00 2001 From: klaute Date: Sun, 25 Sep 2016 17:44:41 +0200 Subject: [PATCH] Linux serial open bug fixed. --- firmware/firmware.ino | 18 ++---------------- tools/meas.py | 5 +++-- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 317052a..e9e9072 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -39,20 +39,6 @@ void setup() si5351.output_enable(SI5351_CLK1, 0); // disable clock output 1 si5351.output_enable(SI5351_CLK2, 0); // disable clock output 2 - /* - // Set CLK0 to output 14 MHz with a fixed PLL frequency - si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA); - si5351.set_freq(1400000000ULL, SI5351_PLL_FIXED, SI5351_CLK0); - - // Set CLK1 to output 20 MHz - si5351.set_freq(2000000000ULL, 0ULL, SI5351_CLK1); - - si5351.output_enable(SI5351_CLK0, 1); // enable clock output 0 - si5351.drive_strength(SI5351_CLK0, SI5351_DRIVE_2MA); // 2 4 6 8ma - */ - //delay(500); - - //Serial.println("SWR Meter firmware v0.1 by Kai Lauterbach (me@klaute.de)"); } void loop() @@ -76,7 +62,7 @@ void loop() if (Serial.available() > 0) { uint8_t c = Serial.read() & 0xff; - //Serial.write(c); // TODO + cc_processData(c); } @@ -84,4 +70,4 @@ void loop() delay(100); } - + diff --git a/tools/meas.py b/tools/meas.py index 9516aaf..c47da29 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -302,9 +302,10 @@ def openSerialDevice(d): ser.setDTR(True) try: - ser.close() + if "com" in d.lower(): + ser.close() ser = serial.Serial( - port="\\\\.\\"+d,\ + port=d,\ baudrate=115200,\ parity=serial.PARITY_NONE,\ stopbits=serial.STOPBITS_ONE,\