size_t __read(int handle, unsigned char * buffer, size_t size)
{
  /* Remove the #if #endif pair to enable the implementation */

  int nChars = 0;

  for (/* Empty */; size > 0; --size)
  {
    int c = UartGetc();
    if (c < 0)
      break;

    *buffer++ = c;
    ++nChars;
  }

  return nChars;
}
Exemple #2
0
int fgetc(FILE *f) {
  return (UartPutc(UartGetc()));
}