comparison tempctrl.c @ 70:ea5862987368

Fix up parsing logic.
author darius@Inchoate
date Mon, 19 Jan 2009 22:54:08 +1030
parents 3dcf933f2640
children 553c061fda7c
comparison
equal deleted inserted replaced
69:3dcf933f2640 70:ea5862987368
585 if (!strcasecmp_P(cmd, PSTR("frg"))) 585 if (!strcasecmp_P(cmd, PSTR("frg")))
586 memcpy(settings.fridge_ROM, ROM, sizeof(ROM)); 586 memcpy(settings.fridge_ROM, ROM, sizeof(ROM));
587 if (!strcasecmp_P(cmd, PSTR("amb"))) 587 if (!strcasecmp_P(cmd, PSTR("amb")))
588 memcpy(settings.ambient_ROM, ROM, sizeof(ROM)); 588 memcpy(settings.ambient_ROM, ROM, sizeof(ROM));
589 } 589 }
590 } 590 return;
591 591 }
592
593 /* Handle setting the multitude of variables
594 * It's last to simplify things */
592 if (sscanf_P(buf, PSTR("tc %5s %d"), cmd, &data) != 2) { 595 if (sscanf_P(buf, PSTR("tc %5s %d"), cmd, &data) != 2) {
593 printf_P(PSTR("Unable to parse tc subcommand & value\r\n")); 596 printf_P(PSTR("Unable to parse tc subcommand & value\r\n"));
594 return; 597 return;
595 } 598 }
596 599
610 settings.minheatontime = data; 613 settings.minheatontime = data;
611 } else if (!strcasecmp_P(cmd, PSTR("mhoff"))) { 614 } else if (!strcasecmp_P(cmd, PSTR("mhoff"))) {
612 settings.minheatofftime = data; 615 settings.minheatofftime = data;
613 } else { 616 } else {
614 printf_P(PSTR("Unknown setting\r\n")); 617 printf_P(PSTR("Unknown setting\r\n"));
615 return;
616 } 618 }
617 } 619 }
618 620
619 static const PROGMEM char* 621 static const PROGMEM char*
620 state2long(char s) { 622 state2long(char s) {