Add Arduino Micro and Arduino Uno
This commit is contained in:
parent
abd457ba73
commit
e3aa21cae4
@ -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)
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
src/board/arduino/micro/board.mk
Normal file
9
src/board/arduino/micro/board.mk
Normal 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
|
6
src/board/arduino/micro/include/board/cpu.h
Normal file
6
src/board/arduino/micro/include/board/cpu.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _BOARD_CPU_H
|
||||
#define _BOARD_CPU_H
|
||||
|
||||
#define F_CPU 16000000ULL
|
||||
|
||||
#endif // _BOARD_CPU_H
|
21
src/board/arduino/micro/main.c
Normal file
21
src/board/arduino/micro/main.c
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
9
src/board/arduino/uno/board.mk
Normal file
9
src/board/arduino/uno/board.mk
Normal 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
|
6
src/board/arduino/uno/include/board/cpu.h
Normal file
6
src/board/arduino/uno/include/board/cpu.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _BOARD_CPU_H
|
||||
#define _BOARD_CPU_H
|
||||
|
||||
#define F_CPU 16000000ULL
|
||||
|
||||
#endif // _BOARD_CPU_H
|
21
src/board/arduino/uno/main.c
Normal file
21
src/board/arduino/uno/main.c
Normal 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
1
src/ec/atmega328p/ec.mk
Normal file
@ -0,0 +1 @@
|
||||
ARCH=avr
|
1
src/ec/atmega32u4/ec.mk
Normal file
1
src/ec/atmega32u4/ec.mk
Normal file
@ -0,0 +1 @@
|
||||
ARCH=avr
|
Loading…
x
Reference in New Issue
Block a user