Mercurial > ~darius > hgwebdir.cgi > avr
comparison 1wire-config.h @ 41:5898fba6593c
Add temperature control.
- Split out console stuff to cons.[ch]. Set up stdio so we can use printf etc.
- Use \r\n as the line terminator consistently.
- Add OWGetTemp to get temperatures from a device.
- Load/save settings in EEPROM, defaults loaded from flash.
Nearly feature complete except you can't edit ROM IDs without a programming tool :)
(To be fixed)
Needs more testing.
author | darius@inchoate.localdomain |
---|---|
date | Sun, 06 Jul 2008 22:19:53 +0930 |
parents | 0aa6bf4b98ae |
children |
comparison
equal
deleted
inserted
replaced
40:1061fdbdc44f | 41:5898fba6593c |
---|---|
74 #define OWDELAY_H do { _delay_us(48); _delay_us(48); _delay_us(48); \ | 74 #define OWDELAY_H do { _delay_us(48); _delay_us(48); _delay_us(48); \ |
75 _delay_us(48); _delay_us(48); _delay_us(48); _delay_us(48); \ | 75 _delay_us(48); _delay_us(48); _delay_us(48); _delay_us(48); \ |
76 _delay_us(48);_delay_us(48); _delay_us(48); } while (0) /* 480 usec */ | 76 _delay_us(48);_delay_us(48); _delay_us(48); } while (0) /* 480 usec */ |
77 #define OWDELAY_I do { _delay_us(48); _delay_us(22); } while (0) /* 70 usec */ | 77 #define OWDELAY_I do { _delay_us(48); _delay_us(22); } while (0) /* 70 usec */ |
78 | 78 |
79 void uart_putsP(const char *addr); | 79 #ifdef OW_DEBUG |
80 void uart_puts(const char *addr); | 80 #define OWPUTS(x) puts_P(x) |
81 void uart_puts_hex(uint8_t a); | 81 #define OWPUTSP(x) puts_P(x) |
82 void uart_puts_dec(uint8_t a, uint8_t l); | 82 #define OWPRINTFP(fmt, ...) printf_P(fmt, ## __VA_ARGS__) |
83 #if OW_DEBUG | |
84 void uart_putsP(const char *addr); | |
85 void uart_puts(const char *addr); | |
86 void uart_puts_hex(uint8_t a); | |
87 void uart_puts_dec(uint8_t a, uint8_t l); | |
88 | |
89 #define OWPUTS(x) uart_puts(x) | |
90 #define OWPUTSP(x) uart_putsP(x) | |
91 #else | 83 #else |
92 #define OWPUTS(x) | 84 #define OWPUTS(x) |
93 #define OWPUTSP(x) | 85 #define OWPUTSP(x) |
86 #define OWPRINTFP(fmt, ...) | |
94 #endif | 87 #endif |
95 | 88 |