summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--ferment.c23
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 <http://savannah.nongnu.org/projects/avrdude>
# 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<<OCIE1A);
}
ISR(TIMER1_COMPA_vect)
{
- serial_send("*\n", 2, 1);
+ serial_send("*\r\n", 3, 1);
start_temp_conv();
}
@@ -118,10 +118,13 @@ int main(void)
sei();
+ bridge_on_cool();
while (1) {
- sprintf(params, "%u\n", adc_res);
- serial_send(params, strlen(params), 1);
- //bridge_on_a();
- _delay_ms(1000);
+ if (adc_new) {
+ sprintf(params, "%u\r\n", adc_res);
+ serial_send(params, strlen(params), 1);
+ adc_new = 0;
+ }
+ _delay_ms(100);
}
}