diff 1wire-config.h @ 33:0aa6bf4b98ae

- Don't wrap individual debug statements in ifdef, use a conditionally defined macro instead. - Add OWProgROM routine, can't remember if I actually tested it tho :)
author darius
date Tue, 23 Oct 2007 10:51:35 +0930
parents b0cb873c0206
children 5898fba6593c
line wrap: on
line diff
--- a/1wire-config.h	Sun Apr 23 22:57:16 2006 +0930
+++ b/1wire-config.h	Tue Oct 23 10:51:35 2007 +0930
@@ -54,6 +54,11 @@
  */
 #define OWSETBUSHIGH()		PORTD &= ~_BV(4)
 
+/* Turn Vpp on (ie put +12V on the bus
+ * This is optional, if it is undefined OWProgROM always fails */
+#define OWSETVPPON()		PORTD |= _BV(5)
+#define OWSETVPPOFF()		PORTD &= ~_BV(5)
+
 /* _delay_us can only do a delay of 768/clock_freq */
 #if F_CPU > 16000000
 #error F_CPU > 16MHz, delays need adjusting
@@ -70,3 +75,21 @@
 	_delay_us(48);	_delay_us(48);  _delay_us(48);  _delay_us(48);  \
 	_delay_us(48);_delay_us(48);  _delay_us(48); } while (0)	/* 480 usec */
 #define OWDELAY_I do { _delay_us(48); _delay_us(22); } while (0)	/* 70 usec */
+
+void		uart_putsP(const char *addr);
+void		uart_puts(const char *addr);
+void		uart_puts_hex(uint8_t a);
+void		uart_puts_dec(uint8_t a, uint8_t l);
+#if OW_DEBUG
+void		uart_putsP(const char *addr);
+void		uart_puts(const char *addr);
+void		uart_puts_hex(uint8_t a);
+void		uart_puts_dec(uint8_t a, uint8_t l);
+
+#define OWPUTS(x)		uart_puts(x)
+#define OWPUTSP(x)		uart_putsP(x)
+#else
+#define OWPUTS(x)
+#define OWPUTSP(x)
+#endif
+