-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyundai Safety: Safety flags in one place #1964
base: master
Are you sure you want to change the base?
Conversation
d0d8f83
to
e6d18b1
Compare
This reverts commit c325de2.
const int HYUNDAI_PARAM_EV_GAS = 1; | ||
const int HYUNDAI_PARAM_HYBRID_GAS = 2; | ||
const int HYUNDAI_PARAM_CAMERA_SCC = 8; | ||
const int HYUNDAI_PARAM_CANFD_LKA_STEERING = 16; // TODO: rename for support with CAN/CAN FD Blended platforms | ||
const int HYUNDAI_PARAM_FCEV_GAS = 256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel any cleaner and still has the same issue of out of order flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try using anonymous enum, similar to this:
opendbc/opendbc/safety/safety/safety_hyundai_common.h
Lines 13 to 18 in 75d4e0e
enum { | |
HYUNDAI_BTN_NONE = 0, | |
HYUNDAI_BTN_RESUME = 1, | |
HYUNDAI_BTN_SET = 2, | |
HYUNDAI_BTN_CANCEL = 4, | |
}; |
…fety-flags # Conflicts: # opendbc/safety/safety/safety_hyundai_common.h
@@ -318,16 +315,14 @@ static safety_config hyundai_init(uint16_t param) { | |||
} | |||
|
|||
static safety_config hyundai_legacy_init(uint16_t param) { | |||
hyundai_flags(param); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a much more ambiguous name than hyundai_common_init
@@ -286,9 +286,6 @@ static safety_config hyundai_init(uint16_t param) { | |||
HYUNDAI_LONG_COMMON_TX_MSGS(2) | |||
}; | |||
|
|||
hyundai_common_init(param); | |||
hyundai_legacy = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep non-common bools where they are used
safety_hyundai_flags.h
:hyundai_common_flags
hyundai_flags
hyundai_canfd_flags
hyundai_legacy
variable