Use FaSTTUBe CAN Abstraction Layer
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
#include "main.h"
|
||||
#include "ts_state_machine.h"
|
||||
|
||||
#include "FT_CAN_AL.h"
|
||||
|
||||
#include "stm32f3xx_hal.h"
|
||||
#include "stm32f3xx_hal_gpio.h"
|
||||
|
||||
@ -70,9 +72,10 @@ void slaves_check() {
|
||||
}
|
||||
}
|
||||
|
||||
void slaves_handle_panic(uint8_t *data) {
|
||||
uint8_t slave_id = data[0];
|
||||
switch (data[1]) {
|
||||
void slaves_handle_panic(const uint8_t *data) {
|
||||
uint8_t slave_id = ftcan_unmarshal_unsigned(&data, 1);
|
||||
uint8_t error_kind = ftcan_unmarshal_unsigned(&data, 1);
|
||||
switch (error_kind) {
|
||||
case SLAVE_PANIC_OT:
|
||||
slaves[slave_id].error.kind = SLAVE_ERR_OT;
|
||||
break;
|
||||
@ -86,10 +89,10 @@ void slaves_handle_panic(uint8_t *data) {
|
||||
slaves[slave_id].error.kind = SLAVE_ERR_UV;
|
||||
break;
|
||||
}
|
||||
memcpy(&slaves[slave_id].error.data, &data[2], 4);
|
||||
slaves[slave_id].error.data = ftcan_unmarshal_unsigned(&data, 4);
|
||||
slaves[slave_id].last_message = HAL_GetTick();
|
||||
}
|
||||
|
||||
void slaves_handle_log(uint8_t *data) {
|
||||
void slaves_handle_log(const uint8_t *data) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user