blob: 0c4c800aeeb428244c81b23a5de468e4df94c532 [file] [log] [blame]
#include <stdint.h>
#define LED (*(volatile uint32_t*)0x02000000)
#define reg_uart_clkdiv (*(volatile uint32_t*)0x02000004)
#define reg_uart_data (*(volatile uint32_t*)0x02000008)
void putchar(char c)
{
if (c == '\n')
putchar('\r');
reg_uart_data = c;
}
void print(const char *p)
{
while (*p)
putchar(*(p++));
}
void delay() {
for (volatile int i = 0; i < 50000; i++)
;
}
int main() {
reg_uart_clkdiv = 509;
while (1) {
LED = 0xFF;
print("hello world\n");
delay();
LED = 0x00;
delay();
}
}