Changeset 704 for trunk/softs/tsar_boot/src/reset_tty.c
- Timestamp:
- May 27, 2014, 4:43:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/src/reset_tty.c
r586 r704 1 /******************************************************************** 2 * \file reset_tty.c 3 * \date 5 mars 2014 4 * \author Cesar Fuguet 5 * 6 * Minimal driver for TTY controler 7 *******************************************************************/ 8 1 9 #include <reset_tty.h> 2 10 #include <io.h> … … 7 15 { 8 16 unsigned int* tty_address = (unsigned int*) TTY_PADDR_BASE; 9 if (ioread32(&tty_address[TTY_STATUS]) == 0)10 return 0;11 17 12 *c = ioread32(&tty_address[TTY_READ]); 18 if (ioread32( &tty_address[TTY_STATUS] ) == 0) return 0; 19 *c = ioread32( &tty_address[TTY_READ] ); 13 20 return 1; 14 21 } … … 18 25 { 19 26 unsigned int* tty_address = (unsigned int*) TTY_PADDR_BASE; 20 iowrite32(&tty_address[TTY_WRITE], (unsigned int)c);21 27 22 if (c == '\n') 23 { 24 iowrite32(&tty_address[TTY_WRITE], (unsigned int)'\r'); 25 } 28 iowrite32( &tty_address[TTY_WRITE], (unsigned int)c ); 29 if (c == '\n') reset_putc( '\r' ); 26 30 } 27 31 … … 34 38 { 35 39 if (buffer[n] == 0) break; 36 37 40 reset_putc(buffer[n]); 38 41 }
Note: See TracChangeset
for help on using the changeset viewer.