git.droids-corp.org
/
protos
/
xbee-avr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
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 xbeeboard xbeeboard;
volatile uint16_t global_ms;
-struct callout_m
anage
r cm;
+struct callout_m
g
r cm;
#define TIMEOUT_MS 1000
#define TIMEOUT_MS 1000
@@
-501,7
+501,7
@@
void xbee_stdin_disable(void)
xbee_cmdline_input_enabled = 0;
}
xbee_cmdline_input_enabled = 0;
}
-static void evt_timeout(struct callout_m
anage
r *cm, struct callout *clt,
+static void evt_timeout(struct callout_m
g
r *cm, struct callout *clt,
void *arg)
{
struct xbee_ctx *ctx = arg;
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)
{
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)
}
void xbee_unload_timeout(struct xbee_ctx *ctx)
@@
-656,7
+657,7
@@
int main(void)
spi_servo_init();
beep_init();
spi_servo_init();
beep_init();
- callout_m
anage
r_init(&cm, get_time_ms);
+ callout_m
g
r_init(&cm, get_time_ms);
//callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);
/* initialize libxbee */
//callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);
/* initialize libxbee */