blob: 737b441d990a5ce85ac88a3c157a89ccc48451a3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/*
* Copyright (c) 2017 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#include <rtems/bspIo.h>
#include <rtems/libio.h>
#include "consolesimple.h"
ssize_t _Console_simple_Read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
char *buf;
ssize_t i;
ssize_t n;
buf = buffer;
n = (ssize_t) count;
for ( i = 0; i < n; ++i ) {
int c;
while ( true ) {
c = getchark();
if ( c != -1 ) {
break;
}
(void) rtems_task_wake_after( 1 );
}
buf[ i ] = (char) c;
}
return n;
}
|