GM: Add support for cam harness & stock ACC (#962)

* Allow brake TX on PT bus

* Initial Panda GM cam harness support
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef

* Remove keepalive; regen == braking

* Fix MISRA violations

* EPS timing opt-in by param

* Minor clean up

* remove timing code for readability

fix and formatting

* we only need to send one message if cam harness and stock long

* Simplify params

* Removed dup brake msg

* revised params, split 3-ways

* add test

* clean up a bit, no need to send ACC yet

like this

* split out button enable and pcm enable into seperate tests

* some formatting

some formatting

* GM CAM uses PCM cruise for controls_allowed

* fix gas safety tests

* misra

* fix static analysis

comment

* fix brake pressed

* Add OP VOACC override stock cam

* Add VOACC safetyparam to init.py

* Revert "Add VOACC safetyparam to init.py"

This reverts commit 2e46f8746f31c399823d9fae9fb9e77e6fee6eea.

* Revert "Add OP VOACC override stock cam"

This reverts commit a4b096cc1e7ee572b22e5f4422b9a6d43f94479c.

* better comments

* better comments

better comments

fix

* move non-base msg definitions to subclass

* various comments

* TODO: add button safety

* add button safety

* use new pcm_cruise_check

* revert regen braking change

* only cancel button allowed

* Apply suggestions from code review

* Update board/safety/safety_gm.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* fix suggestion

* Fix tests

* Revert "Fix tests"

This reverts commit 500577921f32be24934acc80af98aab3af86d028.

* this is a much simpler fix, do full fix in another PR

* tx button safety

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
Jason Shuler
2022-08-12 18:56:39 -04:00
committed by GitHub
parent 508ee90f8e
commit 5e0dde7b48
3 changed files with 176 additions and 59 deletions

View File

@@ -205,6 +205,8 @@ class Panda:
FLAG_SUBARU_GEN2 = 1
FLAG_GM_HW_CAM = 1
def __init__(self, serial: Optional[str] = None, claim: bool = True):
self._serial = serial
self._handle = None