param = &res->u32;
}
else {
- printf("Unknown argument type\n");
+ printf_P(PSTR("Unknown argument type\r\n"));
return;
}
memcpy_P(&cmd, copy.name, 2);
}
else if (!strcmp(res->action, "start")) {
if (range_running) {
- printf("already running\n");
+ printf_P(PSTR("already running\r\n"));
return;
}
range_cur_count = range_count;
}
else if (!strcmp(res->action, "end")) {
if (range_running == 0) {
- printf("not running\n");
+ printf_P(PSTR("not running\r\n"));
return;
}
range_running = 0;
struct cmd_range_period_result *res = parsed_result;
if (res->period < 10) {
- printf("error, minimum period is 10 ms\n");
+ printf_P(PSTR("error, minimum period is 10 ms\r\n"));
return;
}
printf_P(PSTR("monitor period is %d ms, %d regs in list\r\n"),
monitor_period_ms, monitor_count);
LIST_FOREACH(m, &xbee_monitor_list, next)
- printf_P(PSTR(" %S\n"), m->desc);
+ printf_P(PSTR(" %S\r\n"), m->desc);
}
else if (!strcmp_P(res->action, PSTR("start"))) {
if (monitor_running) {
- printf("already running\n");
+ printf_P(PSTR("already running\r\n"));
return;
}
if (monitor_count == 0) {
- printf("no regs to be monitored\n");
+ printf_P(PSTR("no regs to be monitored\r\n"));
return;
}
callout_init(&monitor_event);
}
else if (!strcmp_P(res->action, PSTR("end"))) {
if (monitor_running == 0) {
- printf("not running\n");
+ printf_P(PSTR("not running\r\n"));
return;
}
monitor_running = 0;
}
if (m != NULL) {
- printf("already exist\n");
+ printf_P(PSTR("already exist\r\n"));
return;
}
m = malloc(sizeof(*m));
if (m == NULL) {
- printf("no mem\n");
+ printf_P(PSTR("no mem\r\n"));
return;
}
m->desc = copy.desc;
struct cmd_monitor_period_result *res = parsed_result;
if (res->period < 100) {
- printf("error, minimum period is 100 ms\n");
+ printf_P(PSTR("error, minimum period is 100 ms\r\n"));
return;
}
free(res->m);
monitor_count --;
if (monitor_count == 0) {
- printf("Disable monitoring, no more event\n");
+ printf_P(PSTR("Disable monitoring, no more event\r\n"));
callout_stop(&cm, &monitor_event);
monitor_running = 0;
return;
/* function called when cmd_raw is parsed successfully */
static void cmd_raw_parsed(void *parsed_result, void *data)
{
- printf("switched to raw mode, CTRL-D to exit\n");
+ printf_P(PSTR("switched to raw mode, CTRL-D to exit\r\n"));
rdline_stop(&xbeeboard.rdl); /* don't display prompt when return */
xbee_raw = 1;
}