From 0e9c61ca0cd870f93f6e2d9a873677b7832336a0 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Sat, 19 May 2007 13:12:00 +0000 Subject: [PATCH] The PT_* macros contain return statements so a function using them must return a value. --- core/net/mac/xmac.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core/net/mac/xmac.c b/core/net/mac/xmac.c index 2c1e1e95d..e094cc5b2 100644 --- a/core/net/mac/xmac.c +++ b/core/net/mac/xmac.c @@ -30,7 +30,7 @@ * * This file is part of the Contiki operating system. * - * $Id: xmac.c,v 1.2 2007/05/15 08:07:07 adamdunkels Exp $ + * $Id: xmac.c,v 1.3 2007/05/19 13:12:00 oliverschmidt Exp $ */ /** @@ -113,7 +113,7 @@ static const struct radio_driver *radio; #endif /*---------------------------------------------------------------------------*/ -static void +static char powercycle(struct rtimer *t, void *ptr) { PT_BEGIN(&pt); @@ -132,7 +132,8 @@ powercycle(struct rtimer *t, void *ptr) should_be_awake = 0; } } - if(rtimer_set(t, RTIMER_TIME(t) + OFF_TIME, 1, powercycle, ptr)) { + if(rtimer_set(t, RTIMER_TIME(t) + OFF_TIME, 1, + (void (*)(struct rtimer *, void *))powercycle, ptr)) { PRINTF("xmac: could not set rtimer\n"); } t2 = rtimer_arch_now(); @@ -150,7 +151,8 @@ powercycle(struct rtimer *t, void *ptr) radio_is_on = 1; LEDS_ON(LEDS_RED); } - if(rtimer_set(t, RTIMER_TIME(t) + ON_TIME, 1, powercycle, ptr)) { + if(rtimer_set(t, RTIMER_TIME(t) + ON_TIME, 1, + (void (*)(struct rtimer *, void *))powercycle, ptr)) { PRINTF("xmac: could not set rtimer\n"); } t2 = rtimer_arch_now(); @@ -264,7 +266,8 @@ send(void) LEDS_OFF(LEDS_GREEN); PT_INIT(&pt); - if(rtimer_set(&rt, RTIMER_NOW() + ON_TIME, 1, powercycle, NULL)) { + if(rtimer_set(&rt, RTIMER_NOW() + ON_TIME, 1, + (void (*)(struct rtimer *, void *))powercycle, NULL)) { PRINTF("xmac: could not set rtimer after send\n"); } we_are_sending = 0; @@ -357,7 +360,8 @@ xmac_init(const struct radio_driver *d) radio_is_on = 0; should_be_awake = 0; PT_INIT(&pt); - rtimer_set(&rt, RTIMER_NOW() + OFF_TIME, 1, powercycle, NULL); + rtimer_set(&rt, RTIMER_NOW() + OFF_TIME, 1, + (void (*)(struct rtimer *, void *))powercycle, NULL); rime_set_output(qsend); radio = d;