Add Arduino Micro and Arduino Uno

This commit is contained in:
Jeremy Soller 2019-09-29 21:20:03 -06:00
parent abd457ba73
commit e3aa21cae4
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
11 changed files with 96 additions and 3 deletions

View File

@ -19,7 +19,11 @@
_BV(UCSZ ## N ## 1) | _BV(UCSZ ## N ## 0) \
}
#if defined(__AVR_ATmega32U4__)
#if defined(__AVR_ATmega328P__)
static struct Uart UARTS[] = {
UART(0)
};
#elif defined(__AVR_ATmega32U4__)
static struct Uart UARTS[] = {
UART(1)
};

View File

@ -1 +1,9 @@
EC=atmega2560
PORT=$(wildcard /dev/ttyACM*)
console:
sudo tio -b 9600 $(PORT)
flash: $(BUILD)/ec.ihx
sudo avrdude -v -v -p $(EC) -c wiring -P $(PORT) -b 115200 -D -U flash:w:$<:i

View File

@ -6,9 +6,16 @@ void init(void) {
uart_stdio_init(0, 9600);
}
void main(void) {
int main(void) {
init();
printf("Hello from System76 EC for the Arduino Mega 2560!\n");
for (;;) {}
for (;;) {
int c = getchar();
if (c == '\r') {
putchar('\n');
} else if (c > 0) {
putchar(c);
}
}
}

View File

@ -0,0 +1,9 @@
EC=atmega32u4
PORT=$(wildcard /dev/ttyACM*)
console:
sudo tio -b 9600 $(PORT)
flash: $(BUILD)/ec.ihx
sudo avrdude -v -v -p $(EC) -c avr109 -P $(PORT) -b 115200 -D -U flash:w:$<:i

View File

@ -0,0 +1,6 @@
#ifndef _BOARD_CPU_H
#define _BOARD_CPU_H
#define F_CPU 16000000ULL
#endif // _BOARD_CPU_H

View File

@ -0,0 +1,21 @@
#include <stdio.h>
#include <arch/uart.h>
void init(void) {
uart_stdio_init(0, 9600);
}
int main(void) {
init();
printf("Hello from System76 EC for the Arduino Micro!\n");
for (;;) {
int c = getchar();
if (c == '\r') {
putchar('\n');
} else if (c > 0) {
putchar(c);
}
}
}

View File

@ -0,0 +1,9 @@
EC=atmega328p
PORT=$(wildcard /dev/ttyACM*)
console:
sudo tio -b 9600 $(PORT)
flash: $(BUILD)/ec.ihx
sudo avrdude -v -v -p $(EC) -c arduino -P $(PORT) -b 115200 -D -U flash:w:$<:i

View File

@ -0,0 +1,6 @@
#ifndef _BOARD_CPU_H
#define _BOARD_CPU_H
#define F_CPU 16000000ULL
#endif // _BOARD_CPU_H

View File

@ -0,0 +1,21 @@
#include <stdio.h>
#include <arch/uart.h>
void init(void) {
uart_stdio_init(0, 9600);
}
int main(void) {
init();
printf("Hello from System76 EC for the Arduino Uno!\n");
for (;;) {
int c = getchar();
if (c == '\r') {
putchar('\n');
} else if (c > 0) {
putchar(c);
}
}
}

1
src/ec/atmega328p/ec.mk Normal file
View File

@ -0,0 +1 @@
ARCH=avr

1
src/ec/atmega32u4/ec.mk Normal file
View File

@ -0,0 +1 @@
ARCH=avr