This commit is contained in:
Your Name
2024-02-06 01:08:15 -06:00
parent f931d2982e
commit 7853d218a3
12 changed files with 96 additions and 16 deletions

View File

@@ -273,7 +273,8 @@ static bool hyundai_tx_hook(CANPacket_t *to_send) {
bool allowed_resume = (button == 1) && controls_allowed;
bool allowed_cancel = (button == 4) && cruise_engaged_prev;
if (!(allowed_resume || allowed_cancel)) {
bool allowed_cslc = (button == 1 || button == 2) && controls_allowed;
if (!(allowed_resume || allowed_cancel || allowed_cslc)) {
tx = false;
}
}

View File

@@ -247,8 +247,9 @@ static bool hyundai_canfd_tx_hook(CANPacket_t *to_send) {
int button = GET_BYTE(to_send, 2) & 0x7U;
bool is_cancel = (button == HYUNDAI_BTN_CANCEL);
bool is_resume = (button == HYUNDAI_BTN_RESUME);
bool is_cslc = (button == HYUNDAI_BTN_RESUME || button == HYUNDAI_BTN_SET);
bool allowed = (is_cancel && cruise_engaged_prev) || (is_resume && controls_allowed);
bool allowed = (is_cancel && cruise_engaged_prev) || (is_resume && controls_allowed) || (is_cslc && controls_allowed);
if (!allowed) {
tx = false;
}