ibex_demo/syscalls.c

20 lines
383 B
C

#include <stdint.h>
#include "xilinx_ip_defs.h"
void _putchar(char ch)
{
while(((UART0->STAT & 0x04) == 0) || UART0->STAT & 0x08) {
// Waits for TX FIFO empty.
}
UART0->TX_FIFO = ch;
}
int _write(int handle, char *data, int size ) {
int count;
handle = handle;
for( count = 0; count < size; count++) {
_putchar(data[count]);
}
return count;
}