source: rtems/cpukit/libcsupport/src/consolesimpleread.c @ 337a186

5
Last change on this file since 337a186 was 337a186, checked in by Sebastian Huber <sebastian.huber@…>, on Feb 21, 2018 at 11:40:18 AM

Add a simple task console driver

Close #3320.

  • Property mode set to 100644
File size: 750 bytes
Line 
1/*
2 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <rtems/bspIo.h>
16#include <rtems/libio.h>
17
18#include "consolesimple.h"
19
20ssize_t _Console_simple_Read(
21  rtems_libio_t *iop,
22  void          *buffer,
23  size_t         count
24)
25{
26  char    *buf;
27  ssize_t  i;
28  ssize_t  n;
29
30  buf = buffer;
31  n = (ssize_t) count;
32
33  for ( i = 0; i < n; ++i ) {
34    int c;
35
36    do {
37      c = getchark();
38    } while (c == -1);
39
40    buf[ i ] = (char) c;
41  }
42
43  return n;
44}
Note: See TracBrowser for help on using the repository browser.