From 5c2f3edd694e180f46b7678ce6f30d8354cd5c32 Mon Sep 17 00:00:00 2001 From: Torsten Meissner Date: Wed, 6 Jun 2012 22:09:20 +0200 Subject: [PATCH] project moved from https://github.com/tmeissner/avr/planefinder to https://github.com/tmeissner/planefinder --- makefile | 23 ++++++++++++ src/main.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 makefile create mode 100755 src/main.c diff --git a/makefile b/makefile new file mode 100644 index 0000000..939e8b2 --- /dev/null +++ b/makefile @@ -0,0 +1,23 @@ +#AVR-GCC Makefile +PROJECT = planefinder +SOURCES = src/main.c +CC = avr-gcc +OBJCOPY = avr-objcopy +MMCU = attiny13 + +DUMMY_BINARY:=$(shell mkdir -p binary) + +CFLAGS = -mmcu=$(MMCU) -Wall -Os -std=gnu99 + +binary/$(PROJECT).hex: binary/$(PROJECT).out + $(OBJCOPY) -j .text -O ihex binary/$(PROJECT).out binary/$(PROJECT).hex + +binary/$(PROJECT).out: $(SOURCES) + $(CC) $(CFLAGS) -I./ -o binary/$(PROJECT).out $(SOURCES) + +program: binary/$(PROJECT).hex + avrdude -p t13 -c usbasp -e -U flash:w:binary/$(PROJECT).hex + +clean: + rm -f binary/$(PROJECT).out + rm -f binary/$(PROJECT).hex diff --git a/src/main.c b/src/main.c new file mode 100755 index 0000000..31867bc --- /dev/null +++ b/src/main.c @@ -0,0 +1,104 @@ +#include +#include +#include +#include +#define F_CPU 9600000UL + +volatile uint8_t beep_disable = 0; +volatile uint8_t beep_enable = 0; + +static void set_wait_timer (void); +void set_beep_timer (uint8_t outport); + + +// main function +int main (void) +{ + + DDRB = (1<