diff options
author | Pascal Obry <obry@adacore.com> | 2020-11-07 10:31:43 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-30 09:16:17 -0500 |
commit | 50a2820f9d422cc59d6674d7f775b921cad44bfb (patch) | |
tree | 5500204b772d4b6ed76163b85c95230181855c71 | |
parent | a6617b29502ac8ebc3f25bc400035d4c9dac21d7 (diff) | |
download | gcc-50a2820f9d422cc59d6674d7f775b921cad44bfb.zip gcc-50a2820f9d422cc59d6674d7f775b921cad44bfb.tar.gz gcc-50a2820f9d422cc59d6674d7f775b921cad44bfb.tar.bz2 |
[Ada] Fix serial port control setting on GNU/Linux
gcc/ada/
* libgnat/g-sercom__linux.adb (Set): Fix control flags of the
serial port setting.
-rw-r--r-- | gcc/ada/libgnat/g-sercom__linux.adb | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/gcc/ada/libgnat/g-sercom__linux.adb b/gcc/ada/libgnat/g-sercom__linux.adb index 5f3ed07..10b456f 100644 --- a/gcc/ada/libgnat/g-sercom__linux.adb +++ b/gcc/ada/libgnat/g-sercom__linux.adb @@ -52,34 +52,6 @@ package body GNAT.Serial_Communications is function fcntl (fd : int; cmd : int; value : int) return int; pragma Import (C, fcntl, "fcntl"); - C_Data_Rate : constant array (Data_Rate) of unsigned := - (B75 => OSC.B75, - B110 => OSC.B110, - B150 => OSC.B150, - B300 => OSC.B300, - B600 => OSC.B600, - B1200 => OSC.B1200, - B2400 => OSC.B2400, - B4800 => OSC.B4800, - B9600 => OSC.B9600, - B19200 => OSC.B19200, - B38400 => OSC.B38400, - B57600 => OSC.B57600, - B115200 => OSC.B115200, - B230400 => OSC.B230400, - B460800 => OSC.B460800, - B500000 => OSC.B500000, - B576000 => OSC.B576000, - B921600 => OSC.B921600, - B1000000 => OSC.B1000000, - B1152000 => OSC.B1152000, - B1500000 => OSC.B1500000, - B2000000 => OSC.B2000000, - B2500000 => OSC.B2500000, - B3000000 => OSC.B3000000, - B3500000 => OSC.B3500000, - B4000000 => OSC.B4000000); - C_Bits : constant array (Data_Bits) of unsigned := (CS7 => OSC.CS7, CS8 => OSC.CS8); @@ -229,8 +201,7 @@ package body GNAT.Serial_Communications is -- Change settings now - Current.c_cflag := C_Data_Rate (Rate) - or C_Bits (Bits) + Current.c_cflag := C_Bits (Bits) or C_Stop_Bits (Stop_Bits) or C_Parity (Parity) or CREAD; |