Commit Graph

2990 Commits

Author SHA1 Message Date
Adeeb Shihadeh
aa0be4d3dc Hyundai: move shared definitions to a separate file (#1097)
* Hyundai: move shared definitions to a separate header file

* same with tests

* cleanup
2022-10-11 17:38:34 -07:00
Shane Smiskol
0a819ad465 Torque request bit: support multiple invalid frames (#1094)
* h90d safety

* quicker rate

* update comment

* support multi frames?

* stash

* stash

* might work?

* stash

* clean up

* revert that

* add test

* fixup tests

* clean up

* remove test

* try to combine tests

* Revert "try to combine tests"

This reverts commit f147955b94.

* seems simpler

* more explicit

* shouldn't be needed

* no hyundai stuff

* no line

* consecutively

* comment

* comment

* comment

* revert

* comment

* check earlier

check earlier

* ensure we don't set a negative value

* add todo comments

* for loop
2022-10-11 13:20:24 -07:00
Shane Smiskol
3644d9412b Revert "Hyundai: steering fault bit safety (#1095)"
This reverts commit 2334a413bc.
2022-10-11 11:25:41 -07:00
Shane Smiskol
2334a413bc Hyundai: steering fault bit safety (#1095)
comment

smaller comment

simpler test

check controls allowed

more classical

more like the buttons

revert

flip
2022-10-10 21:56:22 -07:00
Shane Smiskol
aaa70b10be Toyota: remove redundant test (#1093)
already test this
2022-10-10 17:01:49 -07:00
Shane Smiskol
ca11326bd9 GM: abstract PCM-related hw check (#1090)
abstract hw check to if pcm_cruise or not
2022-10-09 12:39:48 -07:00
Shane Smiskol
1303af2db2 GM: change brake pressed signal (#1089)
* Match openpilot brake check

* comment

* simple

* Update test

* doesn't take an int

* msg varies in size by platform

* 2 extra bytes of zeros on Escalade

* label platforms

* space
2022-10-07 16:10:09 -07:00
Cameron Clough
c09a1cd520 Ford: allow sending buttons msg to camera (#1085)
* allow sending steering buttons msg to camera

The DBC lists both the IPMA and PCM as receiving modules for the `CcAslButtnCnclPress` and `CcAsllButtnResPress` signals used to cancel/resume ACC.

Sending resume to both buses is confirmed to work by three testers, now it's just down to tweaking openpilot to get high reliability.

* add test for both buses

* only send TJA to bus 2
2022-10-07 10:47:04 -07:00
Shane Smiskol
3334dc21f5 IsoTpMessage: parameterize separation time (#1088)
* parameterize separation time

* take in seconds and convert

* fix

* define once
2022-10-05 16:35:28 -07:00
Shane Smiskol
cffc41e878 Specify IsoTpMessage keywords 2022-10-05 16:22:53 -07:00
Shane Smiskol
7d196264a4 IsoTpMessage: param for single frame flow control (#1079)
* iso-tp: request a single frame at a time

* behind param

* this might be more clear

* like this better

* fit the theme

* revert this change
2022-10-05 16:12:24 -07:00
Shane Smiskol
9bcd9b9a24 GM: update max brake (#1087)
update max brake
2022-10-04 00:20:31 -07:00
Adeeb Shihadeh
e987e6c639 add pandaState.safetyRxChecksInvalid field (#1083)
* add fault for invalid safety RX checks

* fix test build

* debug

* fix debug

* fix test

* just a bool in health
2022-10-03 16:05:16 -07:00
Adeeb Shihadeh
4248085d7c Hyundai: fix addr check race condition (#1084) 2022-10-02 17:48:22 -07:00
Shane Smiskol
1910db8d4c IsoTpMessage.send: setup_only argument (#1081)
* some fixes

* some fixes

* revert to tx not done

* this should work

* correct debug prints

* not true

* revert this

* setup_only
2022-09-30 14:29:41 -07:00
Shane Smiskol
51f023bc66 IsoTpMessage: return if message updated (#1078)
* extend timeout for each message/frame (not multi-frame full response)

* linter
2022-09-27 18:08:09 -07:00
Robbe Derks
10c0991666 Add the 0x600 range for UDS messages (#1077)
add the 0x600 range for UDS messages

Co-authored-by: Comma Device <device@comma.ai>
2022-09-23 11:17:15 +02:00
Shane Smiskol
11ea112258 IsoTpMessage: add separation time to flow control msg (#1074)
* one frame at a time, 20 ms delay

* send one at a time

* update separation time to 10ms

* comment
2022-09-19 20:47:12 -07:00
Igor Biletskyy
b86199244a merge health.h and can_health.h (#1075)
init
2022-09-19 16:11:49 -07:00
Igor Biletskyy
a19f12559e check if set CAN speed is valid (#1073)
* check

* MISRA
2022-09-16 23:51:55 -07:00
Igor Biletskyy
fd226de0a4 board struct: add has_canfd (#1072)
* add

* gate this

* and this

* forgot white
2022-09-16 21:56:48 -07:00
Igor Biletskyy
59ede3fe61 CAN health packet: add speed and canfd info (#1071)
in
2022-09-16 20:39:18 -07:00
Igor Biletksyy
046fd58e8d python lib: check get_packets_versions length 2022-09-15 14:54:38 -07:00
Igor Biletskyy
f029c99440 health packet: fix confusing variable names (#1068)
* fix naming

* different buffer overflows

* naming
2022-09-15 13:08:46 -07:00
Igor Biletskyy
0eef8cf333 CAN: health message for each CAN module (#1067)
* initial can health pkt

* MISRA: variable scope

* MISRA 10.4

* typo

* add total_fwd_cnt

* check size of can_health_t

* improve

* comment

* that's better

* move

* add health check to tests

* why?

* ...

* revert later

* meh

* Revert "meh"

This reverts commit 0eb8432194.

* Revert "revert later"

This reverts commit 2d98957a8f.

* adjust test
2022-09-15 13:04:10 -07:00
Shane Smiskol
38257a93e4 Hyundai: lower CAN FD torque rate limits (#1066) 2022-09-15 11:22:21 -07:00
HaraldSchafer
93c0f55a8b Update README.md 2022-09-15 10:25:00 +02:00
HaraldSchafer
f2ac1184ba Update README.md 2022-09-15 10:24:36 +02:00
Shane Smiskol
f120999e19 Subaru: match openpilot standstill (#1070)
match openpilot standstill
2022-09-14 18:42:16 -07:00
Shane Smiskol
19983f13b3 Chrysler: match openpilot standstill check (#1065)
* match openpilot standstill, and fix ram standstill parsing

* misra

* cmt
2022-09-13 13:52:44 -07:00
Shane Smiskol
788e0b5ac9 GM: same regen check as openpilot (#1026)
* it was only checking a specific bit

* same check as openpilot

* reset on init

* unsigned

* should fix conflicts

* common

* comment

* Add missing function

* Tests

* the alternative is a mess

typo

typo

* draft

* finish common

* works but you need RegenSafetyTest before all other classes

* Revert "works but you need RegenSafetyTest before all other classes"

This reverts commit 256f3be9a8.

* This works too

* need parameterized, subtests nor super() calls correctly reset state

* Fix test and comment

* comment

* another fix...

* subclass

* ABC

* order

* fix static analysis

* can do this

* Revert "can do this"

This reverts commit 6bc63a345a.

* this is nicer, no pylint errors

* Update tests/safety/common.py

* underscore

* dynamically detect and add tests

* simpler

* only for safety modes with a regen message

* check attr

* Revert "check attr"

This reverts commit bc37a7eedd.

* need to check at test time not class init time
2022-09-12 21:32:06 -07:00
Igor Biletskyy
15eda6a7c9 CAN bus: adjust SJW and time quanta to SAE 2284-3 (#1061)
* adjust clocks and tq

* debug console keyboard interrupt

* MISRA
2022-09-12 14:31:22 -07:00
Igor Biletskyy
ac21dbe551 H7: add chiplet panda support (RPv2) (#1049)
* temporarily disable Jenkins

* firmware

* python lib

* tests

* ..

* usb load switch to high

* it is still red

* usb power mode remove

* Revert "temporarily disable Jenkins"

This reverts commit a911cfad8d.

* forgot this

* common periph

* change name

* board tick

* add V2 to CI

* update known bootstub
2022-09-09 20:13:06 -07:00
Igor Biletskyy
1b210a8974 H7: remove manual bus off handling (#1062)
remove this
2022-09-09 15:24:19 -07:00
Cameron Clough
8f13ca3f66 Ford safety updates (#1052)
* allow resume button press while controls allowed

* add ACCDATA_3 msg

* change msg name style to match DBC

* fix

* wrong msg

* chmod +x

* always allow other acc buttons e.g. tja toggle
2022-09-08 15:35:10 -07:00
Comma Device
c4c9744f2a fix dos siren 2022-09-07 21:43:52 -07:00
Shane Smiskol
0ca23b6778 Toyota: generic steer fault workaround safety (#939)
* toyota steer fault safety

* fix

* alternative safety

* no comment

* should be good

* same behavior, a bit simpler

* better tests

* fix comment

* update safety comment

* const is actual number of messages

* Fix bug

* misra

* Fix test

* clean up logic a bit

clean up logic a bit

fix

* fix

fix

* clean up tests

* unsigned

* forgot to rename message when merged

* Comments

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

* Update names

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

* rename rest of variables

* real time checks

* clean up safety tests

* revert

* add this

* clean up

* better name

* use common steering checks

* reverse order

* make common

* re-organize the safety

* clean up safety_toyota

* more clean up

* add comment back

* 19

* recover

* some variable name clean up

* rename and reset `valid_steering_msg_count`, another recover message

* move comment

* remove reset_toyota_timer, minor test clean up

* common test

* use init_tests

* threshold used to be: frame you can cut steer on, now it's min num of valid frames (next frame you can cut, 18+1)

* Update tests/safety/test_toyota.py

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

* fix realtime

* Update board/safety/safety_toyota.h

* Apply suggestions from code review

* Update board/safety/safety_toyota.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-06 19:12:06 -07:00
kyle zunich
671b5ae2d6 Update example scripts to support canfd (#1059) 2022-09-02 10:45:43 -07:00
Adeeb Shihadeh
60f366c1b4 fan: don't fully reset integral when recovering from stall (#1058)
* fan: don't fully reset integral when recovering from stall

* clip to [0, 70]

* 50%
2022-09-01 21:11:06 -07:00
Adeeb Shihadeh
13d64d4cc3 USB power mode + bootkick cleanup (#1051)
* remove tick

* remove more

* delete more

* board tick

* update health

* dos bootkicking

* cleanup
2022-08-31 20:46:07 -07:00
Igor Biletskyy
f040d8b726 CI: add USB hub reset (#1053)
USB hub reset
2022-08-31 12:15:36 -07:00
Igor Biletksyy
6d2e2bde86 put is_internal() back for openpilot pandad.py 2022-08-31 10:39:05 -07:00
Shane Smiskol
77cfc32d37 Toyota: match openpilot standstill check (#1045)
* Match openpilot

* check against zero value

* formatting

* use intermediary variable

* comment

* hmm... this works now??

* fix misra
2022-08-30 23:24:37 -07:00
Igor Biletskyy
b81dfba8fe python lib: cleanup hw type check (#1050)
cleanup
2022-08-30 10:46:12 -07:00
Igor Biletksyy
1776165a3d DFU flasher: permissions and address 2022-08-25 10:24:25 -07:00
Igor Biletskyy
6c7b3331f0 flashing: unify recover.sh (#1043)
recovery and readme
2022-08-24 19:15:25 -07:00
Igor Biletskyy
7e79f631ad CI: add hardware reflasher (#1041)
* like that

* don't need that

* cln

* one lock like that?

* or that

* rename

* guard with __name__ check

* lib import

* 20 min is on the edge
2022-08-24 17:17:02 -07:00
Igor Biletskyy
451d6309b5 python lib: check serial length for Panda.list() (#1042)
* known serial length

* rm from pedal test

* rm from helpers

* oopps

* ...

* add warning

* warning
2022-08-23 22:29:35 -07:00
Erich Moraga
43c42ddc9b README: remove backtick typo (#1040) 2022-08-23 20:09:58 -07:00
Jason Wen
9d6496ece8 Hyundai CAN-FD: Tucson Hybrid 2022 support (#999)
* Hyundai: Car Port for Tucson Hybrid 2022

* Remove test comments

* Fix fwd_hook

* Allow tx on 0x1a0

* Fix byte counts

* Send LFA and HDA icons based on engageability

* Add FLAG_HYUNDAI_CANFD_HDA2 flag

* Update __init__.py

* Allow tx with CRUISE_INACTIVE

* Panda safety cleanup

* Include bus 0 in rx checks

* Missed one

* Remove redundant check

* Add comments

* start cleanup

* little more

* more cleanup

* tests

* one more test case

* rename

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-19 19:43:58 -07:00