-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51475a8
commit ad1a969
Showing
5 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.elf | ||
*.o | ||
*.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM ubuntu | ||
MAINTAINER Kelvin Abrokwa ([email protected]) | ||
RUN apt-get update | ||
RUN apt-get install -y --force-yes build-essential arduino arduino-core | ||
RUN apt-get install -y --force-yes gcc-avr binutils-avr avr-libc | ||
RUN mkdir /build | ||
ADD ./ /build | ||
WORKDIR /build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
all: | ||
arduino blink.uno | ||
avr-gcc -g -Os -mmcu=atmega32 -c blink.c | ||
avr-gcc -g -mmcu=atmega32 -o blink.elf blink.o | ||
avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex | ||
|
||
docker-build: | ||
docker build -t firmware-builder . | ||
docker run -it firmware-builder | ||
|
||
clean: | ||
rm -f *.o *.elf *.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef F_CPU | ||
#define F_CPU 16000000UL // or whatever may be your frequency | ||
#endif | ||
|
||
#include <avr/io.h> | ||
#include <util/delay.h> // for _delay_ms() | ||
|
||
int main(void) | ||
{ | ||
DDRC = 0x01; // initialize port C | ||
while(1) | ||
{ | ||
// LED on | ||
PORTC = 0b00000001; // PC0 = High = Vcc | ||
_delay_ms(500); // wait 500 milliseconds | ||
|
||
//LED off | ||
PORTC = 0b00000000; // PC0 = Low = 0v | ||
_delay_ms(500); // wait 500 milliseconds | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.