diff main.c @ 73:56165caf744b

Missed some USB related crud + copyright updates.
author darius@Inchoate
date Wed, 21 Jan 2009 18:01:17 +1030
parents 13f8e6eb5c01
children
line wrap: on
line diff
--- a/main.c	Wed Jan 21 16:37:32 2009 +1030
+++ b/main.c	Wed Jan 21 18:01:17 2009 +1030
@@ -1,7 +1,7 @@
 /*
- * Test various AVR bits and pieces
+ * Monitor fermenter temperature and control it by switching cooler & heater.
  *
- * Copyright (c) 2008
+ * Copyright (c) 2009
  *      Daniel O'Connor <darius@dons.net.au>.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,9 +38,6 @@
 
 #include "cons.h"
 #include "1wire.h"
-#ifdef WITHUSB
-#include "usb.h"
-#endif
 #include "tempctrl.h"
 #include "ds1307.h"
 
@@ -74,22 +71,12 @@
     MCUCSR |= _BV(JTD);
 #endif
 
-#ifdef WITHUSB
-    /* USB data bus (7:0) */
-    DDRA = 0x00;
-    PORTA = 0x00;
-    
-    /* USB control (4:0) */
-    DDRB = 0x0d;
-    PORTB = 0x00;
-#else
     DDRA = 0xff;
     PORTA = 0x00;
 
     DDRB = 0x00;
     PORTB = 0x00;
 
-#endif    
     /* GPIO (0:7) */
     DDRC = 0xff;
     PORTC = 0x00;
@@ -98,7 +85,6 @@
     DDRD = 0xf7;
     PORTD = 0xf7;
 
-#ifndef WITHUSB
     /* Beep
      *
      * Fpwm = Fclk / (N * 510)
@@ -110,7 +96,6 @@
      * Phase correct PWM, non-inverted output, divide by 8 */
     TCCR0 = _BV(WGM00) | _BV(WGM11) | _BV(COM00) | _BV(COM01) | _BV(CS01);
     OCR0 = 128;
-#endif
 
     /* Set up the one wire stuff */
     OWInit();
@@ -153,12 +138,6 @@
      */
     wdt_enable(WDTO_2S);
 
-#ifdef WITHUSB
-    printf_P(PSTR("Calling usb_init\r\n"));
-    usb_init();
-    printf_P(PSTR("done\r\n"));
-    _delay_us(1000);
-#endif
     printf_P(PSTR("> "));
     cmd.state = 0;
     
@@ -174,11 +153,6 @@
 	    /* Allow new characters to be processed */
 	    cmd.state = 0;
 	}
-	
-#ifdef WITHUSB
-	if (!(PDICTL & _BV(PDIINT)))
-	    usb_intr();
-#endif
     }
 }
 
@@ -211,9 +185,6 @@
 		      "zz               Reset MCU\r\n"
 		      "gc               Get time of day\r\n"
 		      "sc time          Set time of day (time is YYYY/MM/DD HH:MM:SS)\r\n"
-#ifdef WITHUSB
-		      "us               Generate USB data\r\n"
-#endif
 		      "tc ...           Temperature control related (tc help for more)\r\n"));
 	
 	return;
@@ -552,10 +523,6 @@
 	}
     } else if (!strncasecmp_P((char *)cmd.buf, PSTR("tc"), 2)) {
 	tempctrl_cmd((char *)cmd.buf);
-#ifdef WITHUSB
-    } else if (!strncasecmp_P((char *)cmd.buf, PSTR("us"), 2)) {
-	usb_gendata();
-#endif
     } else if (!strncasecmp_P((char *)cmd.buf, PSTR("gc"), 2)) {
 	ds1307_printtime(PSTR(""), PSTR("\r\n"));
     } else if (!strncasecmp_P((char *)cmd.buf, PSTR("sc"), 2)) {