changeset 65:1ef17cd8af7a

Tab to space conversion in usage text.
author darius@Inchoate
date Sun, 18 Jan 2009 20:03:24 +1030
parents 11c453539d31
children 5c2a1c68e386
files 1wire.h ds1307.c tempctrl.c testavr.c
diffstat 4 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/1wire.h	Sun Jan 18 18:04:01 2009 +1030
+++ b/1wire.h	Sun Jan 18 20:03:24 2009 +1030
@@ -80,6 +80,7 @@
 #define OW_FAMILY_TEMP		0x10
 
 /* Return codes for OWGetTemp */
+/* XXX: make bigger otherwise we can't handle stuff below -10C */
 #define OW_TEMP_BADVAL		-1000
 #define OW_TEMP_WRONG_FAM	-1000
 #define OW_TEMP_CRC_ERR		-1001
@@ -87,4 +88,4 @@
 
 /* Helpers for OWGetTemp's number system */
 #define GETWHOLE(x)	((x) / 100)
-#define GETFRAC(x)	((x) - (GETWHOLE(x) * 100))
+#define GETFRAC(x)	abs((x) - (GETWHOLE(x) * 100))
--- a/ds1307.c	Sun Jan 18 18:04:01 2009 +1030
+++ b/ds1307.c	Sun Jan 18 20:03:24 2009 +1030
@@ -225,10 +225,12 @@
 	    case TW_MR_DATA_NACK:
 		/* Send STOP */
 		TWCR = _BV(TWINT) | _BV(TWSTO) | _BV(TWEN);
+		//printf_P(PSTR("NACK on byte %d\r\n"), cnt);
 		return cnt;
 		
 	    case TW_MR_DATA_ACK:
 		*data++ = TWDR;
+		//printf_P(PSTR("ACK on byte %d for 0x%02x\r\n"), cnt, *(data - 1));
 		cnt++;
 		break;
 
@@ -479,7 +481,7 @@
     } else
 	hour += (rtime.split.pmam << 1) * 10;
 	
-    printf_P(PSTR("%S%04d/%02d/%d %02d:%02d:%02d%S"), leader,
+    printf_P(PSTR("%S%04d/%02d/%02d %02d:%02d:%02d%S"), leader,
 	     1900 + rtime.split.year10 * 10 + rtime.split.year,
 	     rtime.split.month10 * 10 + rtime.split.month,
 	     rtime.split.day10 * 10 + rtime.split.day,
--- a/tempctrl.c	Sun Jan 18 18:04:01 2009 +1030
+++ b/tempctrl.c	Sun Jan 18 20:03:24 2009 +1030
@@ -494,7 +494,7 @@
 		     "                 mcoff        Minimum cool off time\r\n"
 		     "                 mhin Minimum heat on time\r\n"
 		     "                 mhoff        Minimum heat off time\r\n"
-		     "tc A B          Set temperature sensor ID\r\n"
+		     "tc A B           Set temperature sensor ID\r\n"
 		     "                 Where A is ferm, frg or amb\r\n"
 		     "                 and B is of the form xx:xx:xx:xx:xx:xx:xx:xx\r\n"
 		     "\r\n"
--- a/testavr.c	Sun Jan 18 18:04:01 2009 +1030
+++ b/testavr.c	Sun Jan 18 20:03:24 2009 +1030
@@ -208,7 +208,7 @@
 		      "rt ROMID	        Read DS2502 status page\r\n"
 		      "we ROMID adr val Write data into a DS2502 PROM (adr & val in hex)\r\n"
 		      "rr ROMID         Read DS2502 PROM\r\n"
-		      "zz		Reset MCU\r\n"
+		      "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