1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-02-16 12:43:00 +00:00
Files
antonblanchard.microwatt/hello_world/hello_world.c
Michael Neuling b1c260599f Send line feed if we get a carriage return in hello world.
Signed-off-by: Michael Neuling <mikey@neuling.org>
2020-07-02 14:23:00 +10:00

21 lines
268 B
C

#include <stdint.h>
#include <stdbool.h>
#include "console.h"
#define HELLO_WORLD "Hello World\n"
int main(void)
{
console_init();
puts(HELLO_WORLD);
while (1) {
unsigned char c = getchar();
putchar(c);
if (c == 13) // if CR send LF
putchar(10);
}
}