From 2be1db62a268760b1803dd6bb563adc17175a617 Mon Sep 17 00:00:00 2001 From: rusefillc <48498823+rusefillc@users.noreply.github.com> Date: Sun, 18 Sep 2022 20:44:00 -0400 Subject: [PATCH] CanCategory --- firmware/hw_layer/drivers/can/can_category.h | 15 +++++++++++++++ firmware/hw_layer/drivers/can/can_msg_tx.cpp | 1 + firmware/hw_layer/drivers/can/can_msg_tx.h | 14 +++----------- 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 firmware/hw_layer/drivers/can/can_category.h diff --git a/firmware/hw_layer/drivers/can/can_category.h b/firmware/hw_layer/drivers/can/can_category.h new file mode 100644 index 0000000000..dc7e92c622 --- /dev/null +++ b/firmware/hw_layer/drivers/can/can_category.h @@ -0,0 +1,15 @@ +/** + * can_category.h + */ + +#pragma once + +enum class CanCategory : uint16_t { + NBC = 0, + VERBOSE = 1, + LUA = 2, + DOWNSTREAM_FLASHING = 3, + SERIAL = 4, + WBO_SERVICE = 5, + OBD = 6, +}; diff --git a/firmware/hw_layer/drivers/can/can_msg_tx.cpp b/firmware/hw_layer/drivers/can/can_msg_tx.cpp index 991ede00e7..e423a759cc 100644 --- a/firmware/hw_layer/drivers/can/can_msg_tx.cpp +++ b/firmware/hw_layer/drivers/can/can_msg_tx.cpp @@ -23,6 +23,7 @@ #endif // EFI_CAN_SUPPORT CanTxMessage::CanTxMessage(CanCategory category, uint32_t eid, uint8_t dlc, bool isExtended) { + this->category = category; #if HAL_USE_CAN || EFI_UNIT_TEST #ifndef STM32H7XX // ST bxCAN device diff --git a/firmware/hw_layer/drivers/can/can_msg_tx.h b/firmware/hw_layer/drivers/can/can_msg_tx.h index 5aecfd9b91..d77a0d0055 100644 --- a/firmware/hw_layer/drivers/can/can_msg_tx.h +++ b/firmware/hw_layer/drivers/can/can_msg_tx.h @@ -12,19 +12,9 @@ #include #include - +#include "can_category.h" #include "can.h" -enum class CanCategory : uint16_t { - NBC = 0, - VERBOSE = 1, - LUA = 2, - DOWNSTREAM_FLASHING = 3, - SERIAL = 4, - WBO_SERVICE = 5, - OBD = 6, -}; - /** * Represent a message to be transmitted over CAN. * @@ -46,6 +36,8 @@ public: */ ~CanTxMessage(); + CanCategory category; + #if EFI_CAN_SUPPORT /** * Configures the device for all messages to transmit from.