From ce0718c2aadf59ed121779eecfade89d628546a0 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Mon, 9 Dec 2013 02:19:00 +0100 Subject: some changes to timekeeping --- Makefile | 9 +++------ ferment.c | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 8a8d9ff..4adeef6 100644 --- a/Makefile +++ b/Makefile @@ -299,7 +299,7 @@ AVRDUDE_ERASE_COUNTER = -y # reports about avrdude. See # to submit bug reports. #AVRDUDE_VERBOSE = -v -v -AVRDUDE_FLAGS = -p m32 -E noreset +AVRDUDE_FLAGS = -p m32 ifdef AVRDUDE_PROGRAMMER AVRDUDE_FLAGS += -c $(AVRDUDE_PROGRAMMER) @@ -309,11 +309,8 @@ AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) -#Full swing crystal oscillator -AVRDUDE_LFUSE_FLAGS = #-B 100 -U lfuse:w:0xe4:m -#preserve eeprom, max boot section -AVRDUDE_HFUSE_FLAGS = #-B 100 -U hfuse:w:0xd9:m -#2.7v brown out +AVRDUDE_LFUSE_FLAGS = -B 100 -U lfuse:w:0xbf:m +AVRDUDE_HFUSE_FLAGS = -B 100 -U hfuse:w:0xd9:m AVRDUDE_EFUSE_FLAGS = #-B 100 -U efuse:w:0xff:m #---------------- Debugging Options ---------------- diff --git a/ferment.c b/ferment.c index b0d9a65..1d282d2 100644 --- a/ferment.c +++ b/ferment.c @@ -41,7 +41,7 @@ static void bridge_off(void) } /* Turns the H-bridge on, setting 1+ 2- */ -static void bridge_on_a(void) +static void bridge_on_heat(void) { bridge_off(); _delay_ms(100); @@ -50,7 +50,7 @@ static void bridge_on_a(void) } /* Turns the H-bridge on, setting 1- 2+ */ -static void bridge_on_b(void) +static void bridge_on_cool(void) { bridge_off(); _delay_ms(100); @@ -94,16 +94,16 @@ int adc_to_centigrade(uint16_t adc_val) { } /* Initializes TIMER1 */ -static void timer_init(void) +static void timer_init(void) { - TCCR1B = (1 << WGM12) | (1 << CS11); - OCR1A = 1000; + TCCR1B = (1 << WGM12) | (1 << CS12) | (1 << CS10); + OCR1A = 7200; TIMSK|=(1<