add blinker

This commit is contained in:
2023-08-30 20:22:44 +02:00
parent 7550d1907b
commit 00130b03ee
5 changed files with 376 additions and 0 deletions

View File

@ -30,6 +30,10 @@ LED* l8() {
return &theFactory.l8_;
}
BLINKER* b1() {
return &theFactory.b1_;
}
ALIVE* ALcontroller(){
return &theFactory.ALcontroller_;
}
@ -58,6 +62,8 @@ void Factory_init() {
LED_initHW(l6());
LED_initHW(l7());
LED_initHW(l8());
BLINKER_init(b1());
CAN_init();
CAN_setSender(1);
@ -78,6 +84,9 @@ void Factory_build() {
ALIVE_onAlive(ALcontroller(), CM_CONTROLLER_ALIVE, NULL);
BLINKER_onOn(b1(), LED_on, l6());
BLINKER_onOff(b1(), LED_off, l6());
ALIVE_onSetup(ALjoy(), CM_JOY_SETUP, NULL);
ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME);
ALIVE_onBorn(ALjoy(), LED_on, l1());
@ -88,6 +97,9 @@ void Factory_build() {
//start all state machines
void Factory_start() {
CAN_startBehaviour();
BLINKER_startBehaviour(b1());
BLINKER_emitBlink(b1(), 0);
ALIVE_startBehaviourSender(ALcontroller());
ALIVE_startBehaviourChecker(ALjoy());

View File

@ -19,6 +19,7 @@
#include "../../middleware/alive.h"
#include "../../middleware/can_interface.h"
#include "../../middleware/eeprom.h"
#include "../../middleware/blinker.h"
typedef struct {
@ -31,6 +32,8 @@ typedef struct {
LED l7_;
LED l8_;
BLINKER b1_;
ALIVE ALcontroller_;
ALIVE ALjoy_;
@ -51,6 +54,8 @@ LED* l6();
LED* l7();
LED* l8();
BLINKER* b1();
ALIVE* ALcontroller();
ALIVE* ALjoy();