27 lines
467 B
C
27 lines
467 B
C
#include <stdio.h>
|
|
|
|
#include <arch/gpio.h>
|
|
#include <arch/uart.h>
|
|
|
|
void init(void) {
|
|
uart_stdio_init(0, 9600);
|
|
}
|
|
|
|
struct Gpio LED = GPIO(B, 7);
|
|
|
|
int main(void) {
|
|
init();
|
|
|
|
gpio_set_dir(&LED, true);
|
|
gpio_set(&LED, false);
|
|
printf("Hello from System76 EC for the Arduino Mega 2560!\n");
|
|
for (;;) {
|
|
int c = getchar();
|
|
if (c == '\r') {
|
|
putchar('\n');
|
|
} else if (c > 0) {
|
|
putchar(c);
|
|
}
|
|
}
|
|
}
|