More tweaking of the serial setup for Linux.
This commit is contained in:
parent
8468c9dc49
commit
f905a46461
|
@ -172,6 +172,9 @@ int serial_init(const char* port, unsigned long baud)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get the current options */
|
||||||
|
chk("tcgetattr", tcgetattr(hSerial, &old_sparm));
|
||||||
|
|
||||||
/* set the baud rate */
|
/* set the baud rate */
|
||||||
if (!serial_baud(baud)) {
|
if (!serial_baud(baud)) {
|
||||||
close(hSerial);
|
close(hSerial);
|
||||||
|
@ -253,8 +256,7 @@ int serial_baud(unsigned long baud)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the current options */
|
/* get the current options */
|
||||||
chk("tcgetattr", tcgetattr(hSerial, &old_sparm));
|
chk("tcgetattr", tcgetattr(hSerial, &sparm));
|
||||||
sparm = old_sparm;
|
|
||||||
|
|
||||||
/* set raw input */
|
/* set raw input */
|
||||||
cfmakeraw(&sparm);
|
cfmakeraw(&sparm);
|
||||||
|
|
Loading…
Reference in New Issue