Initial import
This commit is contained in:
commit
420b7d6591
|
@ -0,0 +1,4 @@
|
|||
*.hex
|
||||
*.elf
|
||||
*.o
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#include <avr/io.h>
|
||||
|
||||
#define F_CPU 20000000UL
|
||||
#include <util/delay.h>
|
||||
|
||||
int main() {
|
||||
DDRB |= 1;
|
||||
|
||||
while(1) {
|
||||
PORTB |= 1;
|
||||
_delay_ms(50);
|
||||
PORTB &= ~1;
|
||||
_delay_ms(950);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Cleanup
|
||||
rm -vf *.o *.elf *.hex
|
||||
|
||||
# Compile
|
||||
/home/jpt/arduino-1.8.8/hardware/tools/avr/bin/avr-gcc -c -mmcu=atmega328p blink.c
|
||||
|
||||
# Link
|
||||
/home/jpt/arduino-1.8.8/hardware/tools/avr/bin/avr-gcc -g -mmcu=atmega328p blink.o -o blink.elf
|
||||
|
||||
# Convert hex
|
||||
/home/jpt/arduino-1.8.8/hardware/tools/avr/bin/avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex
|
||||
|
||||
# Upload
|
||||
avrdude -P /dev/ttyUSB0 -c arduino -p m328p -b 19200 -U flash:w:blink.hex
|
Loading…
Reference in New Issue