20 lines
437 B
C++
20 lines
437 B
C++
#include <dbg.h>
|
|
|
|
/* Never call this function directly: always use the printk,
|
|
* which disables and reenables interrupts */
|
|
extern "C" int c_printk(const char* msg) {
|
|
while (*msg != '\0') {
|
|
while ((*dbg::UART_LSR & 0x20) == 0); /* Wait for transmission */
|
|
*dbg::UART_THR = *msg;
|
|
msg++;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
extern "C" int printkl(const char* msg) {
|
|
printk(msg);
|
|
printk("\r\n");
|
|
return 0;
|
|
}
|
|
|