fix steering implementation

This commit is contained in:
Rémi Heredero 2023-09-04 19:51:31 +02:00
parent 319ae576ad
commit 38b5f2d4e1
2 changed files with 9 additions and 6 deletions

View File

@ -240,10 +240,10 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, bool rtr, uint32_t data){
if(idMsg == 0xF) { // STEERING_ALIVE if(idMsg == 0xF) { // STEERING_ALIVE
// statusH statusL - - // statusH statusL - -
ALIVE_ISALIVE(&steering()->myChecker); ALIVE_ISALIVE(&steering()->myChecker);
if(steering()->myChecker.state == STST_DEAD) { if(steering()->myChecker.state == STAL_DEAD) {
KART_CST.STEERING_ALIVE_TIME = MEM_read_1_byte(MEMADD_STEERING_ALIVE_TIME); KART_CST.STEERING_ALIVE_TIME = MEM_read_1_byte(MEMADD_STEERING_ALIVE_TIME);
ALIVE_emitResurrect(&steering()->myChecker, 0, 0); ALIVE_emitResurrect(&steering()->myChecker, 500, 0);
ALIVE_emitBorn(&steering()->myChecker, 0, 0); ALIVE_emitBorn(&steering()->myChecker, 1000, 0);
} }
} }

View File

@ -45,9 +45,9 @@ bool STEERING_processEvent(Event* ev) {
if (ev->id == evSTstart) { if (ev->id == evSTstart) {
me->state = STST_RUN; me->state = STST_RUN;
} }
ALIVE_setAliveTime(&me->myChecker, KART_CST.STEERING_ALIVE_TIME); // ALIVE_setAliveTime(&me->myChecker, KART_CST.STEERING_ALIVE_TIME);
ALIVE_emitBorn(&me->myChecker, 100, 0); // ALIVE_emitBorn(&me->myChecker, 500, 0);
ALIVE_emitReady(&me->myChecker, 200, 0); // ALIVE_emitReady(&me->myChecker, 1000, 0);
break; break;
case STST_RUN: case STST_RUN:
@ -92,6 +92,9 @@ bool STEERING_processEvent(Event* ev) {
if (me->wait.f != NULL) { if (me->wait.f != NULL) {
me->wait.f(me->wait.p); me->wait.f(me->wait.p);
} }
ALIVE_setAliveTime(&me->myChecker, KART_CST.STEERING_ALIVE_TIME);
ALIVE_emitBorn(&me->myChecker, 500, 0);
ALIVE_emitReady(&me->myChecker, 1000, 0);
break; break;
case STST_RUN: case STST_RUN: