Making some MSL_C progress (#549)

This commit is contained in:
mrshigure 2025-01-27 16:50:48 -08:00 committed by GitHub
parent 32fdc38925
commit 2309176a5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 1456 additions and 263 deletions

View 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;
}