fix misra violations

This commit is contained in:
Greg Hogan 2024-02-25 18:00:22 -08:00
parent 48478ce8b5
commit eb91c606de
1 changed files with 2 additions and 4 deletions

View File

@ -258,12 +258,10 @@ static void chrysler_rx_hook(const CANPacket_t *to_push) {
const int addr = GET_ADDR(to_push); const int addr = GET_ADDR(to_push);
if ((bus == 0) && (addr == chrysler_addrs->CRUISE_BUTTONS) && chrysler_longitudinal) { if ((bus == 0) && (addr == chrysler_addrs->CRUISE_BUTTONS) && chrysler_longitudinal) {
int cruise_button = GET_BIT(to_push, 0U); // cancel button int cruise_button = GET_BYTE(to_push, 0U) & CHRYSLER_BTN_CANCEL;
// ensure cancel overrides any multi-button pressed state // ensure cancel overrides any multi-button pressed state
if (!cruise_button) { if (!cruise_button) {
cruise_button |= GET_BIT(to_push, 2U) << 2U; // accel button cruise_button = GET_BYTE(to_push, 0U) & (CHRYSLER_BTN_ACCEL | CHRYSLER_BTN_DECEL | CHRYSLER_BTN_RESUME);
cruise_button |= GET_BIT(to_push, 3U) << 3U; // decel button
cruise_button |= GET_BIT(to_push, 4U) << 4U; // resume button
} }
// enter controls on falling edge of accel/decel/resume // enter controls on falling edge of accel/decel/resume