parent
9108b82fb0
commit
d572c012cb
|
@ -58,6 +58,7 @@ struct __attribute__((packed)) health_t {
|
||||||
uint8_t car_harness_status_pkt;
|
uint8_t car_harness_status_pkt;
|
||||||
uint8_t usb_power_mode_pkt;
|
uint8_t usb_power_mode_pkt;
|
||||||
uint8_t safety_mode_pkt;
|
uint8_t safety_mode_pkt;
|
||||||
|
int16_t safety_param_pkt;
|
||||||
uint8_t fault_status_pkt;
|
uint8_t fault_status_pkt;
|
||||||
uint8_t power_save_enabled_pkt;
|
uint8_t power_save_enabled_pkt;
|
||||||
};
|
};
|
||||||
|
@ -179,6 +180,7 @@ int get_health_pkt(void *dat) {
|
||||||
health->car_harness_status_pkt = car_harness_status;
|
health->car_harness_status_pkt = car_harness_status;
|
||||||
health->usb_power_mode_pkt = usb_power_mode;
|
health->usb_power_mode_pkt = usb_power_mode;
|
||||||
health->safety_mode_pkt = (uint8_t)(current_safety_mode);
|
health->safety_mode_pkt = (uint8_t)(current_safety_mode);
|
||||||
|
health->safety_param_pkt = current_safety_param;
|
||||||
health->power_save_enabled_pkt = (uint8_t)(power_save_status == POWER_SAVE_STATUS_ENABLED);
|
health->power_save_enabled_pkt = (uint8_t)(power_save_status == POWER_SAVE_STATUS_ENABLED);
|
||||||
|
|
||||||
health->fault_status_pkt = fault_status;
|
health->fault_status_pkt = fault_status;
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#define SAFETY_HYUNDAI_COMMUNITY 24U
|
#define SAFETY_HYUNDAI_COMMUNITY 24U
|
||||||
|
|
||||||
uint16_t current_safety_mode = SAFETY_SILENT;
|
uint16_t current_safety_mode = SAFETY_SILENT;
|
||||||
|
int16_t current_safety_param = 0;
|
||||||
const safety_hooks *current_hooks = &nooutput_hooks;
|
const safety_hooks *current_hooks = &nooutput_hooks;
|
||||||
|
|
||||||
int safety_rx_hook(CAN_FIFOMailBox_TypeDef *to_push){
|
int safety_rx_hook(CAN_FIFOMailBox_TypeDef *to_push){
|
||||||
|
@ -291,7 +292,8 @@ int set_safety_hooks(uint16_t mode, int16_t param) {
|
||||||
for (int i = 0; i < hook_config_count; i++) {
|
for (int i = 0; i < hook_config_count; i++) {
|
||||||
if (safety_hook_registry[i].id == mode) {
|
if (safety_hook_registry[i].id == mode) {
|
||||||
current_hooks = safety_hook_registry[i].hooks;
|
current_hooks = safety_hook_registry[i].hooks;
|
||||||
current_safety_mode = safety_hook_registry[i].id;
|
current_safety_mode = mode;
|
||||||
|
current_safety_param = param;
|
||||||
set_status = 0; // set
|
set_status = 0; // set
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue