Linux serial open bug fixed.

This commit is contained in:
klaute 2016-09-25 17:44:41 +02:00
parent 2ceacc0a90
commit 829871567f
2 changed files with 5 additions and 18 deletions

View file

@ -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);
}

View file

@ -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,\