Commit Graph

1382 Commits

Author SHA1 Message Date
Shane Smiskol 161d7fdd59 lgtm 2023-11-20 15:04:38 -08:00
Shane Smiskol 8ec4e55b47 this is how you do it 2023-11-20 14:51:11 -08:00
Shane Smiskol f96ce9c790 ford allows set... 2023-11-20 14:26:16 -08:00
Adeeb Shihadeh 933a301cad
safety: do TX whitelist check in top level hook (#1730)
* new fields

* add check

* do first one

* first two

* all done

* fix all output

* simpler

* unused now

* fix body and elm

* fix that

* fix misra

* revert that
2023-11-20 00:15:46 -08:00
Adeeb Shihadeh b1ca493580
safety: fix ambiguous names (#1729)
renames
2023-11-19 22:44:13 -08:00
Adeeb Shihadeh 606d7580c8
safety: cleanup init return struct (#1728)
* try 1

* do the rest

* fix misra
2023-11-19 21:05:53 -08:00
Adeeb Shihadeh 3d2f99dd40
safety: move RX addr check into top level hook (#1727)
* safety: move RX addr check into top level hook

* tesla

* rest

* can't forget about the body

* rm more

* fix that

* cleanup

* drop the fn
2023-11-19 20:03:35 -08:00
Adeeb Shihadeh c6248d6504
safety: cleanup ints that are bools (#1726)
* safety: cleanup ints that are bools

* update tests
2023-11-19 16:47:09 -08:00
Shane Smiskol 9fed95003e
Ford: fix possible standstill mismatch (#1725)
fix ford standstill mismatch
2023-11-18 00:04:34 -08:00
Shane Smiskol 3b165ed21b
Hyundai: fix brake pressed bitmask (#1724)
* fix

* test this
2023-11-17 19:58:53 -08:00
Shane Smiskol 7c84475410
safety: use address check helper (#1721)
use SET_ADDR_CHECKS
2023-11-16 22:36:05 -08:00
Shane Smiskol 57e280ad29
safety: add body safety tests (#1716)
* partial body safety tests

* cmt

* test this flasher msg

* move

* address check on can flashing msg

* no other test tests this, valid when we rx one

* this is more reflective on the current behavior

* better test

* clean up

* stash

* clean up

* revert

* Update board/safety/safety_body.h

* fix misra
2023-11-10 19:02:32 -08:00
Shane Smiskol 55946a060d
safety tests: more coverage (#1714)
* more coverage

* we don't check the counter of this ford message

* there are no messages with these lengths to check
2023-11-10 01:53:41 -08:00
Shane Smiskol 5e22e87cf6
Hyundai CAN: update driver braking signal (#1713)
* use DriverOverride

* Update board/safety/safety_hyundai.h
2023-11-10 01:03:33 -08:00
Adeeb Shihadeh a1d699b87d
SOM boot recovery (#1712)
* reset

* simpler

* only once per panda boot

* cleanup

* also check serial
2023-11-09 18:01:46 -08:00
Adeeb Shihadeh d2ea9ad293
refactor bootkick (#1690)
* bootkick refactor + reset

* simplify

* revert reset stuff

* cleanup

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-11-08 22:54:55 -08:00
Jason Wen 3f25ccabd6
Subaru Pre-Global: Reverse driver torque signal for certain platforms (#1648)
* Subaru Pre-Global: Reverse driver torque signal for certain platforms

* added flag

* fix tests

* use dbc instead

* duplicate

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
Co-authored-by: Justin Newberry <justin@comma.ai>
2023-11-08 15:27:20 -08:00
Shane Smiskol fa04f47600
safety tests: support multiple relay malfunction addresses (#1707)
* gm: test the other relay malfunction addr when using long with gmcam (ASCMGasRegenCmd)

* make it a dict

* might want to split these changes

* messy

* Revert "messy"

This reverts commit 25cd68fcab.

* some more

* ford: check longitudinal addr

* chrysler

* fix ford!

* gm and subaru

* common

* draft

* clean up

* clean up check

* rm line

* clean up

* add context

* apparently None isn't optional

* conventional test

* Revert "conventional test"

This reverts commit 4b265ad4ab.

* whoops, clean that up

* more clean up

* add a helpful cmt

* more hlpfl cmt

* can remove this test now

* hyundai cmts

* not really needed
2023-11-07 19:03:08 -08:00
Shane Smiskol 2560349fbb
safety: use CLAMP for update_counter (#1706)
Update safety.h
2023-11-06 22:08:24 -08:00
Shane Smiskol d2f9e14062
Honda: add latching AEB test (#1704)
* use get bit

* simplify parsing

* add get_honda_fwd_brake for latching test

rm print

* can also test with txing brake

* Revert "can also test with txing brake"

This reverts commit f75eb6eb56.

* rm this
2023-10-31 21:20:59 -07:00
Shane Smiskol bc69d25335
safety tests: clean up state reset (#1703)
* this is already reset in set_safety_hooks

* move these car-specific variables into their own init hooks
2023-10-31 21:19:55 -07:00
Shane Smiskol f62d1723fd
Hyundai CAN: fix driver torque safety scaling (#1695)
* how does this/did that pass?!

* fix misra

* add comment

* we could do this

* or could do what eps torque does

* another pr

* not unused

* need this for special gm

* support testing integer torque

cmt

* there we go

* stash again

* Revert "stash again"

This reverts commit 4ecf6cc91c.

* this works!

* clean up

* cmt

* ugh this test was broken

* add some comments for this behemoth, and switch to rxing real msgs

* for now, no measurement test since we don't have any info about driver torque on can. for ex:

max value, factor on CAN, etc.

clean up

* more clean up

* just use it everywhere

* better cmt

* cmt
2023-10-24 23:20:33 -07:00
Adeeb Shihadeh aaa1172fa2
HITL bootkick tests (#1685)
* HITL bootkick tests

* both bootkick cases

* more

* som use gpio

* cleanup

* pretty reliable now
2023-10-06 13:38:35 -07:00
Adeeb Shihadeh f42b65ca32
skip flash if up to date (#1686)
* skip flash if up to date

* fix
2023-10-05 13:13:40 -07:00
Igor Biletskyy 5778c0ae5d
H7: fix GMLAN bitbang timer (#1542)
* init

* move Adeeb's test

* bitbang expected to fail can_health
2023-10-03 13:14:14 -07:00
Shane Smiskol 43af1df79e
safety: sample_t is not fully reset on safety mode init (#1376)
* found another bug!

* update test

* why does toyota add 1 but not chrysler?!

* test/fix others

* clean up

* more

* global

* clean up

* one function to reset AND update

* without abs and only negative values: this is not caught (since negative error < 1)

* ugly draft

* clean up, tests work

* now only should use this function

* better cmt

* better loc

* constant in python too!

* actually duplicate comment
2023-10-03 03:15:16 -07:00
Shane Smiskol 635db84095
Subaru: consider true angle sign in safety (#1681)
* this fails

* this doesn't!
2023-10-03 02:18:10 -07:00
Shane Smiskol 9fd1b268b4
Nissan: consider true sign in safety (#1680)
* works

* simpler

* cmt again

* better
2023-10-03 01:50:37 -07:00
Jason Wen 7af336244c
Hyundai CAN-FD: Move CRC compute function to common Hyundai safety (#1634)
* HKG CAN-FD: Move CRC lookup function to common Hyundai safety

* cleanup

* declare in common

* Subaru: gen2 long safety (#1594)

gen2 long safety

* VW MQB: Check steer req bit (#1631)

vq mqb

* cleanup

* more cleanup

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-10-02 21:32:13 -07:00
Adeeb Shihadeh b6e37f25b6
Remove flash logging (#1674)
* Revert "Disable flash logging (#1667)"

This reverts commit 62db60595b.

* Revert "Faster log retrieval (#1484)"

This reverts commit 694aae9c26.

* Revert "Flash bounds checking outside of bootstub (#1459)"

This reverts commit 054344de6b.

* Revert "Logging (#1445)"

This reverts commit 0cc91a7f7b.

* cleanup

* cleanup
2023-09-30 12:49:46 -07:00
Igor Biletskyy b12b9b9c97
jungle v2: control power individually per port (#1669)
* init

* better api
2023-09-25 17:58:11 -07:00
Adeeb Shihadeh 62db60595b
Disable flash logging (#1667)
* disable logging to flash

* update tests

* fix hitl
2023-09-21 15:28:19 -07:00
Shane Smiskol 546087125f
GM: change ignition signal (#1662)
* GM: change ignition signal

* Update board/drivers/can_common.h
2023-09-15 02:04:51 -07:00
Justin Newberry d4e63daf34
VW PQ: Check steer req bit (#1630)
* vw pq

* misra
2023-09-11 13:59:30 -07:00
Jason Wen 428b303e26
Hyundai CAN-FD: move HDA2 flag to common Hyundai safety (#1638) 2023-09-11 13:57:54 -07:00
Shane Smiskol 8e8aa5acf6
Hyundai CAN: utilize macros for common address checks (#1655)
* common addrs behind macros

* draft so far

* Revert "draft so far"

This reverts commit e41b796a00.

* MISRA

* use new SET_ADDR_CHECKS macro
2023-09-08 00:41:11 -07:00
Shane Smiskol e9a0987617
Hyundai CAN FD: utilize macros for common address checks (#1658)
* draft

* now clean up old comments

* no more special broken ice addr checks

* revert

* fix

* add test for ICE HDA1

* Revert "add test for ICE HDA1"

This reverts commit 76d2b0f066.

* can be separate

* macro for addr check struct

* add checks for alt buttons (fixes race condition)

* add macro for array len

* add comment

* misra

* comments to help separate

* can't put parenthesis around array item

* review suggestions

* no intermediary macros for making the structs (remove misra violation)

* Update board/safety/safety_hyundai_canfd.h

* single lines

* can avoid double checking hda2 since we have addr checks for it now
2023-09-07 23:52:27 -07:00
Adeeb Shihadeh e98639b752 increase not booted log timeout 2023-09-07 16:33:36 -07:00
Justin Newberry cb0cd1bfaa
Subaru: add safety around cutting steer req bit (#1632)
* wip

* steer bit

* add tolerance

* increase a bit more

* test too

* Had that backwards

* Here too

* review suggestions

* minimal diff

* minimal diff

* add type hints

* spacing

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* update test name

* add tolerance comment

Co-authored-by: Shane Smiskol <shane@smiskol.com>

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 20:34:24 -07:00
Igor Biletskyy 394b61cd16
H7: reset CAN core on bus off state (#1615)
* init

* misra

* merge
2023-09-06 09:50:13 -07:00
Jason Wen 39bc5a4886
Nissan Altima: add a param for alternate EPS bus (#1649)
* Nissan Altima: Specify panda flag for alt bus safety config

* test this safety mode

* test this safety mode

* rm

* nl

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 00:46:33 -07:00
Shane Smiskol 0b6adad9c8
Nissan: test alternate EPS bus param (#1651)
* test this safety mode

* test this safety mode

* use int

* clean up

* clean up
2023-09-06 00:36:25 -07:00
Igor Biletskyy 3ab4f43de0
enable red and green leds until USB/SPI init (#1647)
* init

* add green
2023-09-05 13:36:13 -07:00
Justin Newberry 72f1603a89
VW MQB: Check steer req bit (#1631)
vq mqb
2023-09-01 16:32:08 -07:00
Justin Newberry 62bb0c2e33
Subaru: gen2 long safety (#1594)
gen2 long safety
2023-09-01 13:08:04 -07:00
Jason Wen afb241ab1c
Safety: Convert message addresses from decimal to hexadecimal (#1623)
* Safety: Convert message addresses from decimal to hexadecimal

* unit tests

* fix

* In another PR
2023-08-31 20:12:59 -07:00
Justin Newberry ef1a9338a1
Chrysler: check steer bit (#1628)
* chrysler

* misra
2023-08-31 16:01:16 -07:00
Justin Newberry fbe81a1753
GM: check steer req bit (#1629)
for gm
2023-08-31 16:01:05 -07:00
Justin Newberry f4d0904d94
Subaru: preglobal check steer req bit (#1626) 2023-08-31 14:26:51 -07:00
Igor Biletskyy 3efa31a804
F4: fix GMLAN clocks (#1624)
* init

* misra
2023-08-31 09:55:12 -07:00