use callout from aversive
[protos/xbee-avr.git] / main.c
diff --git a/main.c b/main.c
index c3511b5..3959ee4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -58,7 +58,7 @@
 
 struct xbeeboard xbeeboard;
 volatile uint16_t global_ms;
-struct callout_manager cm;
+struct callout_mgr cm;
 
 #define TIMEOUT_MS 1000
 
@@ -501,7 +501,7 @@ void xbee_stdin_disable(void)
        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;
@@ -521,7 +521,8 @@ static void evt_timeout(struct callout_manager *cm, struct callout *clt,
 
 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)
@@ -656,7 +657,7 @@ int main(void)
        spi_servo_init();
        beep_init();
 
-       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 */