Making some MSL_C progress (#549)
This commit is contained in:
parent
32fdc38925
commit
2309176a5c
23 changed files with 1456 additions and 263 deletions
32
src/MSL_C.PPCEABI.bare.H/uart_console_io.c
Executable file
32
src/MSL_C.PPCEABI.bare.H/uart_console_io.c
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/ansi_files.h"
|
||||
|
||||
static inline int __init_uart_console(void) {
|
||||
int err = 0;
|
||||
static int initialized = 0;
|
||||
|
||||
if (initialized == 0) {
|
||||
err = InitializeUART(57600);
|
||||
if (err == 0)
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
int __write_console(__file_handle handle, unsigned char* buffer, size_t* count, __idle_proc idle_proc) {
|
||||
if (__init_uart_console() != 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (WriteUARTN(buffer, *count) != 0) {
|
||||
*count = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__TRK_write_console(handle, buffer, count, idle_proc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __close_console() {
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue