From 23514f6155cf68009b958d2530565bc5796cee92 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 27 Dec 2023 13:41:20 -0500 Subject: [PATCH] These can stay --- bin/dash2can.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/dash2can.c b/bin/dash2can.c index dd62acf..69c7bd6 100644 --- a/bin/dash2can.c +++ b/bin/dash2can.c @@ -36,7 +36,9 @@ static void usage(int argc, char **argv, const char *message, ...) { exit(1); } -static int ev_handler(struct can_frame *frame, hexagram_can_if *can_if) { +static int ev_handler(struct can_frame *frame, void *ctx) { + hexagram_can_if *can_if = ctx; + return hexagram_can_if_write(can_if, frame); } @@ -98,16 +100,16 @@ int hexagram_main_dash2can(int argc, char **argv) { goto error_can_if_open; } + if ((schedule = hexagram_schedule_create(table, 4, can_if)) == NULL) { + goto error_schedule_create; + } + /* Engine temperature */ table[1].frame.data[1] = (uint8_t)((87.0 / 0.75) + 48); /* Fuel status */ table[2].frame.data[2] = 0x0e; - if ((schedule = hexagram_schedule_create(table, 4, can_if)) == NULL) { - goto error_schedule_create; - } - hexagram_schedule_run(schedule); while (1) {