add Steering

This commit is contained in:
2023-09-04 15:20:54 +02:00
parent 473d71ff6b
commit f45fd4ae7e
9 changed files with 457 additions and 19 deletions

View File

@ -46,6 +46,10 @@ DRIVE* drive(){
return &theFactory.drive_;
}
STEERING* steering(){
return &theFactory.steering_;
}
//initialize all objects
void Factory_init() {
@ -80,6 +84,7 @@ void Factory_init() {
ALIVE_init(ALjoy());
DRIVE_init(drive());
STEERING_init(steering());
}
//connect objects if required
@ -100,6 +105,9 @@ void Factory_build() {
DRIVE_onRun(drive(), LED_on, l2());
DRIVE_onDead(drive(), LED_off, l2());
STEERING_onRun(drive(), LED_on, l3());
STEERING_onDead(drive(), LED_off, l3());
}
//start all state machines

View File

@ -16,6 +16,7 @@
#include "../can_message.h"
#include "../eeprom.h"
#include "../drive.h"
#include "../steering.h"
#include "../../board/led/led.h"
#include "../../board/button/button.h"
#include "../../middleware/alive.h"
@ -38,6 +39,7 @@ typedef struct {
ALIVE ALcontroller_;
ALIVE ALjoy_;
DRIVE drive_;
STEERING steering_;
} Factory;
@ -61,6 +63,7 @@ BLINKER* b1();
ALIVE* ALcontroller();
ALIVE* ALjoy();
DRIVE* drive();
STEERING* steering();
#endif