public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Add constants to g-sercom for slow bit rates
@ 2015-05-12 13:02 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2015-05-12 13:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: Thomas Quinot

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

This change introduces new literals B75, B110, B150, B300, and B600 for
enumerated type GNAT.Serial_Communications.Data_Rate, denoting the
corresponding bit rates. This allows communication with legacy devices
that require them.

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-05-12  Thomas Quinot  <quinot@adacore.com>

	* g-sercom.ads, g-sercom-linux.adb (GNAT.Serial_Communications.
	Data_Rate): New literals B75, B110, B150, B300, B600.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 3106 bytes --]

Index: g-sercom.ads
===================================================================
--- g-sercom.ads	(revision 223033)
+++ g-sercom.ads	(working copy)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---                    Copyright (C) 2007-2014, AdaCore                      --
+--                    Copyright (C) 2007-2015, AdaCore                      --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -50,7 +50,8 @@
    --  cases, an explicit port name can be passed directly to Open.
 
    type Data_Rate is
-     (B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200);
+     (B75, B110, B150, B300, B600, B1200, B2400, B4800, B9600,
+      B19200, B38400, B57600, B115200);
    --  Speed of the communication
 
    type Data_Bits is (CS8, CS7);
@@ -122,7 +123,12 @@
    end record;
 
    Data_Rate_Value : constant array (Data_Rate) of Interfaces.C.unsigned :=
-                       (B1200   =>   1_200,
+                       (B75     =>      75,
+                        B110    =>     110,
+                        B150    =>     150,
+                        B300    =>     300,
+                        B600    =>     600,
+                        B1200   =>   1_200,
                         B2400   =>   2_400,
                         B4800   =>   4_800,
                         B9600   =>   9_600,
Index: g-sercom-linux.adb
===================================================================
--- g-sercom-linux.adb	(revision 223033)
+++ g-sercom-linux.adb	(working copy)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                    Copyright (C) 2007-2013, AdaCore                      --
+--                    Copyright (C) 2007-2015, AdaCore                      --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -58,7 +58,12 @@
    pragma Import (C, fcntl, "fcntl");
 
    C_Data_Rate : constant array (Data_Rate) of unsigned :=
-                   (B1200   => OSC.B1200,
+                   (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,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-12 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 13:02 [Ada] Add constants to g-sercom for slow bit rates Arnaud Charlet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).