Try loading code at runtime

This commit is contained in:
2026-02-13 17:22:23 +01:00
parent a53e11d6dd
commit 27a3847c13
28 changed files with 96 additions and 144 deletions

View File

@@ -1,15 +0,0 @@
const UART_BASE: *mut u8 = 0x10000000 as *mut _;
pub fn write_char_uart(c: char) {
while unsafe { core::ptr::read_volatile(UART_BASE.byte_add(0x5)) } >> 5 & 1 == 0 {}
unsafe { core::ptr::write_volatile(UART_BASE, c as u8) };
}
pub fn write_uart<T: AsRef<str>>(print: T) {
print.as_ref().chars().for_each(|a| {
// Add \r if needed
write_char_uart(a);
if a == '\n' {
write_char_uart('\r');
}
});
}