Browse Source

Hook up stdio input, for the heck of it. We seem to be moving away from it, but there are things it can do that are hard to do with the Stream interfaces.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@555 f9c3cf11-9bcb-44bc-f272-b75c42450872
mission-4.1.18
DrZiplok@gmail.com 15 years ago
parent
commit
5ba0c7328f
  1. 2
      libraries/FastSerial/FastSerial.cpp

2
libraries/FastSerial/FastSerial.cpp

@ -103,7 +103,7 @@ FastSerial::FastSerial(const uint8_t portNumber, @@ -103,7 +103,7 @@ FastSerial::FastSerial(const uint8_t portNumber,
_rxBuffer->head = _rxBuffer->tail = 0;
// init stdio
fdev_setup_stream(&_fd, &FastSerial::_putchar, NULL, _FDEV_SETUP_WRITE);
fdev_setup_stream(&_fd, &FastSerial::_putchar, &FastSerial::_getchar, _FDEV_SETUP_RW);
fdev_set_udata(&_fd, this);
if (0 == portNumber) {
stdout = &_fd; // serial port 0 is always the default console

Loading…
Cancel
Save