diff options
author | root <root@lamia.panaceas.james.local> | 2015-06-06 12:38:36 +0100 |
---|---|---|
committer | root <root@lamia.panaceas.james.local> | 2015-06-06 12:38:36 +0100 |
commit | 98cba32ca9d62f6e4b7e735d177dba699b8d0698 (patch) | |
tree | 90dacda66749f7f71989264af91022dca39c8254 /app/stdio.c | |
download | tims_keyboard-98cba32ca9d62f6e4b7e735d177dba699b8d0698.tar.gz tims_keyboard-98cba32ca9d62f6e4b7e735d177dba699b8d0698.tar.bz2 tims_keyboard-98cba32ca9d62f6e4b7e735d177dba699b8d0698.zip |
inititalcommit
Diffstat (limited to 'app/stdio.c')
-rw-r--r-- | app/stdio.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/app/stdio.c b/app/stdio.c new file mode 100644 index 0000000..b3fee4f --- /dev/null +++ b/app/stdio.c @@ -0,0 +1,83 @@ +#include "project.h" + +int +_open (const char *name, + int flags, + int mode) +{ + errno = ENOSYS; + return -1; /* Always fails */ + +} /* _open () */ + +int +_close (int file) +{ + errno = EBADF; + return -1; /* Always fails */ + +} /* _close () */ + +int +_write (int file, + char *buf, + int nbytes) +{ + + int ret; + + + ret=usart1_write(buf,nbytes, 1); + + if (ret<0) { + errno=-ret; + return -1; + } + + return ret; +} /* _write () */ + + +int +_read (int file, + char *buf, + int nbytes) +{ + + errno=-EAGAIN; + return -1; /* EOF */ + +} /* _read () */ + +#if 0 +int +_fstat (int file, + struct stat *st) +{ + st->st_mode = S_IFCHR; + return 0; + +} /* _fstat () */ +#endif + +int +_lseek (int file, + int offset, + int whence) +{ + return 0; + +} /* _lseek () */ + +int +isatty (int file) +{ + return 1; + +} /* _isatty () */ + + +void stdio_drain(void) +{ +usart1_drain(); +} |