Commit Graph

50 Commits

Author SHA1 Message Date
rbiasini 380b7c75c5
Long allowed (#202)
* added long_controls_allowed to cars safety code. long_controls_allowed init to 1 for now, so safety tests pass
2019-06-05 14:00:07 -07:00
rbiasini 09714e3a44
Toyota gas cancellation (#200)
* cancel on pedal press for toyota.
2019-06-05 13:38:59 -07:00
Riccardo 436b203e0b Honda safety: fixed bug and properly abstracted gas_interceptor_detected variable 2019-06-04 13:36:46 -07:00
George Hotz e70b44aa57 move that to main.c 2019-05-23 12:39:54 -07:00
George Hotz a74f001ba7 refactor power savings to depend on car started bit 2019-05-23 12:39:54 -07:00
George Hotz 0a9f8eb581 remove many ifdef PANDA 2019-05-23 12:39:54 -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
rbiasini 1218d09edb
Cadillac ascm proxy (#155)
* added safety_ascm

* better using one funciton

* GM_ASCM safety mode by default

* fixced ign bug and passing everything for now

* blocking 0x152-0x154 and reforwarding 0x153

* gotta fwd 152 as well on CH bus

* adding braking message block

* blocking gas cmd as well

* allow cadillac supercruise to pass through

* no more hardcoded ascm safety mode
2019-02-05 18:37:02 -08:00
Bugsy d275fa8489 Subaru: Forwarding (#152)
Bus 0 to 1
Bus 1 to 0 exept LKAS
2019-01-28 21:42:06 -08:00
Drew Hintz 799c33868d Chrysler safety controls (#130)
* Chrysler safety model and tests.

* fix comments

* when ACC is canceled, disallow controls

* update SAFETY_CHRYSLER value in Python API and add other SAFETY values
2018-11-06 12:28:33 -08:00
Robert Cotran 6385551f29 Added Tesla safety changes. (#132)
* Added Tesla safety changes.

* Use generic interpolate function from safety.h

* Moved Tesla safety include to within IFDEF PANDA as legacy neo boards don't support floats used in Tesla safety code

* Remove double-pull code and time tracking from CAN message.

Better enclose Tesla-relevant code in ifdef PANDA due to use of floats

* Changes as per requests by @rbiasini from conversations in https://github.com/commaai/panda/pull/132

* Removed unused variable

Do interpolation check at every step (not every 25)

Change tesla safety constant number to 8, not 7

* Add the HYUNDAI safety number

* Remove unused struct and function (fsample)

* fix build

* Add stub gmlan implementations in safety tests
2018-10-04 19:22:10 +02:00
Riccardo 594863cea3 Hyundai: added initial safety files which just fwd bus 0 to 2 and viceversa, except for lkas msgs 2018-08-17 21:31:00 -07:00
Riccardo 905a93583a fixed pedal and legacy board builds: no float support 2018-08-14 15:55:47 -07:00
Riccardo 0a480ec20e moved interpolate function to safety header 2018-08-13 22:52:31 -07:00
Riccardo 1a94543a22 Panda safety: minor generalization of the function max_limit_check 2018-06-20 18:34:31 -07:00
Riccardo 6b316011b3 Safety: minor data type cleanup 2018-06-20 18:19:08 -07:00
Riccardo bf5db45ab1 Safety: made the driver steer check common so it can be shared across multiple safety files 2018-06-13 15:23:56 -07:00
Commaremote ef079e6da9 Safety: made rate limit check also common 2018-06-13 01:37:36 -07:00
Commaremote dc3cc240b9 Safety: made common the max torque check as well 2018-06-13 01:11:32 -07:00
Commaremote dbc3568a1b removing extra spaces 2018-06-13 00:57:36 -07:00
Commaremote 1966bdf348 Safety: made real time rate limit check a shared function 2018-06-13 00:56:29 -07:00
Commaremote bf70f51596 Safety: increase buffer for sampled signals. TBD a violation feedback from board to prevent car faults 2018-06-03 17:39:57 -07:00
Commaremote 79ab5af8c3 Toyota: moved common functions into safety header file 2018-05-31 18:49:12 -07:00
Riccardo bea51874e7 Cadillac: added max steer safety 2018-05-25 17:53:02 -07:00
Commaremote e2c89d6bc8 Cadillac: changed ignition logic to be based on can presence 2018-05-25 13:57:19 -07:00
Commaremote 4e79ecf112 Cadillac: added safety file placeholder 2018-05-25 10:36:25 -07:00
rbiasini ace4a224c8
Ford safety (#115)
* added initial ford safety header

* added ford ok safety. Missing brake check

* added force cancel check in ford safety

* added brake check to fusion

* fixed nomenclature
2018-05-02 22:45:23 -07:00
George Hotz af9af6d13e
Merge pull request #110 from Jamezz/volt
Add safety hook for ignition state for car platforms that don't support GPIO pin
2018-04-12 12:00:26 -07:00
George Hotz cac7b318f0 only panda has float 2018-04-11 20:47:29 -07:00
George Hotz 367c9ad242 add safety toyota ipas 2018-04-11 14:31:58 -07:00
Jamezz 23d3833d77 Merge from comma upstream 2018-04-11 13:04:16 -07:00
Thomas Helms 4fc83a5f5c Add safety hook for ignition and have GM use gear selector to determine ignition 2018-04-10 17:55:55 -07:00
gregjhogan 5c7ef9ee43 added bosch safety hooks and forwarding 2018-03-05 18:17:30 -06:00
Vasily Tarasov 6908feb42e Chevy Volt safety
Resets controls_allowed not only gas and brake,
but on pressing regen paddle as well.

Radar configuration, dashboard status, and chime
messages are always allowed through.
2018-02-23 00:19:22 -08:00
George Hotz 4410a59d92 add safety param support 2018-01-25 23:57:04 -08:00
rbiasini ecc3afa4c5 Toyota torque limit (#42)
* Toyota: speed limitation VS speed
* Added torque limits flag to make tests easy for toyota
* Prius: tuned max torque VS speed
2017-09-16 00:53:09 -07:00
Riccardo 289b1f9220 Toyota: added safety_toyota 2017-08-24 22:31:34 -07:00
George Hotz 19d7149e6f factor out DFU code 2017-08-23 12:49:56 -07:00
Jessy Diamond Exum 09ee296550 ELM327: Panda safety mode for ELM327 (passes ISO 15765-4 11&29 bit messages) 2017-08-19 00:31:11 -07:00
Firmware Batman d9fc3b372c refactoring 2017-07-21 11:48:03 -07:00
Firmware Batman 9b0b54f4a1 refactor continues 2017-07-20 23:42:19 -07:00
Firmware Batman 65809f25f4 refactoring 2017-07-20 23:36:06 -07:00
Firmware Batman 8c83533ba6 better docs, improve safety code 2017-07-17 10:48:16 -07:00
Firmware Batman f38c573113 why were we not using a modern c standard? 2017-07-17 10:27:34 -07:00
Firmware Batman e5d255447b clean up safety code 2017-07-17 10:20:08 -07:00
Jessy Diamond Exum 528b8ae067 Modularize safety modes to encourage 3rd party safety code contribution. 2017-07-17 00:41:26 -07:00
George Hotz 7733b09288 Revert commits that broke USB for openpilot.
Revert "fix openpilot board flashing"

This reverts commit 8ff93ad5da.

Revert "Fixed output_enabled led not turning off when mode changed to no output."

This reverts commit 27a8af1107.

Revert "Fixed loopback test for new GMLAN 'can4' behavior."

This reverts commit 59592f599a.

Revert "GMLAN is now always mapped through CAN4 (index 3)"

This reverts commit 329c091024.

Revert "Removed compile time config for CAN loopback, implemented as usb message."

This reverts commit e1a4c32985.

Revert "Change all output safety mode identifier to prevent user mistakes."

This reverts commit 6b363e2e92.

Revert "untabify"

This reverts commit 191f67b083.

Revert "Refactor of safety to support more modular additions of safety policies."

This reverts commit e5b524eddc.

Revert "Split up some more header files into compilation units."

This reverts commit e2a78912f5.

Revert "Enabled emulated control writes over USB."

This reverts commit 133cfe9703.

Revert "Moved CAN and USART code out of main.c and into more appropriate files."

This reverts commit daad2dc062.

Revert "Large Panda CAN cleanup. Restrict GMLAN to valid baud rates."

This reverts commit a0616a2bc2.

Revert "Panda library now correctly sends USB direction bit."

This reverts commit 1712c901d4.

Revert "Board makefile now automatically calculates header file dependencies."

This reverts commit 4a8d4e597b.

Revert "Loopback test works over wifi. (Disable trying to send over wifi)"

This reverts commit dae636968a.

Revert "Fix legacy board build"

This reverts commit 62bf4e5756.

Revert "Style cop"

This reverts commit c439f43726.

Revert "Untabify"

This reverts commit 41e5eec621.

Revert "Fixed disabling gmlan."

This reverts commit 5e1e45a4af.

Revert "Removed dead code, standardized canid in more commands, better erroring behavior."

This reverts commit b59aeb6d87.

Revert "loopback test works with new CAN bus ids."

This reverts commit 75970861cf.

Revert "Large reorganization of code and early integration of can bitrate setting."

This reverts commit a1ed7b62ee.
2017-07-12 11:27:16 -07:00
Jessy Diamond Exum 27a8af1107 Fixed output_enabled led not turning off when mode changed to no output. 2017-07-11 18:43:32 -07:00
Jessy Diamond Exum e5b524eddc Refactor of safety to support more modular additions of safety policies. 2017-07-11 16:55:36 -07:00