Skip to content

Conversation

@jakethesnake420
Copy link

This looks like a better button event interface. Should be able to simplify gm and toyota logic further.

@jakethesnake420 jakethesnake420 marked this pull request as ready for review September 4, 2025 03:35
Comment on lines +16 to +25
BUTTON_MAPS: list[ButtonMap] = (
ButtonMap(ButtonType.accelCruise, CruiseButtons.RES_ACCEL),
ButtonMap(ButtonType.decelCruise, CruiseButtons.DECEL_SET),
ButtonMap(ButtonType.mainCruise, CruiseButtons.MAIN),
ButtonMap(ButtonType.cancel, CruiseButtons.CANCEL)
)
SETTINGS_BUTTON_MAPS: list[ButtonMap] = (
ButtonMap(ButtonType.gapAdjustCruise, CruiseSettings.DISTANCE),
ButtonMap(ButtonType.lkas, CruiseSettings.LKAS)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not a dict?

Copy link
Author

Choose a reason for hiding this comment

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

I changed it to a list so I could index into it without converting to a list because I had an idea but then I changed the create_button_events code so it was not necessary. I don't see why it couldn't be a dict now.

Copy link
Author

Choose a reason for hiding this comment

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

Actually, a dict would enforce that you can only have 1 button event for a button value which may be restrictive? So for example you could not have it so that pressing the Resume/cancel button creates 2 events, cancel and resume. Do you agree?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2025

This PR has had no activity for 60 days. It will be automatically closed in 7 days if there is no activity.

@github-actions github-actions bot added the stale label Nov 9, 2025
@github-actions
Copy link
Contributor

This PR has been automatically closed due to inactivity. Feel free to re-open once activity resumes.

@github-actions github-actions bot closed this Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants