mbv: some debug stuff
This commit is contained in:
parent
3db383d461
commit
d15e930649
@ -5,6 +5,11 @@ MEMORY
|
||||
|
||||
_vector_table = 0x0;
|
||||
|
||||
BiosUartRead = 0x0d4;
|
||||
BiosUartWrite = 0x22c;
|
||||
BiosWozmon = 0x340;
|
||||
BiosUartWriteNibble = 0x324;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
|
26
mbv/hal/debug.cc
Normal file
26
mbv/hal/debug.cc
Normal 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++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user