Commit Graph

835 Commits (spacecruft)

Author SHA1 Message Date
Appleguru 753c42cf56
Update Board Mac SDK Install script to work on clean mac (#146)
Install pip2 and homebrew as part of the sdk script, which aren't installed on clean systems
2020-04-02 10:08:41 -07:00
Jason Young b9a9ea395f
Unsafe gas disengage mods, fix test compile warning (#481) 2020-04-01 14:03:13 -07:00
Jason Young 08ef92d585
Safety model for Volkswagen PQ35/PQ46/NMS (#474)
* Align with VW Community port 0.7.4-devel

* Import of PQ35/PQ46/NMS safety work

* Add safety replay drive for PQ35/PQ46/NMS

* Unwind community port hax for upstream, bump Panda ver

* Update comment

* Reduce whitespace diff

* Reduce whitespace diff

* Don't test the drive until it's uploaded

* Propitiate MISRA

* Ixnay on the VERSION LF

* Remove VERSION LF, update safety_replay with PQ drive

* Freshen cereal ref to include fields used in VW PQ test drive

* Remove superfluous return

* Bypass Docker caching issue
2020-04-01 12:38:27 -07:00
Jason Young 51e0a55d6d
Support code for unsafe mode unit tests (#478)
* Support code for unsafe mode tests

* Fix pre-existing MISRA warning while I'm here
2020-04-01 10:17:51 -07:00
George Hotz 5325b62bbe current_safety_mode 2020-03-31 16:31:01 -07:00
George Hotz 7908b72244 update updating unsafe mode 2020-03-31 16:30:08 -07:00
kegman 98503e8660
disable stock honda AEB in unsafe mode (#477)
* disable stock honda AEB in unsafe mode

for some Honda models when OP is engaged, stock AEB will activate in unexpected circumstances, such as when there are 2 lane highways when driving on a curve with opposing traffic.  When this occurs the car may brake unexpectedly (Honda Civic) or loss of gas pedal function may occur for a few seconds (Honda Pilot)

* Update safety_honda.h
2020-03-31 16:26:26 -07:00
George Hotz 01b2ccbeda one more 2020-03-31 12:58:25 -07:00
George Hotz 9a30265a84 weak steering while not engaged 2020-03-31 12:55:16 -07:00
George Hotz 577f10b1ae added options for unsafe mode 2020-03-31 10:21:00 -07:00
George Hotz 83cf7bf4cb update comment 2020-03-30 18:22:08 -07:00
George Hotz 4556e7494c enable unsafe mode, toggle for use by forks that so choose 2020-03-30 18:18:54 -07:00
Willem Melching de89fcdc4f
Nissan leaf (#473)
* use rear wheels for speed

* Add leaf gas message

* Add brake press check to safety

* Fix typo in comparison

* threshold on gas and brake pressed and add cruise enabled check

* Fix brake pressed result

* Use same message for cruise enabled detection

* Fix typo

* Fix tests

* Add RX checks

* Allow sending cancel from panda

* Add cancel command to TX messages in tests

* Remove angle limit

* Change speed factor

* Change speed factor in tests

* Remove max angle from tests

* Fix tests

* try cancel using seatbelt

* Try different cancel message

* Fix TX_MSGS in test

* Fix fwd test
2020-03-27 21:45:16 -07:00
rbiasini 0696730c14
Toyota: add missing offset from speed signal (#469)
* Toyota: add missing offset from speed signal

* Let's also define ABS value in macro
2020-03-11 17:30:30 -07:00
Andre Volmensky 5b1a8dc873
Filtering LKAS HUD messages (#468)
* Filtering LKAS HUD messages

* Added nissan test_fwd_hook()

* Added Nissan TX_MSGS safety test

Co-authored-by: rbiasini <riccardo.biasini@gmail.com>
2020-03-11 00:00:33 -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
rbiasini 74c8ee0a7a
Subaru brake check (#463)
* WIP: subaru brake check

* FInalized logic and added tests to Subaru brake check
2020-03-06 22:29:46 -08:00
Riccardo Biasini 4ecc6b3581 Cleanup: avoid unnecessary bus checks in rx hooks 2020-03-06 17:51:08 -08:00
Jason Young c7d0d5fc7b
Volkswagen safety updates: Phase 3 (#462)
* Torque limit bump, change signal for ACC state tracking
2020-03-05 21:27:19 -08:00
rbiasini 4368748851
WIP: Toyota brake check. (#459)
* Toyota brake check with safety tests
2020-03-05 00:16:03 -08:00
Riccardo Biasini 2ef996fd92 fix addr frequencies 2020-03-04 21:00:27 -08:00
rbiasini b2dbb504dc
remove toyota ipas safety code and tests (#460) 2020-03-04 10:54:13 -08:00
rbiasini fb02390d4c
Subaru checksum counter (#455)
* Added Subaru Global checksum and counter checks
2020-02-27 17:33:51 -08:00
rbiasini 9a44499879
Fix Subaru Legacy Torque driver bug (#454)
* Fix Subaru Legacy Torque driver bug
2020-02-27 17:20:58 -08:00
rbiasini dfa6b079de
separating subary legacy safety mode from global (#452)
* separating subary legacy safety mode from global

* added explicit tests for subaru legacy, which were absent before
2020-02-27 15:28:24 -08:00
rbiasini dad5858b8c
Chrysler: add brakepress cancellation (#451) 2020-02-26 18:19:18 -08:00
Andre Volmensky db94a5b813
Added Nissan safety (#244)
* Added Nissan safety
2020-02-26 11:11:56 -08:00
rbiasini d7f1195d1e
Chrysler Checksum/counter (#450)
* abstract crc function

* counter-checksum for chrysler

* also adding checksum to tests
2020-02-24 16:36:46 -08:00
rbiasini 96e535e5a0
abstract crc function (#448) 2020-02-24 15:26:59 -08:00
rbiasini 1b49d3e830
Hyundai: add gas disengage and tests (#447) 2020-02-22 10:13:32 -08:00
Jason Young 598074c192
Volkswagen safety updates: Phase 2 (#445)
* CRC and counter checks, standstill/brake checks

* Clean up a tsk_06 that snuck through

* Be consistent about how we call _msg_esp_05

* Reduce scope: haunted by the ghost of MISRA future

* Improved check/test for in-motion braking

* MISRA styling fix
2020-02-20 13:57:07 -08:00
rbiasini b2ffaae60e
Chrysler: disengage on gas press (#442)
* add gas cancellation for chrysler
* added regr test too
* also add bus checks to chrysler. SHould have been there already
2020-02-19 23:46:38 -08:00
rbiasini 2ebbe3616b
Subaru: disengage on gas press (#446)
* Subaru: check for gas pressed

* added tests

* rx freq check on throttle

* also support for the not yet supported pre-global platform
2020-02-19 19:55:05 -08:00
Jason Young ccf75c456f
Volkswagen safety updates: Phase 1 (#444)
* Checkpoint Panda refactoring updates

* Rename MQB safety tests in preparation for PQ

* Refactor MQB tests, add missing torque test

* Bring in MQB init without CRC LUT setup

* Fix to ACC_06 test case

* Fix to ACC_06 test case

* Tweak comment for clarity

* Drop superfluous return
2020-02-19 12:37:38 -08:00
hivoltag3 769ade0511
Harness orientation designation fixes (#435)
* Fix orientation designations in harness.h

* Fix orientation designations in black.h

* Fix orientation designations in uno.h

* Fix typo
2020-02-17 14:26:52 -08:00
Arne Schwarck eb5020b7a9
Add the ability to communicate with BSM (#433)
* Add the ability to communicate with BSM

To poll the blind spot sensor 0x750 is required

* Add blindspot monitor communication
2020-02-11 10:15:39 -08:00
robbederks d034f3e9c0
Added the option to turn on IR in power savings mode (#431) 2020-01-30 19:23:19 -08:00
robbederks 82cafd10ea
Allow fan control in power saving (#429) 2020-01-23 16:54:34 -08:00
robbederks 186d9dcb3d
Fixed GMLAN interrupts when used in Tesla safety (#428) 2020-01-22 15:34:06 -08:00
Willem Melching f67ec28e3f
Fix msg checks for non Honda and Toyota (#426) 2020-01-18 13:26:34 -08:00
robbederks 3b35621671
Grey gps fix (#423)
* Fixed GPS enabling on EON builds

* Bumped version

* Added automated GPS test

* Added import

* Fixed linting
2020-01-13 15:06:35 -08:00
George Hotz a74f854031 if 1 on OTP entry 2020-01-04 10:04:50 -08:00
Riccardo fed3aca0da Honda: forward radar_hud msg 2019-12-22 18:42:46 -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 c08b480cea separate between bosch giraffe and harness hooks. Make tests more thorough 2019-12-20 23:18:20 -08:00
Riccardo 110ca03160 remove long_controls_allowed unused param and reduce technical debt 2019-12-20 16:17:37 -08:00
Riccardo d19fd3e6bd better differentation of honda safety modes 2019-12-20 15:51:32 -08:00
Riccardo 268ab9acf3 send can_rx_errs in health 2019-12-19 18:17:09 -08:00
Riccardo 7d9bae084a better function name for msg_allowed 2019-12-18 00:17:25 -08:00
robbederks 1c6093559d
Allow DFU if OTP block is not locked yet (#405)
* Allow DFU if OTP block is not locked yet

* Fixed misra

* Fixed logic
2019-12-17 22:00:17 +01:00
Willem Melching ce13938ab3 fix typo in elm327 addr comparison 2019-12-16 18:00:40 -08:00
Riccardo e3f1dd78d2 ELM327: allow all addresses between 0.700 and 0x800 2019-12-16 17:51:20 -08:00
George Hotz 39818691dd setting long_controls_allowed is only possible on debug builds 2019-12-14 08:32:24 -08:00
Riccardo 4e9d788af7 Remove not-needed cadillac-init 2019-12-12 18:23:03 -08:00
Riccardo f0a5d154cf typo 2019-12-12 11:11:27 -08:00
robbederks c093286b1d
Add bootkick after re-enabling phone power (#401) 2019-12-11 13:42:25 +01:00
George Hotz eadb0dbb1d
security upgrades (#397)
* security upgrades

* Gated DFU entry from debug console as well
2019-12-10 08:14:30 -08:00
Willem Melching 7c13bec09f
Command to get signature (#399)
* Commands to get signature from panda

* does this make misra happy?

* Can I do this in misra?

* this works and makes misra happy

* Add jenkins test for get signature

* Remove comments

* Add comment about code size

* Fix firmware file path
2019-12-09 10:54:48 -08:00
Willem Melching dad439a46e
static assert on size of health packet (#398) 2019-12-09 10:39:04 -08:00
Riccardo df4159c846 Revert "Revert "Register readback on most modules. Still need to convert the other ones (#396)""
This reverts commit 56ec215024.
2019-12-05 14:19:29 -08:00
Riccardo 56ec215024 Revert "Register readback on most modules. Still need to convert the other ones (#396)"
This reverts commit 893e486194.
2019-12-05 13:55:20 -08:00
robbederks 893e486194
Register readback on most modules. Still need to convert the other ones (#396)
* Added an initial working implementation of the register readback and applied it to the LLCAN registers. Also fixed an init bug in CAN.

* Locally disable pylint import error

* Reverted change to CAN-obj->FA1R setting

* Fixed misra compliance

* Changed hash function name

* Fixed CAN filter setting

* Added voltage health test

* Converted ADC to register functions

* Converted clock to use register setters

* Added check to see if fault status is zero after running test

* Converted DAC to use register setters

* Converted fan to use register setters

* Converted gmlan bitbanging to use register setters

* Changed over interrupt driver to use register setters. Also moved some includes and definition places for critical sections

* Fixed build

* Converted LLGPIO to use register setters

* Converted pwm to use register setters

* Fixed cold boot

* Fixed health fault check in automated tests

* Added comment for the future (issue #367)

* Converted RTC driver to use register setters

* Converted SPI to use register setters

* Converted timer driver to use register setters

* Fixed register fault on white pandas and disabled showing of fault for release

* Bump version
2019-12-04 20:42:57 -08:00
Riccardo 6bbae7be2f VW safety: allow cancel spam on both buses to be compatible with camera and gateway integration 2019-12-03 19:48:33 -08:00
Riccardo 1bcc351f29 ignition_can: set it to False after 2s of not seeing CAN msgs 2019-12-03 16:44:55 -08:00
Riccardo 96137f1a8a VW can based ignition not needed. it has ignition line at camera as well. 2019-12-03 16:27:34 -08:00
robbederks 656f99b080
Interrupt refactor (NVIC_SM_1: #334) and Fault handling (#377) (PR #373) 2019-11-27 18:11:21 -08:00
Jason Young 7f9b4a59b6 Fix USB device enumeration on Windows 8.1 and Windows 10 (#393)
* Remove USB 2.0 Extension from BOS descriptor.

* Declutter usb.h of unused code.

Now that I'm more confident the USB 2.0 Extensions are only required
for USB 3.0 devices, and there's less mystery around why the change
worked for us, garbage-collect the commented-out descriptor.
2019-11-27 11:03:37 -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
Riccardo 2d4cb05cf1 add a safety mode counter 2019-11-26 21:20:04 -08:00
Robbe a6797a213e Implement USB power mode on uno 2019-11-26 19:37:38 -08:00
Robbe ca39a5d8f6 Added faults integer to health packet 2019-11-26 17:07:51 -08:00
robbederks f458d67a7c Add uptime counter to the health packet (#391)
* Added uptime counter to the health packet

* fix tests by setting power save on on EON build
2019-11-21 16:47:49 -08:00
Riccardo 16624811c4 enable CAN transcievers outside the set_safety_mode function, which is not related 2019-11-21 13:42:36 -08:00
rbiasini 1192d934a0
Power saving refactor (#389)
* Exit power saving also for CAN based ingition detection and replace interrup with simple state machine. a bit of delay it's fine

* bug fixes and also CDP set on start

* sorry misra

* move comment

* typo

* remove ignition interrupts

* Power saving state machine should be done by boardd, which also sets safety modes and usb power modes

* typo

* Added usb command for power save state setting

* Added power save enabled packet

* Added power_save_enabled to python lib too
2019-11-21 12:53:00 -08:00
Riccardo d58d08fbbf Fix Misra 17.8: can't mod function params 2019-11-20 15:13:26 -08:00
Riccardo bc685ac91b Minor indent 2019-11-20 14:04:07 -08:00
Riccardo a54b86c4ba Failure of set_safety_mode falls back to SILENT. Failure to set silent results in hanging 2019-11-20 13:36:29 -08:00
rbiasini 597436d32a
NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps C… (#388)
* NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps CAN live

* README mention of 'no output'

* mispelled
2019-11-20 11:56:26 -08:00
rbiasini d229f8dcd3
ESP forced off in EON build. this prevents ESP to be turned on when e… (#387)
* ESP forced off in EON build. this prevents ESP to be turned on when exiting power mode: 0.5W power save! Also, boardd does not need to set ESP to off anymore

* don't touch ESP uart

* Refactored ESP/GPS initting

* Fixed white detection
2019-11-19 18:41:59 -08:00
Riccardo fb81414305 mispelled word 2019-11-19 10:22:22 -08:00
Riccardo 57f5ef8cd8 Fix misra: addr can't be more than 29 bits anyway 2019-11-18 15:53:08 -08:00
Riccardo 68ff501277 typo 2019-11-18 13:13:31 -08:00
Riccardo d5c772b0b1 Fixe Toyota message white-list 2019-11-18 12:52:31 -08:00
Riccardo 48197a9216 Better masking for ELM mode 2019-11-18 12:05:05 -08:00
Riccardo 212d336b3d Safety Chrysler: Added cancel spam button check 2019-11-17 22:32:13 -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
Riccardo 86dec4b8ba Safety modes that violate ISO26262 requirements are not compiled in RELEASE build 2019-11-15 12:20:15 -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 69d9d610a5 No tabs in mazda safety 2019-11-14 18:58:05 -08:00
Riccardo a86418c140 insignificant changes 2019-11-14 16:33:26 -08:00
Riccardo d063a18885 Hyundai safety: re-enable button spam safety check 2019-11-13 23:57:29 -08:00
rbiasini 4d1edc068b
skip tx_hook if a message is forwarded (#379) 2019-11-13 23:50:42 -08:00
Riccardo df2ff04583 bump version 2019-11-13 16:11:50 -08:00
Riccardo 168461d5e4 added fault state to health packet 2019-11-13 16:01:20 -08:00
Robbe 32725cc385 Fixed misra compliance 2019-11-09 14:22:16 -08:00
Riccardo 312ba62d43 minor comment cleanupo 2019-11-07 12:42:29 -08:00
Robbe e90897a834 Fix board detection on white 2019-11-06 15:00:07 -08:00
Riccardo 0e72c18378 always stop executing if safety mode fails to be set (suggested by jyoung8607) 2019-11-06 14:45:32 -08:00
Riccardo e8d7ed1d90 Rename function name to not confuse safety_set_mode and set_safety_mode 2019-11-06 14:30:22 -08:00
Comma Device bac4d85434 dos and python3 2019-11-06 21:42:07 +00:00
robbederks e0762c2e77
Add Python & USB API for controlling phone power (#313)
* Added interface for phone power

* Add power function in python

* Fixed struct
2019-11-04 17:26:37 -08:00
Riccardo 256d274e76 Fix Mac installation instruction per: https://github.com/commaai/panda/pull/308/files 2019-10-31 16:23:55 -07:00
Robbe b143a1cf9e Fixed Misra complaint 2019-10-31 11:58:36 -07:00
Robbe 606f1d9131 Fixed RTC on non-uno boards, second try. Cannot work when there is no xtal. 2019-10-30 18:30:00 -07:00
robbederks 933c757705
Fix RTC on non-uno boards (#311)
* Fan and IR at 0 when in power savings mode

* Initialise RTC for all boards, not only uno. Fixes hang while getting time from non-initialized RTCs
2019-10-30 18:11:30 -07:00
rbiasini 48d0d0c782
VW button spam: fix safety and add tests (#306)
* VW button spam: fix safety and add tests

* button spam is actually sent on bus 2

* Fix safety test. Still need to add gas safety test

* added gas safety test to VW and using consistent nomenclature

* style fixes
2019-10-29 15:11:42 -07:00
robbederks 6cccf969ab
Fan and IR at 0 when in power savings mode (#309) 2019-10-29 12:36:47 -07:00
Riccardo 05373282a2 board get_sdk scripts were left on python2 2019-10-29 11:51:37 -07:00
Robbe 1965817d30 Changed default values for testing 2019-10-25 16:24:53 -07:00
rbiasini a12a148d5f Uno (#274)
* Added uno

* Added usb switch support

* Added PWM and IR power functions

* Implemented bootkick

* Added uno as a new hw type

* Bumped version

* Added fan control and tach readout

* WIP: RTC support

* Working RTC

* Fixed python

* Misra compliance

* Added USB control messages for fan/IR power

* Added USB commands + tests for fan & IR control. Fixed bootstub and pedal compilation

* Added IR and fan to power saving mode

* Changed defaults

* Fix safety considering uno

* passing safety now

* Minor UNO tweaks

* Fixed version

* More minor temporary tweaks

* Removed usb load switch from uno

* Added power control for shutting down the fan completely

* Disable IR LEDs by default

* Fixed linter issue

* Linter fix #2
2019-10-25 16:22:42 -07:00
Riccardo 40075321dc VW: stricter limits to comply with comma safety policy 2019-10-24 19:52:16 -07:00
Riccardo e2e2be92c9 add safety mode to health packet 2019-10-24 15:33:27 -07:00
Riccardo 101238c7f6 turned on VW ignition based CAN logic 2019-10-22 17:27:35 -07:00
Riccardo a0d8d5dae7 fix misra 5.3: check_ignition is intended as check_started and can't be used twice 2019-10-22 16:12:18 -07:00
Riccardo ea636de615 made check_ignition function to both look at ignition_line and ignition_can 2019-10-22 15:27:55 -07: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
dekerr 55dfa52306 Update core to CMSIS 5.6 release (#251)
* initial commit

* release version
2019-10-16 15:19:01 -07:00
rbiasini fce38a91d7
Linter python (#299)
* Added pyflakes and Pylint for python

* Actually run linter in CI

* some simple pyflakes changes

* Add flake8 to panda reqs for linter test

* flake8 errors are fixed

* run flake8 in regression tests

* meant to run flake8

* hack to ignore unused import

* bug

* fix bugs in tucan_loopback

* Another fix by using set_safety_mode

* added pylintrc file

* more fixes and enabled pylint as well

* Fix pylint in circleci

* added linter to readme
2019-10-15 14:03:31 -07:00
Jason Young 2f9e076289 Panda safety code for Volkswagen, Audi, SEAT, and Å koda (#293)
* Panda safety code for Volkswagen, Audi, SEAT, and Å koda.

* First pass at MISRA compliance.

* Second pass at MISRA compliance.

* Fix scope of violation boolean.

* MISRA doesn't care for implicit cast of unsigned int to boolean.

* Remove superfluous newline.

* Remove unused VW ignition hook code, preserve commentary.

* Add 50% padding to max delta check.

* Add 50% padding to max delta check.

* Add clarity around the origin of our safety constants.

* Update test RT delta to match safety.
2019-10-09 13:54:22 -07:00
robbederks 0812362b52 GPS UART fix until boardd is refactored (#294)
* Temporary GPS fix

* spaces
2019-10-08 19:41:10 -07:00
robbederks 0894b28f1e Fixed USB power mode on black (#291)
* Fixed USB power mode on black

* bump version
2019-10-05 20:34:19 -07:00
rbiasini 4b3358c921
patch to be able to switch from EON to PC with a Panda that has EON b… (#290)
* fix switching from EON to PC with a Panda that has EON build and not 12V supply
2019-10-04 14:51:26 -07:00
robbederks a95c44a717
Made setting of NOOUTPUT on no heartbeat more efficient (#287)
* Made setting of NOOUTPUT on no heartbeat more efficient

* Stupid mistake

* Fixed hardcoded safety mode
2019-10-04 13:30:00 -07:00
robbederks 9486836886
UART instability fix with high interrupt load (#283)
* Fixed UART overrun error

* Added stability test scripts

* Refactored UART code. ESP/GPS now uses DMA in circular mode to directly write into the ring buffer, saving a bunch of interrupts and potential race conditions.

* Changed stability test to use amount of bytes instead of amount of non-zero messages, since the ring buffer pointer is only updated on half or full DMA transfer or on line idle (e.g. no more 1 char messages from the gps)

* Increase data limit. It's too low sometimes in normal operation

* Forgot to set write pointer in ring buffer

* Increased test limit even more
2019-10-04 13:28:56 -07:00
rbiasini 9a9e9d47bc
Fix usb_power_mode missing initialization (#289)
* Fix usb_power_mode missing initialization

* typo

* re-added NONE usb power mode, so usb_power_mode is only set in set_usb_power_mode func
2019-10-04 10:48:17 -07:00
rbiasini 70219d7bb2
match safety enum in cereal (#285)
* match safety enum in cereal

* removing tons of hardcoding

* add pythonpath to safety test

* Fix safety test in Docker
2019-10-02 18:20:32 -07:00
rbiasini 78ef4a6ebc
Stop charge (#284)
* CDP by default in EON build on white panda

* Cleaned up power mode setting

* send usb power mode in health

* cleaner CDP setting on ignition

* bump panda
2019-10-02 11:48:40 -07:00
Arne Schwarck 5266a40287 Fix typo (#286) 2019-10-02 11:40:38 -07:00
Riccardo f4787ec5a2 Revert "turn on CDP when ignition switches on (#281)"
This reverts commit 8c1df559f7.
2019-10-01 17:01:14 -07:00
Riccardo d37daee978 Revert "NONE and CLIENT should be the same thing in white/grey pandas"
This reverts commit e97b283e77.
2019-10-01 15:20:59 -07:00
Riccardo e97b283e77 NONE and CLIENT should be the same thing in white/grey pandas 2019-10-01 15:16:13 -07:00
rbiasini 8c1df559f7
turn on CDP when ignition switches on (#281) 2019-09-30 21:48:30 -07:00
rbiasini fac0277169
Misra update (#280)
* Updated cppcheck ref. New rules to be fixed

* changed 2 MACRO names that had more than 31 characters in common

* Fix newly popped 10.4: same type on arithmetic ops

* Fix 18.4: operators should not be applied to an expression

* ensure a NULL pointer isn't dereferenced
2019-09-27 17:18:02 -07:00
Robbe c4ac3d63be Disable GPS load switching on black pandas 2019-09-27 13:22:06 -07:00
Riccardo 2dc34096a0 2to3 applied 2019-09-24 22:33:46 -07:00
Riccardo 1e2412a297 env python -> env python3 2019-09-24 17:50:53 -07:00
Jafar Al-Gharaibeh 9881e61184 Panda for Mazda (#165)
Implement the safety limits
Smarter forwarding:
   Detect what msgs are sent by OP and drop corresponding CAM msgs
   Detect if Stock CAM is connected
   Detect if CAM is in hardware passthrough

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
2019-09-09 15:58:41 -07:00
Bugsy a8ed7d2199 add subaru outback/legacy to subaru safety (#259)
* add subaru outback/legacy safety

* subaru safety passes misra check

* change violation to bool
2019-09-09 15:13:02 -07:00
George Hotz bdeb1c953f mazda is #12 2019-09-09 14:56:14 -07:00
Riccardo 14ea4d2e07 merge safety gm in a single file 2019-09-08 14:07:05 -07:00
Vasily Tarasov bf1ef875ee Add GM passive safety mode (#266) 2019-09-08 14:02:27 -07:00
BogGyver c131fffaeb fix canflash for pedal (#267) 2019-09-05 08:24:49 -07:00
George Hotz 3397b1527e only allow bootloader entry on debug builds 2019-09-04 16:05:50 -07:00
rbiasini d68356b924
Honda Nidec: fwd stock AEB (#257)
* Honda Nidec: fwd stock AEB

* bug

* correct aeb bit

* typo

* Revert "typo"

This reverts commit d424198b1fbc5a783c39b5bdd7d034865ed61a83.

* typo

* bug fix

* don't have tx hook blocking aeb messages from stock system

* typo

* fwd stock brake even if they are the same

* only stop forwarding aeb when aeb flag clears

* Fix safety tests

* Added fwd safety tests

* tiny bit more readable
2019-08-30 20:15:03 -07:00
robbederks 6f532c6d51 Black panda Jenkins (#256)
* Jenkins test refactor and black panda addition

* Added HW types needed by previous commit

* Fixed ignition interrupts when not on EON build

* Added functions for load switches

* More test scripts for black panda

* Added NONE power mode to the code

* Fixed race condition when setting GPIO pins was interrupted.

* Added relay test script

* Fixed flashing with critical sections and GPS load switch

* Fixing critical depth after reboot

* Made the loopback test asserting

* Made critical depth a local variable to avoid race conditions

* Added GPS to power savings mode

* Fixed DFU mode on white panda and bumped version

* Fixed PEDAL_USB compilation error

* Fixed misra compliance of new critical depth code

* Cleaned up heartbeat logic in the testing code. Re-added ALL_CAN_BUT_MAIN_SILENT. Bumped version. Improved critical section code.

* Fixed DFU flashing (once again)

* Fixed VERSION

* Added relay endurance test

* Changed to alloutput on ELM mode for fingerprinting.

* Fixed minor remarks
2019-08-28 12:57:42 -07:00
robbederks d68508c79a Gpio race condition fix (#263)
* Fixed pedal not initializing

* Interrupt changes

* More changes
2019-08-28 12:53:51 -07:00
robbederks d69d05fc0f Fixed pedal not initializing (#262) 2019-08-26 19:24:24 -07:00
Riccardo 36067e01c7 Honda safety: fixed incorrect brake decoding. Due to the specific limit of 255, this change does not affect the safety behavior 2019-08-22 20:29:44 -07:00