source: rtems/c/src/lib/libbsp/i386/pc386/console/serial_mouse_config.c @ b43ea9f

Last change on this file since b43ea9f was b43ea9f, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 5, 2018 at 3:07:20 PM

bsps: Move legacy console driver to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
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.org/license/LICENSE.
8 */
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <bsp.h>
13#include <sys/types.h>
14#include <sys/stat.h>
15#include <fcntl.h>
16
17#include <libchip/serial.h>
18#include "../../../../../../../bsps/shared/dev/serial/legacy-console.h"
19
20/* select which serial port the mouse is connected to */
21#if defined(SERIAL_MOUSE_COM2)
22  #define MOUSE_DEVICE "/dev/com2"
23#else
24  #define MOUSE_DEVICE "/dev/com1"
25#endif
26
27static const char *SerialMouseDevice = MOUSE_DEVICE;
28
29bool bsp_get_serial_mouse_device(
30  const char **name,
31  const char **type
32)
33{
34  const char *consname;
35
36  *name = SerialMouseDevice;
37  *type = "ms";
38
39  /* Check if this port is not been used as console */
40  consname = Console_Port_Tbl[ Console_Port_Minor ]->sDeviceName;
41  if ( !strcmp(MOUSE_DEVICE, consname) ) {
42    printk( "SERIAL MOUSE: port selected as console.(%s)\n", *name );
43    rtems_fatal_error_occurred( -1 );
44  }
45
46  printk("Mouse Device: %s\n", *name );
47  return name;
48}
Note: See TracBrowser for help on using the repository browser.