Adding source and Makefile

This commit is contained in:
Marco Groß 2021-12-02 21:57:19 +01:00
parent 608fd01f29
commit 0e56f904d0
2 changed files with 27 additions and 0 deletions

18
Makefile Normal file
View File

@ -0,0 +1,18 @@
TARGETNAME = togglePin
BUILDFOLDER = ./build/
TARGET = $(BUILDFOLDER)$(TARGETNAME)
INC = -Isrc/include -I/usr/lib/avr/include/
CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4
SRC = $(wildcard src/*.c)
all: $(TARGET)
$(TARGET): $(SRC)
mkdir -p build
avr-gcc -o $@.elf $^ $(CFLAGS) $(INC)
avr-objcopy -j .text -j .data -O ihex $@.elf $@.hex
clean:
rm -fr ./src/*.o ./build/

9
src/togglePin.c Normal file
View File

@ -0,0 +1,9 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdio.h>
int main()
{
return 0;
}