#include "kitchensink.h"
void main() {
// Initialize Kitchen Sink hardware
KS_init();
// Main program loop...
display("Peace among worlds!\n");
}
###############################################################################
# Makefile for the project AVR
###############################################################################
PROJECT=mayhem
all: $(PROJECT).hex
BOARDDIR = path/to/KS_Library
include $(BOARDDIR)/profile.mk
OBJECTS = \
$(BOARDOBJS) \
build/Main.o \
## Main build section
.PHONY: clean upload documentation
board: $(BOARDOBJS)
build/%.o: src/%.c
@mkdir -p $(@D)
$(AVR-CC) $(AVR-CFLAGS) $(addprefix -I, $(BOARDDIR) src tmp) -c -o $@ $<
$(PROJECT).elf: $(OBJECTS)
$(AVR-CC) $(AVR-COMMON) -o $@ $^ $(AVR-LDFLAGS)
%.hex: %.elf
avr-objcopy -O ihex $< $@
upload: $(PROJECT).hex
avrdude -p m1280 -P /dev/ttyUSB0 -c arduino -b 57600 -F -u -U flash:w:$<
documentation:
doxygen documentation/Doxyfile
## Clean target
clean:
-rm -rf build tmp
-rm -f *.elf *.hex