Changeset 93b84b3 in mainline for arch/mips32/src/drivers/msim.c
- Timestamp:
- 2005-12-12T16:30:07Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ebbdb8f
- Parents:
- af9a7c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/src/drivers/msim.c
raf9a7c5 r93b84b3 38 38 static void msim_enable(chardev_t *dev); 39 39 static void msim_disable(chardev_t *dev); 40 static char msim_do_read(chardev_t *dev); 40 41 41 42 static chardev_operations_t msim_ops = { 42 43 .resume = msim_enable, 43 44 .suspend = msim_disable, 44 .write = msim_write 45 .write = msim_write, 46 .read = msim_do_read, 45 47 }; 46 48 … … 64 66 65 67 #include <print.h> 68 /** Read character using polling, assume interrupts disabled */ 69 static char msim_do_read(chardev_t *dev) 70 { 71 char ch; 72 73 while (1) { 74 ch = *((volatile char *) MSIM_KBD_ADDRESS); 75 if (ch) { 76 if (ch == '\r') 77 return '\n'; 78 if (ch == 0x7f) 79 return '\b'; 80 return ch; 81 } 82 } 83 } 84 66 85 /** Process keyboard interrupt. */ 67 86 static void msim_interrupt(int n, void *stack) 68 87 { 69 char ch ;88 char ch = 0; 70 89 71 90 ch = *((char *) MSIM_KBD_ADDRESS);
Note:
See TracChangeset
for help on using the changeset viewer.