mbv: some debug stuff

This commit is contained in:
2025-06-10 23:48:29 -07:00
parent 3db383d461
commit d15e930649
2 changed files with 31 additions and 0 deletions

26
mbv/hal/debug.cc Normal file
View File

@@ -0,0 +1,26 @@
#include <cstdint>
extern "C" {
uint8_t BiosUartRead();
void BiosUartWrite(uint8_t);
void BiosWozmon();
void BiosUartWriteNibble(uint8_t n);
__attribute__((used))
void UartWriteU32(uint32_t a) {
for (int i = 0; i < 8; i++) {
BiosUartWriteNibble(a >> 28);
a <<= 4;
}
}
__attribute__((used))
void UartWriteString(const char* s) {
while (*s) {
BiosUartWrite(*s);
s++;
}
}
}