Mercurial > ~darius > hgwebdir.cgi > tempctrl
annotate testavr.c @ 53:98b5a43fc748
Disable WDT in reset just in case we take too long (eg after reset when the
timer is set to a short time)
author | darius@Inchoate |
---|---|
date | Wed, 29 Oct 2008 16:11:15 +1030 |
parents | 3217e93b28a3 |
children | 58f1ec46bff6 |
rev | line source |
---|---|
0 | 1 /* |
9
7ed10c59ba06
Supply clock speed via the command line so 1wire-delay.h can use it.
darius
parents:
7
diff
changeset
|
2 * Test various AVR bits and pieces |
7ed10c59ba06
Supply clock speed via the command line so 1wire-delay.h can use it.
darius
parents:
7
diff
changeset
|
3 * |
41 | 4 * Copyright (c) 2008 |
0 | 5 * Daniel O'Connor <darius@dons.net.au>. All rights reserved. |
6 * | |
7 * Redistribution and use in source and binary forms, with or without | |
8 * modification, are permitted provided that the following conditions | |
9 * are met: | |
10 * 1. Redistributions of source code must retain the above copyright | |
11 * notice, this list of conditions and the following disclaimer. | |
12 * 2. Redistributions in binary form must reproduce the above copyright | |
13 * notice, this list of conditions and the following disclaimer in the | |
14 * documentation and/or other materials provided with the distribution. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
19 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE | |
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 * SUCH DAMAGE. | |
27 */ | |
28 | |
29 #include <avr/io.h> | |
30 #include <avr/interrupt.h> | |
31 #include <avr/pgmspace.h> | |
41 | 32 #include <stdio.h> |
0 | 33 #include <string.h> |
4 | 34 #include <ctype.h> |
13 | 35 #include <stdlib.h> |
24 | 36 #include <util/delay.h> |
47 | 37 #include <avr/wdt.h> |
0 | 38 |
41 | 39 #include "cons.h" |
0 | 40 #include "1wire.h" |
37 | 41 #ifdef WITHUSB |
24 | 42 #include "usb.h" |
37 | 43 #endif |
41 | 44 #include "tempctrl.h" |
24 | 45 |
47 | 46 /* |
47 * Mirror of the MCUCSR register, taken early during startup. | |
48 */ | |
49 uint8_t mcucsr __attribute__((section(".noinit"))); | |
50 | |
24 | 51 void process_cmd(void); |
0 | 52 |
47 | 53 /* |
54 * Read out and reset MCUCSR early during startup. | |
55 */ | |
56 void handle_mcucsr(void) | |
57 __attribute__((section(".init3"))) | |
58 __attribute__((naked)); | |
59 void handle_mcucsr(void) { | |
53
98b5a43fc748
Disable WDT in reset just in case we take too long (eg after reset when the
darius@Inchoate
parents:
52
diff
changeset
|
60 wdt_disable(); |
47 | 61 mcucsr = MCUCSR; |
62 MCUCSR = 0; | |
63 } | |
64 | |
24 | 65 int |
66 main(void) { | |
67 /* Disable interrupts while we frob stuff */ | |
68 cli(); | |
69 | |
41 | 70 #if 0 |
24 | 71 /* Disable JTAG (yes twice) */ |
72 MCUCSR |= _BV(JTD); | |
73 MCUCSR |= _BV(JTD); | |
37 | 74 #endif |
75 | |
76 #ifdef WITHUSB | |
24 | 77 /* USB data bus (7:0) */ |
78 DDRA = 0x00; | |
79 PORTA = 0x00; | |
80 | |
37 | 81 /* USB control (4:0) */ |
82 DDRB = 0x0d; | |
24 | 83 PORTB = 0x00; |
37 | 84 #else |
85 DDRA = 0xff; | |
86 PORTA = 0x00; | |
87 #endif | |
24 | 88 /* GPIO (0:7) */ |
89 DDRC = 0xff; | |
90 PORTC = 0x00; | |
91 | |
37 | 92 /* USART (0:1), IDBus (2:5), 485 (6:6), GPIO (7:7) */ |
93 DDRD = 0xf7; | |
94 PORTD = 0xf7; | |
95 | |
96 /* Set up the one wire stuff */ | |
97 OWInit(); | |
24 | 98 |
99 /* Init UART */ | |
41 | 100 cons_init(); |
24 | 101 |
41 | 102 printf_P(PSTR("\r\n\r\n===============\r\n" |
103 "Inited!\r\n\r\n")); | |
24 | 104 |
47 | 105 if ((mcucsr & _BV(PORF)) == _BV(PORF)) |
106 printf_P(PSTR("Power on reset\r\n")); | |
107 | |
108 if ((mcucsr & _BV(EXTRF)) == _BV(EXTRF)) | |
109 printf_P(PSTR("External reset\r\n")); | |
110 | |
111 if ((mcucsr & _BV(BORF)) == _BV(BORF)) | |
112 printf_P(PSTR("Brown-out reset\r\n")); | |
113 | |
114 if ((mcucsr & _BV(WDRF)) == _BV(WDRF)) | |
115 printf_P(PSTR("Watchdog reset\r\n")); | |
116 | |
117 if ((mcucsr & _BV(JTRF)) == _BV(JTRF)) | |
118 printf_P(PSTR("JTAG reset\r\n")); | |
119 | |
41 | 120 tempctrl_init(); |
121 | |
24 | 122 /* Ready to go! */ |
123 sei(); | |
124 | |
47 | 125 /* |
126 * Enable the watchdog with the largest prescaler. Will cause a | |
127 * watchdog reset after approximately 2 s @ Vcc = 5 V | |
128 * | |
129 * Gets reset in the loop below and in the tempctrl.c timer IRQ | |
130 */ | |
131 wdt_enable(WDTO_2S); | |
132 | |
37 | 133 #ifdef WITHUSB |
41 | 134 printf_P(PSTR("Calling usb_init\r\n")); |
24 | 135 usb_init(); |
41 | 136 printf_P(PSTR("done\r\n")); |
137 _delay_us(1000); | |
37 | 138 #endif |
41 | 139 printf_P(PSTR("> ")); |
24 | 140 cmd.state = 0; |
141 | |
142 /* Wait for user input or an "interrupt" */ | |
143 while (1) { | |
47 | 144 wdt_reset(); |
145 | |
41 | 146 tempctrl_update(); |
147 | |
24 | 148 if (cmd.state == 255) { |
149 process_cmd(); | |
41 | 150 printf_P(PSTR("> ")); |
24 | 151 /* Allow new characters to be processed */ |
152 cmd.state = 0; | |
153 } | |
154 | |
37 | 155 #ifdef WITHUSB |
156 if (!(PDICTL & _BV(PDIINT))) | |
24 | 157 usb_intr(); |
37 | 158 #endif |
24 | 159 } |
160 } | |
161 | |
162 void | |
163 process_cmd(void) { | |
52
3217e93b28a3
Missed variable declaration changes from previous commit.
darius@Inchoate
parents:
51
diff
changeset
|
164 uint8_t ROM[8], crc, buf[9], temp; |
24 | 165 int8_t i, arg; |
52
3217e93b28a3
Missed variable declaration changes from previous commit.
darius@Inchoate
parents:
51
diff
changeset
|
166 int16_t t; |
0 | 167 |
24 | 168 /* User just pressed enter */ |
169 if (cmd.len == 0) | |
170 return; | |
171 | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
172 if (!strcasecmp_P((char *)cmd.buf, PSTR("?")) || |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
173 !strcasecmp_P((char *)cmd.buf, PSTR("help"))) { |
41 | 174 printf_P(PSTR("rs Reset and check for presence\r\n" |
175 "sr Search the bus for ROMs\r\n" | |
176 "re Read a bit\r\n" | |
177 "rb Read a byte\r\n" | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
178 "wr bit Write a bit\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
179 "wb byte Write a byte (hex)\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
180 "wc cmd [ROMID] Write command\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
181 "te ROMID Read the temperature from a DS1820\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
182 "in port Read from a port\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
183 "ou port val Write to a port (val in hex)\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
184 "dd port [val] Read/write DDR for a port (val in hex)\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
185 "rt ROMID Read DS2502 status page\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
186 "we ROMID adr val Write data into a DS2502 PROM (adr & val in hex)\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
187 "rr ROMID Read DS2502 PROM\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
188 "zz Reset MCU\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
189 #ifdef WITHUSB |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
190 "us Generate USB data\r\n" |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
191 #endif |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
192 "tc ... Temperature control related (tc help for more)\r\n")); |
41 | 193 |
24 | 194 return; |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
195 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("zz"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
196 cli(); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
197 wdt_enable(WDTO_15MS); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
198 for (;;) |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
199 ; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
200 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("rs"), 2)) { |
41 | 201 printf_P(PSTR("Resetting... ")); |
4 | 202 |
24 | 203 if (OWTouchReset() == 1) |
41 | 204 printf_P(PSTR("No presence pulse found\r\n")); |
24 | 205 else |
41 | 206 printf_P(PSTR("Presence pulse found\r\n")); |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
207 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("re"), 2)) { |
24 | 208 if (OWReadBit()) |
41 | 209 printf_P(PSTR("Read a 1\r\n")); |
24 | 210 else |
41 | 211 printf_P(PSTR("Read a 0\r\n")); |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
212 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("rb"), 2)) { |
41 | 213 printf_P(PSTR("Read a 0x%02x\r\n"), OWReadByte()); |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
214 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("wr"), 2)) { |
24 | 215 arg = strtol((char *)cmd.buf + 3, (char **)NULL, 10); |
216 OWWriteBit(arg); | |
41 | 217 printf_P(PSTR("Wrote a %c\r\n"), arg ? '1' : '0'); |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
218 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("wb"), 2)) { |
24 | 219 arg = (int)strtol((char *)cmd.buf + 3, (char **)NULL, 16); |
220 OWWriteByte(arg); | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
221 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("rt"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
222 if (sscanf_P((char *)cmd.buf, PSTR("rt %hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx"), |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
223 &ROM[0], &ROM[1], &ROM[2], &ROM[3], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
224 &ROM[4], &ROM[5], &ROM[6], &ROM[7]) != 8) { |
41 | 225 printf_P(PSTR("Unable to parse ROM ID\r\n")); |
37 | 226 return; |
227 } | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
228 |
37 | 229 if (ROM[0] != OW_FAMILY_ROM) { |
41 | 230 printf_P(PSTR("ROM specified isn't a DS2502\r\n")); |
37 | 231 return; |
232 } | |
233 | |
234 if (OWTouchReset() != 0) { | |
41 | 235 printf_P(PSTR("No presence\r\n")); |
37 | 236 return; |
237 } | |
238 | |
239 crc = 0; | |
240 | |
241 OWCRC(OW_READ_STATUS, &crc); | |
242 OWSendCmd(ROM, OW_READ_STATUS); | |
243 | |
244 OWWriteByte(0x00); | |
245 OWCRC(0x00, &crc); | |
246 | |
247 OWWriteByte(0x00); | |
248 OWCRC(0x00, &crc); | |
249 | |
250 if (crc != OWReadByte()) { | |
41 | 251 printf_P(PSTR("CRC mismatch on command & address\r\n")); |
37 | 252 return; |
253 } | |
254 | |
255 crc = 0; | |
256 for (i = 0; i < 8; i++) { | |
257 temp = OWReadByte(); | |
41 | 258 printf_P(PSTR("%02x "), temp); |
37 | 259 OWCRC(temp, &crc); |
260 } | |
41 | 261 printf_P(PSTR("\r\n")); |
37 | 262 if (crc != OWReadByte()) { |
41 | 263 printf_P(PSTR("CRC mismatch on data\r\n")); |
37 | 264 return; |
265 } | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
266 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("we"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
267 uint8_t adr, data; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
268 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
269 if (sscanf_P((char *)cmd.buf, PSTR("we %hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx %hhx %hhx"), |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
270 &ROM[0], &ROM[1], &ROM[2], &ROM[3], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
271 &ROM[4], &ROM[5], &ROM[6], &ROM[7], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
272 &adr, &data) != 10) { |
41 | 273 printf_P(PSTR("Unable to parse ROM ID\r\n")); |
37 | 274 return; |
275 } | |
276 | |
277 if (ROM[0] != OW_FAMILY_ROM) { | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
278 printf_P(PSTR("ID specified isn't a ROM\r\n")); |
37 | 279 return; |
280 } | |
281 | |
282 if (OWTouchReset() != 0) { | |
41 | 283 printf_P(PSTR("No presence\r\n")); |
37 | 284 return; |
285 } | |
286 | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
287 printf_P(PSTR("OWProgROM returned %S\r\n"), OWProgROM_Status[OWProgROM(ROM, buf[0], 2, &buf[1], 0, 0)]); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
288 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("rr"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
289 if (sscanf_P((char *)cmd.buf, PSTR("rr %hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx"), |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
290 &ROM[0], &ROM[1], &ROM[2], &ROM[3], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
291 &ROM[4], &ROM[5], &ROM[6], &ROM[7]) != 8) { |
41 | 292 printf_P(PSTR("Unable to parse ROM ID\r\n")); |
37 | 293 return; |
294 } | |
295 | |
296 if (ROM[0] != OW_FAMILY_ROM) { | |
41 | 297 printf_P(PSTR("ROM specified isn't a ROM\r\n")); |
37 | 298 return; |
299 } | |
300 | |
301 crc = 0; | |
302 OWSendCmd(ROM, OW_READ_MEMORY); | |
303 OWCRC(OW_READ_MEMORY, &crc); | |
304 | |
305 OWWriteByte(0x00); | |
306 OWCRC(0x00, &crc); | |
307 | |
308 OWWriteByte(0x00); | |
309 OWCRC(0x00, &crc); | |
310 | |
311 if (crc != OWReadByte()) { | |
41 | 312 printf_P(PSTR("CRC mismatch on command & address\r\n")); |
37 | 313 return; |
314 } | |
315 | |
316 crc = 0; | |
317 for (buf[0] = 0; buf[0] < 128; buf[0]++) { | |
318 buf[1] = OWReadByte(); | |
319 if (buf[0] > 0) { | |
320 if (buf[0] % 16 != 0) | |
41 | 321 printf_P(PSTR(" ")); |
37 | 322 else |
41 | 323 printf_P(PSTR("\r\n")); |
37 | 324 } |
325 | |
41 | 326 printf_P(PSTR("%02x"), buf[1]); |
37 | 327 OWCRC(buf[1], &crc); |
328 } | |
41 | 329 printf_P(PSTR("\r\n")); |
37 | 330 if (crc != OWReadByte()) { |
41 | 331 printf_P(PSTR("CRC mismatch on data\r\n")); |
37 | 332 return; |
333 } | |
334 | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
335 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("wc"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
336 uint8_t c; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
337 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
338 i = sscanf_P((char *)cmd.buf, PSTR("wc %hhx %hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx"), |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
339 &ROM[0], &ROM[1], &ROM[2], &ROM[3], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
340 &ROM[4], &ROM[5], &ROM[6], &ROM[7], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
341 &c); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
342 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
343 if (i != 1 && i != 9) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
344 printf_P(PSTR("Incorrect usage\r\n")); |
24 | 345 return; |
346 } | |
347 | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
348 if (i == 1) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
349 OWSendCmd(i == 1 ? NULL : ROM, c); |
24 | 350 return; |
351 } | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
352 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("te"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
353 if (sscanf_P((char *)cmd.buf, PSTR("te %hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx:%hhx"), |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
354 &ROM[0], &ROM[1], &ROM[2], &ROM[3], |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
355 &ROM[4], &ROM[5], &ROM[6], &ROM[7]) != 8) { |
41 | 356 printf_P(PSTR("Unable to parse ROM ID\r\n")); |
24 | 357 return; |
358 } | |
359 | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
360 t = OWGetTemp(ROM); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
361 switch (t) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
362 case OW_TEMP_WRONG_FAM: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
363 printf_P(PSTR("ROM specified isn't a temperature sensor\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
364 break; |
24 | 365 |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
366 case OW_TEMP_CRC_ERR: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
367 printf_P(PSTR("CRC mismatch\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
368 break; |
41 | 369 |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
370 case OW_TEMP_NO_ROM: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
371 printf_P(PSTR("No ROM found\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
372 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
373 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
374 default: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
375 printf_P(PSTR("%d.%02d\r\n"), GETWHOLE(t), GETFRAC(t)); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
376 break; |
24 | 377 } |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
378 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("sr"), 2)) { |
24 | 379 memset(ROM, 0, 8); |
10 | 380 |
24 | 381 i = OWFirst(ROM, 1, 0); |
382 do { | |
383 switch (i) { | |
10 | 384 case OW_BADWIRE: |
41 | 385 printf_P(PSTR("Presence pulse, but no module found, bad module/cabling?\r\n")); |
10 | 386 break; |
387 | |
388 case OW_NOPRESENCE: | |
41 | 389 printf_P(PSTR("No presence pulse found\r\n")); |
10 | 390 break; |
391 | |
392 case OW_BADCRC: | |
41 | 393 printf_P(PSTR("Bad CRC\r\n")); |
10 | 394 break; |
395 | |
396 case OW_NOMODULES: | |
397 case OW_FOUND: | |
398 break; | |
399 | |
400 default: | |
41 | 401 printf_P(PSTR("Unknown error from 1 wire library\r\n")); |
10 | 402 break; |
24 | 403 } |
10 | 404 |
24 | 405 if (i != OW_FOUND) |
406 break; | |
13 | 407 |
41 | 408 for (i = 0; i < 8; i++) |
409 printf_P(PSTR("%02x%S"), ROM[i], i == 7 ? PSTR("\r\n") : PSTR(":")); | |
10 | 410 |
24 | 411 i = OWNext(ROM, 1, 0); |
412 } while (1); | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
413 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("in"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
414 uint8_t inp; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
415 |
24 | 416 switch (tolower(cmd.buf[3])) { |
417 case 'a': | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
418 inp = PINA; |
24 | 419 break; |
420 | |
421 case 'b': | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
422 inp = PINB; |
24 | 423 break; |
424 | |
425 case 'c': | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
426 inp = PINC; |
24 | 427 break; |
428 | |
429 case 'd': | |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
430 inp = PIND; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
431 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
432 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
433 default: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
434 printf_P(PSTR("Unknown port\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
435 return; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
436 } |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
437 printf_P(PSTR("0x%02x\r\n"), inp); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
438 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("ou"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
439 char port; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
440 int val; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
441 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
442 if (sscanf_P((char *)cmd.buf, PSTR("ou %c %x"), &port, &val) != 2) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
443 printf_P(PSTR("Unable to parse ou arguments\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
444 return; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
445 } |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
446 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
447 switch (port) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
448 case 'a': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
449 PORTA = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
450 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
451 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
452 case 'b': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
453 PORTB = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
454 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
455 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
456 case 'c': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
457 PORTC = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
458 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
459 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
460 case 'd': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
461 PORTD = val & 0xff; |
24 | 462 break; |
463 | |
464 default: | |
41 | 465 printf_P(PSTR("Unknown port\r\n")); |
24 | 466 return; |
0 | 467 } |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
468 printf_P(PSTR("PORT%c <= 0x%02x\r\n"), toupper(port), val); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
469 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("dd"), 2)) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
470 char port; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
471 uint8_t val; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
472 int num; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
473 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
474 num = sscanf_P((char *)cmd.buf, PSTR("dd %c %x"), &port, &val); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
475 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
476 if (num != 2 && num != 3) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
477 printf_P(PSTR("Unable to parse dd arguments\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
478 return; |
24 | 479 } |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
480 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
481 if (num == 2) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
482 switch (port) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
483 case 'a': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
484 val = DDRA; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
485 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
486 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
487 case 'b': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
488 val = DDRB; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
489 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
490 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
491 case 'c': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
492 val = DDRC; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
493 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
494 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
495 case 'd': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
496 val = DDRD; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
497 break; |
37 | 498 |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
499 default: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
500 printf_P(PSTR("Unknown port\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
501 return; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
502 } |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
503 printf_P(PSTR("DDR%c => 0x%02x\r\n"), toupper(port), val); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
504 } else { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
505 switch (port) { |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
506 case 'a': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
507 DDRA = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
508 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
509 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
510 case 'b': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
511 DDRB = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
512 break; |
37 | 513 |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
514 case 'c': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
515 DDRC = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
516 break; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
517 |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
518 case 'd': |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
519 DDRD = val & 0xff; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
520 break; |
37 | 521 |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
522 default: |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
523 printf_P(PSTR("Unknown port\r\n")); |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
524 return; |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
525 } |
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
526 printf_P(PSTR("DDR%c <= 0x%02x\r\n"), toupper(port), val); |
37 | 527 } |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
528 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("tc"), 2)) { |
41 | 529 tempctrl_cmd((char *)cmd.buf); |
37 | 530 #ifdef WITHUSB |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
531 } else if (!strncasecmp_P((char *)cmd.buf, PSTR("us"), 2)) { |
24 | 532 usb_gendata(); |
37 | 533 #endif |
24 | 534 } else { |
51
cb184206344d
Rejig command parsing and assume the compiler isn't dumb (eg it can reuse
darius@Inchoate
parents:
47
diff
changeset
|
535 printf_P(PSTR("Unknown command, help for a list\r\n")); |
0 | 536 } |
24 | 537 } |
0 | 538 |
539 |