struct xbeeboard xbeeboard;
volatile uint16_t global_ms;
-struct callout_manager cm;
+struct callout_mgr cm;
#define TIMEOUT_MS 1000
break;
}
#endif
+ case RC_PROTO_HELLO: {
+ struct rc_proto_hello *rch =
+ (struct rc_proto_hello *) recvframe->data;
+
+ if (xbee_debug)
+ printf_P(PSTR("recv hello len=%d\r\n"),
+ rch->datalen);
+
+ break;
+ }
default:
return -1;
}
xbee_cmdline_input_enabled = 0;
}
-static void evt_timeout(struct callout_manager *cm, struct callout *clt,
+static void evt_timeout(struct callout_mgr *cm, struct callout *clt,
void *arg)
{
struct xbee_ctx *ctx = arg;
void xbee_load_timeout(struct xbee_ctx *ctx)
{
- callout_reset(&cm, &ctx->timeout, TIMEOUT_MS, SINGLE, evt_timeout, ctx);
+ callout_init(&ctx->timeout, evt_timeout, ctx, 0);
+ callout_schedule(&cm, &ctx->timeout, TIMEOUT_MS);
}
void xbee_unload_timeout(struct xbee_ctx *ctx)
spi_servo_init();
beep_init();
- printf_P(PSTR("\r\n"));
- rdline_newline(&xbeeboard.rdl, xbeeboard.prompt);
-
- callout_manager_init(&cm, get_time_ms);
+ callout_mgr_init(&cm, get_time_ms);
//callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);
/* initialize libxbee */
sei();
eeprom_load_config();
+
+ printf_P(PSTR("\r\n"));
+ rdline_newline(&xbeeboard.rdl, xbeeboard.prompt);
+
xbee_mainloop();
return 0;
}