diff tempctrl.c @ 73:56165caf744b

Missed some USB related crud + copyright updates.
author darius@Inchoate
date Wed, 21 Jan 2009 18:01:17 +1030
parents 553c061fda7c
children ca5fc59ec4f0
line wrap: on
line diff
--- a/tempctrl.c	Wed Jan 21 16:37:32 2009 +1030
+++ b/tempctrl.c	Wed Jan 21 18:01:17 2009 +1030
@@ -1,7 +1,7 @@
 /*
  * Temperature control logic
  *
- * 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
@@ -81,10 +81,8 @@
     int16_t	check_interval;
     int16_t	stale_factor;
 
-#ifndef WITHUSB
     /* Beep if stale */
     int8_t	dobeep;
-#endif
 } __attribute__((packed)) settings_t;
 
 /* Current settings in RAM */
@@ -115,17 +113,13 @@
     .idlebits = 0x00,
     .check_interval = 10,
     .stale_factor = 3,
-#ifndef WITHUSB
     .dobeep = 0
-#endif
 };
 
 /* Local variable declarations */
 volatile static time_t	now;
-#ifndef WITHUSB
 volatile static uint8_t beeping = 0;
 volatile static uint8_t lasttoggle = 0;
-#endif
 
 /* Local function prototypes */
 static void		tempctrl_load_or_init_settings(void);
@@ -176,7 +170,6 @@
 	now.sec++;
     }
 
-#ifndef WITHUSB
     if (beeping) {
 	lasttoggle++;
 	// 63 * 8ms = ~0.5s
@@ -188,7 +181,6 @@
 	DDRB &= ~_BV(PB3);
 	lasttoggle = 0;
     }
-#endif    
 }
 
 /* 
@@ -296,13 +288,11 @@
     if (stale)
 	nextstate = 'i';
     
-#ifndef WITHUSB
 /* Handle beeping */
     if (settings.dobeep && stale)
 	beeping = 1;
     else
 	beeping = 0;
-#endif
 	
     /* Handle state forcing */
     if (settings.mode != TC_MODE_AUTO)
@@ -482,9 +472,7 @@
 		     "                 h    Always heat\r\n"
 		     "                 i    Always idle\r\n"
 		     "                 n    Like idle but don't log anything\r\n"
-#ifndef WITHUSB
 		     "tc beep [01]    Enable/disable beeping when data is stale\r\n"
-#endif
 		     "tc X Y          Set X to Y where X is one of\r\n"
 		     "                 targ Target temperature\r\n"
 		     "                 hys  Hysteresis range\r\n"
@@ -524,9 +512,7 @@
 		      "Min heat overshoot - %d, Min cool overshoot - %d\r\n"
 		      "Min cool on time - %d, Min cool off time - %d\r\n"
 		      "Min heat on time - %d, Min heat off time - %d\r\n"
-#ifndef WITHUSB
 		      "Beep on stale - %S\r\n"
-#endif
 		     ),
 		 settings.fermenter_ROM[0], settings.fermenter_ROM[1], settings.fermenter_ROM[2], settings.fermenter_ROM[3], 
 		 settings.fermenter_ROM[4], settings.fermenter_ROM[5], settings.fermenter_ROM[6], settings.fermenter_ROM[7], 
@@ -538,9 +524,7 @@
 		 settings.minheatovershoot, settings.mincoolovershoot,
 		 settings.mincoolontime, settings.minheatontime,
 		 settings.minheatontime, settings.minheatofftime,
-#ifndef WITHUSB
 		 settings.dobeep ? PSTR("yes") : PSTR("no")
-#endif
 	    );
 	return;
     }
@@ -560,7 +544,6 @@
 	}
 	return;
     }
-#ifndef WITHUSB
     if (!strcasecmp_P(cmd, PSTR("beep"))) {
 	if (buf[8] == '1' || buf[8] == 'y')
 	    settings.dobeep = 1;
@@ -570,7 +553,6 @@
 	    printf_P(PSTR("Expected a y/1 or n/0\r\n"));
 	return;
     }
-#endif
     if (!strcasecmp_P(cmd, PSTR("ferm")) ||
 	!strcasecmp_P(cmd, PSTR("frg")) ||
 	!strcasecmp_P(cmd, PSTR("amb"))) {