From 473d71ff6b906a9dd712e55ded7f1b4086fbc385 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Mon, 4 Sep 2023 10:07:52 +0200 Subject: [PATCH] add const for TRUE or FALSE --- 306-controller_interface.X/app/can_message.c | 4 ++-- 306-controller_interface.X/app/car.h | 3 +++ 306-controller_interface.X/app/drive.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index ba37fed..62442da 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -97,7 +97,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, bool rtr, uint32_t data){ // TODO set alive times // start alives CM_DISPLAY_SETUP(NULL); - CM_STEERING_SETUP(NULL); + CM_STEERING_SETUP(&ALWAYSFALSE); } @@ -129,7 +129,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, bool rtr, uint32_t data){ ALIVE_setAliveTime(&drive()->myChecker, KART_CST.DRIVE_ALIVE_TIME); ALIVE_emitStart(&drive()->myChecker, 0, 0); - CM_DRIVE_SETUP(NULL); + CM_DRIVE_SETUP(&ALWAYSFALSE); } diff --git a/306-controller_interface.X/app/car.h b/306-controller_interface.X/app/car.h index dfea2a5..05203c8 100644 --- a/306-controller_interface.X/app/car.h +++ b/306-controller_interface.X/app/car.h @@ -44,6 +44,9 @@ #define MEMADD_BATTERY_ENERGY_TIME 0x1C #define MEMADD_BATTERY_ALIVE_TIME 0x1D +const bool ALWAYSTRUE = true; +const bool ALWAYSFALSE = false; + typedef struct { uint8_t CONTROL_STEERING_MODE; uint8_t CONTROL_ALIVE_TIME; diff --git a/306-controller_interface.X/app/drive.c b/306-controller_interface.X/app/drive.c index f926b1f..72c7fb7 100644 --- a/306-controller_interface.X/app/drive.c +++ b/306-controller_interface.X/app/drive.c @@ -12,7 +12,7 @@ void DRIVE_init(DRIVE* me){ me->state = STDR_INIT; ALIVE_init(&me->myChecker); - ALIVE_onSetup(&me->myChecker, CM_DRIVE_SETUP, NULL); + ALIVE_onSetup(&me->myChecker, CM_DRIVE_SETUP, &ALWAYSTRUE); ALIVE_onWait(&me->myChecker, DRIVE_emitStart, me); ALIVE_onDead(&me->myChecker, DRIVE_emitStop, me); ALIVE_onBorn(&me->myChecker, DRIVE_emitResurrect, me);