Last change
on this file since 520 was
444,
checked in by satin@…, 7 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
662 bytes
|
Rev | Line | |
---|
[444] | 1 | #define USE_PORT_A |
---|
| 2 | |
---|
| 3 | #define RXADATA (int *) 0x01F800E0 |
---|
| 4 | #define RXBDATA (int *) 0x01F800E4 |
---|
| 5 | #define RXSTAT (int *) 0x01F800E8 |
---|
| 6 | |
---|
| 7 | void |
---|
| 8 | outbyte (int c) |
---|
| 9 | { |
---|
| 10 | volatile int *rxstat; |
---|
| 11 | volatile int *rxadata; |
---|
| 12 | int rxmask; |
---|
| 13 | |
---|
| 14 | rxstat = RXSTAT; |
---|
| 15 | #ifdef USE_PORT_A |
---|
| 16 | rxadata = RXADATA; |
---|
| 17 | rxmask = 6; |
---|
| 18 | #else |
---|
| 19 | rxadata = RXBDATA; |
---|
| 20 | rxmask = 0x60000; |
---|
| 21 | #endif |
---|
| 22 | |
---|
| 23 | while ((*rxstat & rxmask) == 0); |
---|
| 24 | |
---|
| 25 | *rxadata = c; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | int |
---|
| 29 | inbyte (void) |
---|
| 30 | { |
---|
| 31 | volatile int *rxstat; |
---|
| 32 | volatile int *rxadata; |
---|
| 33 | int rxmask; |
---|
| 34 | |
---|
| 35 | rxstat = RXSTAT; |
---|
| 36 | #ifdef USE_PORT_A |
---|
| 37 | rxadata = RXADATA; |
---|
| 38 | rxmask = 1; |
---|
| 39 | #else |
---|
| 40 | rxadata = RXBDATA; |
---|
| 41 | rxmask = 0x10000; |
---|
| 42 | #endif |
---|
| 43 | |
---|
| 44 | while ((*rxstat & rxmask) == 0); |
---|
| 45 | |
---|
| 46 | return *rxadata; |
---|
| 47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.