source: rtems/cpukit/libcsupport/src/termios_setinitialbaud.c @ cdc8309

4.104.114.95
Last change on this file since cdc8309 was cdc8309, checked in by Joel Sherrill <joel.sherrill@…>, on 05/22/08 at 20:35:41

2008-05-22 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/termios_baud2index.c, libcsupport/src/termios_baud2num.c, libcsupport/src/termios_num2baud.c, libcsupport/src/termios_setinitialbaud.c: New files.
  • Property mode set to 100644
File size: 630 bytes
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#include <sys/termios.h>
13#include <rtems/termiostypes.h>
14
15int  rtems_termios_set_initial_baud(
16  struct rtems_termios_tty *ttyp,
17  int                       baud
18)
19{
20  int cflags_baud;
21
22  cflags_baud = termios_number_to_baud(baud);
23  if ( cflags_baud == -1 )
24    return -1;
25
26  ttyp->termios.c_cflag = (ttyp->termios.c_cflag & ~CBAUD) | cflags_baud;
27 
28  return 0;
29}
Note: See TracBrowser for help on using the repository browser.