size_t i = 0;
char *buf = (char *)_buf;
int c;
-
+
while (i < size)
{
if ((c = ser_getchar(fds->ser)) == EOF)
static int ser_flush(struct KFile *fd)
{
KFileSerial *fds = KFILESERIAL(fd);
-
+
/*
* Wait until the FIFO becomes empty, and then until the byte currently in
* the hardware register gets shifted out.
static size_t spimaster_write(struct KFile *fd, const void *buf, size_t size)
{
KFileSerial *fd_spi = KFILESERIAL(fd);
-
+
ser_purgeRx(fd_spi);
return ser_write(&fd_spi->fd, buf, size);
fds->fd.read = spimaster_read;
fds->fd.write = spimaster_write;
}
-
-