Commit Graph

57 Commits (a3b95dc26dbe5cf649e0db4ac0b0e17451eecb76)

Author SHA1 Message Date
Greg Hogan a3b95dc26d
hyundai: WHL_SPD11 checksum (#622)
* WHL_SPD11 checksum

* update comments
2021-03-31 18:39:13 -07:00
Adeeb Shihadeh 9fb584b20c
Hyundai: increase max torque (#602)
* increase max hyundai torque

* update test threshold
2020-10-01 12:03:23 -07:00
Adeeb Shihadeh 5b14945140
Abstract RX checks for gas, brakes, and relay malfunction (#556)
* abstract gas, brake, and relay RX checks

* toyota

* mazda

* vw and subaru

* gm, honda, nissan

* chrysler

* rename

* revert that
2020-06-16 02:01:00 -07:00
Adeeb Shihadeh abb229c9e7
Add gas signal for hyundai EV (#555) 2020-06-15 10:48:33 -07:00
Adeeb d0442fd1e4
add hyundai legacy safety mode (#554) 2020-06-12 18:03:31 -07:00
Adeeb Shihadeh 49ffbe99f6 disable non-universal checks in hyundai safety 2020-05-31 12:08:02 -07:00
Alice Knag 339976c3ca
document tx message addresses better (#543)
* document tx message addresses better

* comment out scc messages for now
2020-05-28 19:59:14 -07:00
Adeeb Shihadeh a5802cdd15 Hyundai: remove unused message from RX checks 2020-05-26 14:36:44 -07:00
Adeeb d4f3f15c33
Refactor addr check (#541)
* refactor addr checks

* re-enable that

* Willem comment
2020-05-26 11:24:33 -07:00
Adeeb 0657064594
Hyundai checksum (#540)
* 3/5 hyundai checksums done

* cleanup

* these 3 should be universal across all hkg

* fix tests

* fix misra
2020-05-22 14:40:51 -07:00
Adeeb Shihadeh 0610ed1e25 Hyundai wheel speed counter is actually 4 bits spread over two signals 2020-05-17 22:40:51 -07:00
Adeeb e4558c0737
Safety: message length check on RX and TX (#529) 2020-05-11 12:58:33 -07:00
Adeeb 869f123218
Hyundai: counter check (#530)
* hyundai counter check

* fix misra

* add counter to tests
2020-05-09 00:52:57 -07:00
Adeeb 0bc864b3d5
Make torque-based steering state global (#518)
* use generic steering state vars for toyota

* chrysler

* gm

* comment

* more unnecessary lines

* hyundai

* subaru

* vw

* fix mazda
2020-04-28 10:33:20 -07:00
Adeeb d9355c4148
Make cruise_engaged_prev a global + test case for it (#519)
* make cruise_engaged_prev a global

* test for cruise_engaged_prev
2020-04-27 22:13:30 -07:00
Adeeb 2115376412
Abstract sample speed test (#516)
* all cars move

* honda

* update comments

* vw
2020-04-27 21:36:56 -07:00
Willem Melching 715b1a1695
Hyundai-Kia-Genesis (HKG) (#503)
* update hkg steer torque message

* misra

* Get bus

* Allow sending LFA HDA message

* Add blacklisted addr

* Update safety replay

* Cleanup bus checks

* Update to new torque message
2020-04-15 19:33:41 -07:00
robbederks 500370aecd
Make sure relay faults make it to the health packet (#492)
* Added relay malfunction handling

* Bump version

* Fixed safety test

* set/reset

* fixed test again
2020-04-09 15:53:46 -07:00
eFini 4e98bbe8c9
Apply unsafe allow gas mode to all cars. (#480)
Apply unsafe iso accel/decel limit to toyota.
2020-04-06 08:56:36 -07:00
rbiasini 0f21b19bb3
Cleanup pedal nomenclature (#467)
* consolidate gas and brake nomenclature

* fixes in code and tests
2020-03-08 23:48:00 -07:00
rbiasini 04809e1329
Hyundai brake check (#464)
* WIP: adding brake check

* Added Hyundai brake tests
2020-03-07 21:26:03 -08:00
Riccardo Biasini 4ecc6b3581 Cleanup: avoid unnecessary bus checks in rx hooks 2020-03-06 17:51:08 -08:00
rbiasini 1b49d3e830
Hyundai: add gas disengage and tests (#447) 2020-02-22 10:13:32 -08:00
Willem Melching f67ec28e3f
Fix msg checks for non Honda and Toyota (#426) 2020-01-18 13:26:34 -08:00
rbiasini d301a59d64
WIP: Checksum checks (#403)
* add lag message check for all supported cars
* add checksum and counter checks for toyota and honda
* add rx hook regression tests
2019-12-21 10:25:54 +01:00
Riccardo 7d9bae084a better function name for msg_allowed 2019-12-18 00:17:25 -08:00
Riccardo fb6bc3ba7e Fix Misra 2019-11-27 00:19:41 -08:00
Riccardo 878dd00ac8 solve race condition is relay_malfunction right after changing the relay status by adding a counter 2019-11-26 21:37:01 -08:00
rbiasini 6249a183d6
tx_hook shall have a white-list of messages (#381)
* Started whitelisting messages

* Also toyota and cadilalc fix

* bug fixes and better checks. Need to figure out a solution for honda

* Whitelist also for subaru

* Added Chrysler as well to whitelist

* And Hyundai too

* now all supported cars should have a whitelist of messages

* Fix linter

* This should fix process replay

* Honda too is now whitelisted

* struct typedef

* Had forgot GM

* had a wrong addr for GM whitelist

* This should fix all the tests

* bump panda
2019-11-17 00:24:19 -08:00
rbiasini cfcce8f06b
WIP: Relay malfunction (#384)
* relay malfunction handling. WIP

* more cars to relay_malfunctions

* fixed safety tests

* minor change

* Fix linter

* all cars now have a relay_malfunction safety check

* added relay_malfunction safety test for fwd hooks

* added proper regression tests for relay malfunction to all cars

* temp patch to not fail regression in honda bosch

* also addr 0x194 is some nidec honda is steer control

* proper relay check for honda bosch too
2019-11-15 00:32:45 -08:00
Riccardo d063a18885 Hyundai safety: re-enable button spam safety check 2019-11-13 23:57:29 -08:00
rbiasini 1102e69652
make ignition logic common for all cars (#303)
* make ignition logic common for all cars

* ignition_can is not a safety thing. move it to can drivers

* bump version

* gm safety passive is deprecated

* move tx 1 on logic into board specific headers.
2019-10-22 15:10:43 -07:00
rbiasini 01072bec0b
Misra 11.x: pointer usage. (#250)
* RDLR, RDHR gone from safety

* back at not failing misra safety

* fix safety tests

* did not mean this

* Use get-bytes in pedal too

* Ignore Misra 11.5 and Fix 11.8 violaitons

* Fix 11.3 violations

* Neglect Misra 11.4, fix pointer issue in bootstub and rutn on Werror for pedal builds

* Fix Misra 11.6: can't assign number to void pointer

* Fix test after changing honda_moving name

* for loop is better

* Fix bugs from fbck
2019-07-10 20:56:03 -07:00
rbiasini e2d781380a
Strict compiler (#222)
have no Wall warnings from the strict compiler and enforcing it in the regression test.
2019-06-24 10:25:30 -07:00
rbiasini 0a94643321
Misra 15 7 (#219)
* Fixed Misra 15_7 violations

* switch case for buttons
2019-06-17 14:13:50 -07:00
rbiasini bacfcd0fd0
Make macros to get msg attributes (#218)
* made GET_ADDR, GET_BUS and GET_LEN macros

* for simplicity, addr is int instead of uint32_t as it can only use up to 29 bits
2019-06-14 19:13:05 -07:00
rbiasini c066c7838c
Misra 10.4 violations (#216) 2019-06-14 10:57:14 -07:00
rbiasini 78308c0bc5
All 14.4 violations are gone (#213) 2019-06-12 20:12:48 -07:00
rbiasini 67b831ef45
Misra 15 5 (#210)
Remove 15.5 violations
2019-06-12 18:18:07 -07:00
rbiasini 23461a176c
Misra 12 1 safety (#209)
* this gets rid of all 12.1 violations
2019-06-11 21:23:48 -07:00
George Hotz 3810452a02 WTF WHY WAS THIS SHIT PUT EVERYWHERE 2019-05-23 12:39:54 -07:00
Nigel Armstrong f8ab74a1cc L-line relay (#166)
* Initial version of L-Line Relay

* lline relay fix build, add to health

* Add lline relay to safety

* Lline relay fix build

* Fix tests

* Add lline safety init. Dont fwd with relay closed

* Turn on relay with CAN

* relay hook

* More reliable lline relay

* Longer LLine timeout

* Only turn on wifi if not eon

* Dont disable ESP in early

* Allow CAN to be turned off

 - CAN is turned off via USB.
 - CAN is turned on when either try to transmit or can is received
 - If only transmit is asleep, all messages should send okay
 - If receive is alseep, will miss first message while waking up
 - Sometimes will report error on second message while CAN perif wakes up
 - Saves 130mW!

* Power Saver Mode

 - Gray Panda power consumption 650mw -> 325mW
 - Turns off CAN, GMLAN, LIN, GPS when no activity for 10s
 - No acitvity is no CAN send, CAN Recv, Write to GPS

* Fix power_saving to better turn off can

 - On some cars when the can is turned off, it triggers a wakeup.
 Delaying the automatic wakeup seems to fix this

* Don't save power in pedal

* Fix relay clicking on startup

* Fix duplicate include

* consistent relay setting

* relay_status can be added when needed, as it's started_alt was consumed in other places

* need to skip forwarding only if relay control is claimed

* unneded change

* make lline_relay.h not depending on can.h

* less spaghetti I guess

* less lines

* reset pedal changes

* no unused input

* update version
2019-04-11 21:03:15 -07:00
Riccardo 93266a9fa7 Hyundai: allow the same max steer torque as stock 2019-01-28 21:46:13 -08:00
Riccardo 63b7926364 Hyundai safety: temporarily disabled button spam check to avoid camera faults 2018-09-07 20:43:13 -07:00
Riccardo 1c0ffd1a4d Hyundai safety: simplifications 2018-09-05 16:08:42 -07:00
Andrew Frahn 56794d6e1a Hyundai Safety Auto-Detect which CAN bus Camera is on (#134)
* This compiles, and steers the car, but no unit tests performed (yet)

* Updates

225 for max torque after discussions with users in #hyundai
Fixed violation disable as requested

* Hyundai Auto-Detect which CAN bus Camera is on
2018-09-05 15:39:37 -07:00
Riccardo f2292e420b Hyundai: added safety check for button spam 2018-08-31 22:47:50 -07:00
George Hotz 1a8c4c48a1 Hyundai safety: fwd option 2018-08-30 11:54:44 -07:00
Riccardo 487fcaef2f Safety hyundai: fixed RT check 2018-08-29 19:30:14 -07:00
Riccardo 04270b8fa7 Safety Hyundai: bug fixes 2018-08-29 19:23:49 -07:00