diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-02 17:29:19 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 13:27:06 -0400 |
commit | f2eabdb6257c09cf2890dac5e9737912728542af (patch) | |
tree | 3b46f6787185d65605651a0f48776dc9779ce648 /src/MSL_C.PPCEABI.bare.H/uart_console_io.c | |
parent | eef1dd840b7cecac28c2e6b0574707b90a37d4e7 (diff) |
global: Add rest of Dolphin SDK proper, add MSL, and MetroTRK
Finally, it links properly.
Diffstat (limited to 'src/MSL_C.PPCEABI.bare.H/uart_console_io.c')
-rw-r--r-- | src/MSL_C.PPCEABI.bare.H/uart_console_io.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/MSL_C.PPCEABI.bare.H/uart_console_io.c b/src/MSL_C.PPCEABI.bare.H/uart_console_io.c new file mode 100644 index 0000000..1aff7dc --- /dev/null +++ b/src/MSL_C.PPCEABI.bare.H/uart_console_io.c @@ -0,0 +1,34 @@ +#include "console_io.h" + +int __TRK_write_console(__file_handle handle, unsigned char* buffer, size_t* count, + __idle_proc idle_proc); + +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; } |