Skip to content

Conversation

@nikitap066
Copy link
Contributor

Implements TODO to add cruise control button events for accel and decel on Mazda platforms.

No functional behavior change; exposes existing CAN signals to CarState.

Validation
Dongle ID: N/A
Route: N/A

@github-actions github-actions bot added car related to opendbc/car/ mazda labels Jan 7, 2026
Comment on lines +121 to +126
# cruise control button events: distance, inc, and dec
ret.buttonEvents = [
*create_button_events(self.distance_button, prev_distance_button, {1: ButtonType.gapAdjustCruise}),
*create_button_events(self.accel_button, prev_accel_button, {1: ButtonType.accelCruise}),
*create_button_events(self.decel_button, prev_decel_button, {1: ButtonType.decelCruise}),
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe openpilot uses these buttons for anything functional yet since this car is pcmCruise, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that’s correct. This change just exposes the existing INC/DEC button signals in CarState, and resolves the TODO without altering behavior. It should make the signals available if they’re needed in the future.

@github-actions
Copy link
Contributor

Testing 17 segments for: MAZDA_CX5, MAZDA_CX9_2021, MAZDA_CX5_2022

Results: 16 passed, 1 with diffs, 0 errors


MAZDA_CX9_2021 - 629c4aced073d15a/000005c9--92453be792/20
  buttonEvents (6 diffs)
    frame 3269: [] -> [{'pressed': True, 'type': 'decelCruise'}]
    frame 3278: [] -> [{'pressed': False, 'type': 'decelCruise'}]
    frame 3289: [] -> [{'pressed': True, 'type': 'decelCruise'}]
    frame 3298: [] -> [{'pressed': False, 'type': 'decelCruise'}]
    frame 3368: [] -> [{'pressed': True, 'type': 'decelCruise'}]
    frame 3383: [] -> [{'pressed': False, 'type': 'decelCruise'}]

@jixiexiaoge
Copy link

a feedback to you , carrotpilot use this to CLSC , and works good on my CX-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/ mazda

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants