Commit Graph

1522 Commits

Author SHA1 Message Date
Adeeb Shihadeh 567dbfe6d8
remove comma pedal (#1902) 2024-03-17 22:22:46 -07:00
Adeeb Shihadeh 895a7001c9
Rename stm32fx/ -> stm32f4/ (#1898)
* Rename stm32fx/ -> stm32f4/

* jungle too
2024-03-11 16:18:56 -07:00
Adeeb Shihadeh 6dfd4db4ab
remove rtc (#1897)
* remove rtc

* fix build

* rm taht

* revert that
2024-03-11 16:08:43 -07:00
Adeeb Shihadeh 4b6f6ac162
723 power init (#1891)
LDO only

This reverts commit ea156f7c62.

Co-authored-by: Comma Device <device@comma.ai>
2024-03-08 14:57:33 -08:00
Robbe Derks 41e9610ff8
Tesla Raven (#1886)
* raven uses a different steering angle sensor

* add raven flag

* raven test

* bump opendbc ref
2024-03-06 21:13:13 +01:00
Adeeb Shihadeh ea156f7c62 revert that for now 2024-02-28 20:31:47 -08:00
Aryan 4303ae1387
enable misra-c2012-10.6 (#1811)
* misra-c2012-10.6

* fixed uninitialized data error

* revert false positive

* enable 10.6

* update install.sh

* cleanup

* bug fix

* better fix ?
2024-02-27 10:32:28 -08:00
Cameron Clough 0c7d5f11d7
use pyupgrade to update syntax (#1889) 2024-02-24 13:56:28 -08:00
Jason Young 96a3099398
fix forwarded bus logging for CAN-FD hardware (#1884) 2024-02-24 10:03:45 -08:00
Shane Smiskol 6aa4b55033
Ford: ignore 2nd speed checksum (#1887)
* ignore cs

* fix test

* fix coverage

* no dead code, remove todo

* typo
2024-02-23 19:08:12 -08:00
Jason Young cd11c7f9a4
VW PQ: Allow either HCA mode (#1885)
* write the test first, like a grownup

* pass the test!
2024-02-22 14:56:14 -08:00
Aryan b4442a7c93
enable misra-c2012-10.3 (#1852)
* enable misra-c2012-10.3

* fix that

* cleanup

* little more

* one more

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-02-18 11:56:44 -08:00
Jason Young 00fab5e18e
refactor GET_BIT to be MISRA friendly (#1877)
* refactor GET_BIT to be MISRA friendly

* better fix for ternary op

* remove whitespace that crept in
2024-02-18 11:03:30 -08:00
Adeeb Shihadeh 6eed036473
(almost) enable cppcheck unusedFunction (#1875)
* remove some unused

* more

* kinda works

* rest are false positives

* disable for now

* add back exhaustive
2024-02-17 14:16:15 -08:00
Adeeb Shihadeh 7bfba5eff2
remove STM32F2 sources (#1873) 2024-02-16 23:00:45 -08:00
Adeeb Shihadeh c076a9f2f6
remove pedal fw (#1872)
* remove pedal fw

* little more

* one more

* and tests

* rest of it

* little more

* fix linter

* more fix
2024-02-16 22:58:01 -08:00
Adeeb Shihadeh 39671c3dd6 remove 12.2 suppression added in 3cd0023 2024-02-15 13:52:39 -08:00
Robbe Derks 3cd0023bc1
cuatro power readout (#1869)
* refactor voltage / current reading

* fix bug and add readout to cuatro

* fix misra?

* just suppress then

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-02-15 13:49:06 -08:00
Shane Smiskol 0a1ec8580e
Toyota: radar disable safety (#1611)
* toyota: add safety for tester present

* block ACC_HUD

* check stock ECU

* add test

* and now pass test

* check ACC_CONTROL for relay malfunction

* not needed

* split tx msgs, test_panda_safety_tx_cases was really helpful!

* now don't need this

* 0x343 is expected to be on bus 0 if stock long

* better as cases

* swap

* always block pre_collision if stock (used for dsu removal)

* do tx msgs

* fix comment
2024-02-14 23:22:06 -08:00
Shane Smiskol a037eebf38
Toyota: longitudinal msgs behind safety param (#1871)
* long is fully behind safety param

* fix

* spacing
2024-02-14 22:16:51 -08:00
Shane Smiskol 27768f5ef3
Toyota: check ACC_CONTROL for relay malfunction (#1870)
* check acc relay malfunction

* do what they do
2024-02-14 21:51:42 -08:00
Jason Young be7c4059a2
VW MQB: RxChecks for GRA_ACC_01 (#1866) 2024-02-14 08:25:03 -08:00
Aryan 54459e694e
update cppcheck (#1859)
* update cppcheck

* Update tests/misra/install.sh

* delete cppcheck cache

* remove misra 5.8 erroors

* fixed uninitialized data error

* suppress misra-c2012-2.3 and misra-c2012-2.4

* reinstate cache to fix mutation test

* rerun for mutation test

* increase timeout for mutation test

* styling

* comments + variable name changes

* Update tests/misra/install.sh

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

* Update install.sh

* more variable name changes

* condition on defining CANPacket_t

* just cherry pick

* fix build

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-02-10 14:50:36 -08:00
dzid26 32301a855a
USB-C cable orientation clarification (#1860) 2024-02-08 22:33:26 -08:00
Adeeb Shihadeh ad0f372ada
cuatro can fixes (#1858)
* more can

* other af

* cleanup

* misra fix

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-02-06 22:29:42 -08:00
dzid26 04c5a00a9e
Board chip type (#1853)
Board chip type title
2024-02-06 11:15:46 -08:00
dzid26 5c5287dabb
Fix CAN comment (#1854) 2024-02-06 11:15:22 -08:00
Adeeb Shihadeh f48fc21a17
cuatro: fix FDCAN2 (#1851)
Co-authored-by: Comma Device <device@comma.ai>
2024-02-04 15:11:52 -08:00
Ruben Medina 3bd980eb39
enable misra-c2012-17.3 (#1806) 2024-02-03 23:20:30 -08:00
Adeeb Shihadeh 93a06f1257
remove HW GMLAN support (#1848) 2024-02-03 23:18:33 -08:00
Comma Device 457e3b262d fix enable_can_transceiver 2024-02-03 01:36:15 +00:00
Adeeb Shihadeh bca1162ae9
cuatro: setup CAN (#1836)
* cuatro: setup CAN

* fix misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-01-30 13:25:22 -08:00
Shane Smiskol ec17f75efc
ELM safety: allow GM diagnostic camera address (0x24B) (#1842)
* allow 0x200 addresses for Bolt camera

* fix test

* only gm address

* think 15765-2 is the source

* test the data

* label

* should be here

* already labeled

* use constant!

* update table

* fix misra

* Revert "update table"

This reverts commit 71ef3fde7c.

* new cppcheck gets this
2024-01-29 20:23:57 -08:00
Adeeb Shihadeh d6b5dbb3dc Revert "detect 723 live (#1835)"
This reverts commit 9d0caa1935.
2024-01-24 15:39:11 -08:00
Adeeb Shihadeh 9d0caa1935
detect 723 live (#1835)
* detect 723 live

* cleanup

* more precise

* more precise

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-01-24 14:48:32 -08:00
Comma Device b39ef1dbfe fix 723 init 2024-01-24 21:57:28 +00:00
Adeeb Shihadeh a0ac220b0c it's cuatro 2024-01-24 13:07:47 -08:00
Adeeb Shihadeh a2d5d8ad07
stm32h723 (#1832)
* booting

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-01-23 23:15:59 -08:00
Adeeb Shihadeh 7c613fdcb5
remove redundant board_type (#1833)
* remove redundant board_type

* fix jungle build
2024-01-23 22:08:22 -08:00
Adeeb Shihadeh c754171000 remove red panda v2 2024-01-23 19:03:21 -08:00
Adeeb Shihadeh c5e79403a8 remove unused cnt 2024-01-21 16:22:17 -08:00
Ruben Medina 7d99cb2ef3
enable misra-c2012-8.2 (#1829) 2024-01-21 16:19:16 -08:00
Ruben Medina 80731c0aa7
enable misra-constParameterCallback (#1827) 2024-01-20 22:22:11 -08:00
Ruben Medina 40671436ee
enable misra-constParameterPointer (#1826) 2024-01-20 21:50:42 -08:00
Ruben Medina 8347fa2621
enable misra-c2012-10.5 (#1825) 2024-01-20 17:05:12 -08:00
Adeeb Shihadeh 424882e0e7 enable knownConditionTrueFalse in cppcheck 2024-01-20 16:34:40 -08:00
Ruben Medina 229e8bb3a5
enable misra-c2012-12.2 (#1824)
* enable misra-c2012-12.2

* refactor: use 1UL in all FAULT defs
2024-01-20 16:19:34 -08:00
Aryan a902a19ead
enable misra-c2012-21.2 (#1819)
* enable misra-c2012-21.2

* Add suppressions on memset and memcpy

* revert that

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-01-18 14:29:01 -08:00
Ruben Medina 5ddc0cf04f
enable misra-c2012-21.14 (#1810) 2024-01-18 14:10:17 -08:00
Ruben Medina 7ab3fcf5d2
enable misra-c2012-10.7 (#1804)
* enable misra-c2012-10.7

* cleanup

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-01-16 16:52:36 -08:00
Ruben Medina 53efbbbc98
enable misra-c2012-21.1 (#1809)
* enable misra-c2012-21.1

* comment

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-01-16 16:46:30 -08:00
Aryan c118c2887d
enable misra-c2012-2.7 (#1813)
* cpp-check suppress

* enable misra-c2012-2.7
2024-01-16 16:02:48 -08:00
Hoang Bui 7e8b829fe8
enable misra-c2012-2.3 & misra-c2012-2.4 (#1801)
* enable misra-c2012-2.3

* enable misrac 2.4

* delete

* revert

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-01-16 15:59:15 -08:00
Aryan 369fd8c6d5
enable misra-c2012-7.2 (#1807)
* misra-c2012-7.2

* removed misra-c2012-7.2 from suppressions.txt
2024-01-16 15:49:13 -08:00
Adeeb Shihadeh bc6eaf358e
enable misra-c2012-14.2 (#1815)
* enable misra-c2012-14.2 (#1805)

* true

* while

---------

Co-authored-by: Ruben Medina <samrum@gmail.com>
2024-01-16 15:49:04 -08:00
Adeeb Shihadeh 6334ded34a Revert "enable misra-c2012-14.2 (#1805)"
This reverts commit a8bc525d92.
2024-01-16 15:39:30 -08:00
Ruben Medina a8bc525d92
enable misra-c2012-14.2 (#1805) 2024-01-15 21:20:39 -08:00
Ruben Medina 8c2b50fa2f
enable misra-c2012-10.1 (#1803) 2024-01-15 21:14:52 -08:00
Aryan 6ae65db44a
enable misra-c2012-5.8 (#1800) 2024-01-15 10:38:46 -08:00
Hoang Bui 817d68f6a6
enable misra-c2012-10.4 (#1796)
* enable misrac-10.4

* changes

* cleaner
2024-01-13 15:49:56 -08:00
Adeeb Shihadeh 08ca10e91c
add AEB enable flag (#1791) 2024-01-11 15:37:43 -08:00
Adeeb Shihadeh f64ba24685 enable misra-c2012-2.2 2024-01-09 22:03:28 -08:00
Jason Young 2a0536c631
VW MQB: Safety update for EA timeout fix (#955) 2024-01-09 19:20:46 -08:00
Justin Newberry 20722a5946
Subaru: cruise_rpm and cruise_throttle are 13 bits (#1786)
* fix cruise throttle

* and es_status

* bump opendbc
2023-12-29 19:25:02 -05:00
Shane Smiskol 6e645d2d33
safety: fully reset dynamic rx check fields (#1767)
* stash

* clean up

* clean up

* more clean up

* just status

* status

* does nothing

* not here
2023-12-15 21:59:19 -08:00
Shane Smiskol 3f6f82616b
Honda: reset prev brake switch (#1781)
we should be resetting this!
2023-12-15 21:40:19 -08:00
Shane Smiskol 5b41a63ae5
Ford: check predicted gas (#1776)
* check pred value

* test
2023-12-15 00:01:17 -08:00
Shane Smiskol bb75afc84e
safety: add safety param for gas interceptor (#1735)
* some refactoring still needing to be done here

* 50hz

* set rx checks

* tx msgs

* test

* fix

* forgot to check this since it's static now

* enable_gas_interceptor

* more

* remove int funcs since are common

* generic!

* not generic

* need to set counter now

* set_enable_gas_interceptor not needed

* already reset in safety init

* fix test

* remove gas_interceptor_detected (partly)

* oof need for hjonda too

* edit structs

* more honda (still broken)

* fix typo

* shift these down

* can also make this extensible

* stash

* defining classes is much simpler, maybe in future we will have some sort of wrapper after some more thought

* remove create_interceptor_test now

* add lta interceptor

* clean up print

* clean up

* once

* type hint

* rm

* no interceptor with stock long + good test

* add interceptor counter to honda

* need alt interceptor + set rx checks for honda

* we were never testing button enable with nidec + interceptor!

honda almost all passing

* these fixes make sense

* clean up

* better

* clean up test cov

* clean up

* not needed

* fix tx msgs

* clean up

* cppcheck

* fix

* unnecessary
2023-12-14 15:22:17 -08:00
Shane Smiskol 294992ac2c
safety tests: rename gas interceptor test (#1774)
* more appropriate name for gas interceptor

* safety
2023-12-12 22:15:36 -08:00
Adeeb Shihadeh d5983833d2
Docs update (#1769)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2023-12-10 11:14:53 -08:00
Jason Wen a6b76dfda0
Hyundai CAN-FD Longitudinal: enable for ICE camera-SCC cars (non-HDA2) (#1671)
* allow ice camera scc longitudinal

* Merge commaai#30021

* test

* clean up

* clean up 2

* some test work

* re-use existing test for radar-scc for now

* clean up

* clean up

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-12-09 17:37:28 -08:00
Shane Smiskol ff49666893
Hyundai CAN FD: radar-SCC longitudinal test (#1771)
* this rightly fails

* now safety
2023-12-09 16:55:46 -08:00
Shane Smiskol cf108cd4cc
safety: full coverage (#1750)
* stash

* if x > xy.x[0], then subsequent x < xy.x[i+1] enforces it is monotonic, or uses last y

* rm

* test safety tick

* coverage: include safety.h

* car-only test

* MAX

* op

* add safety_config_valid
2023-12-09 02:27:29 -08:00
Adeeb Shihadeh fbef31126f
remove misra-c2012-21.1 suppression (#1765) 2023-12-09 01:31:52 -08:00
Shane Smiskol 80782bcbe4
Toyota: LTA steering control safety (#1189)
* simple lta safety

* fix compilation error

* allow current angle when disabled

* toyota angle rate limits

* use GET_BIT

* update limits, temp fix blocked msgs (not critical safety)

* try these limits

* debug

* add setme check, double rate limit for half rate

* update safety limits to openpilot (2 bp)

* had duplicate checks here

* rm line

* better comment

* silly bug

* draft

* Revert "draft"

This reverts commit 756ef70135.

* toyota: add safety for tester present

* block ACC_HUD

* check stock ECU

* add test

* and now pass test

* safety replay: support toyota lta

* remove radar stuff

* max torque safety

max torque safety

* driver torque

* one line

* match openpilot limits

* rename to max_angle and check quality flag

* measure current angle

* clean up

* oh we can combine

* no driver torque limiting for now

* todo: decide the tolerance if any

* add max angle and prepare for to enable inactive safety

* enable inactive safety

* fix replay when inactive

fix replay when inactive

* fix qf check

* ohh this was a bug

* measure vehicle speed

* because safety is in m/s

* rm MeasurementSafetyTest

* stash very draft changes

* fix

* uncomment

* clean up

* rm

* already added

* clean up

* temp fix

* test angle measurements

* add constant

* ltl cleanup

* include this test in test_angle_measurements

* better

* order makes more sense

* fix

* clean up ford cmts

* move to base

* todo

* misra

* already do this below

* angle tests: take in max angle as argument

useful for safety modes that are limited (ford/toyota)

* fix ramp test: round measurement since toyota's scale isn't round

* clean that up

* no subtest

* back

* is tested now!

* flat is more clear

* add check for mismatching bits

* LTA is fully tested now

* clean up

* test_angle_cmd_when_enabled

* whops

* flip

* fix broken test

* need this if we type angle meas func

* should set prev torque

* no subtest

* remove default valid qf

spce

* one line

* cmt

* fixes

* vehicle speed macro

* vehicle speed macro v2

* Update board/safety_declarations.h

* easier to follow

* one line

* rightttt

* rename to toyota_lka_rx_checks, not default
2023-12-08 15:00:23 -08:00
Shane Smiskol f741a90de8
safety: macro to update vehicle speed (#1762)
vehicle speed update macro
2023-12-06 18:05:07 -08:00
Shane Smiskol ea78657bef
Toyota: rename LTA torque wind down signal (#1757)
* rename setme_x64

* bump opendbc ref
2023-12-04 21:05:02 -08:00
Adeeb Shihadeh 892ca5a0f1 this is a better name 2023-11-30 19:20:08 -08:00
Adeeb Shihadeh b50455cc76
safety: specify RX message frequency in Hz (#1754)
* safety: specify RX message frequency in Hz

* these are redundant now

* update that

* cleanup
2023-11-30 14:55:15 -08:00
Adeeb Shihadeh e6fadef4dd one more int -> bool 2023-11-27 16:29:07 -08:00
Shane Smiskol 5884962372
Honda: fix alt brake address check race condition (#1746)
* common honda addr checks

* oohhhh

* rename RxCheck from merge

* more rename

* checked data and found 0x1A6 does not exist on any Bosch, so combining with 0x296 is safe

* formatting

* need this since refactor

* clean up

* fixup

* misra

* coverage caught another bug!

* another duplicate addr from multi tests

* proper base class

* formatting

* misra

* flat

* Revert "flat"

This reverts commit d5ea2adf26.

* forgot to specify bus (fuzzy test caught it, but whitelisting rx addrs
would so much quicker)
2023-11-27 00:18:24 -06:00
Shane Smiskol beffd7bcbf
Nissan: check bus for brake pressed msg (#1740)
* never checked bus!

* easy fix
2023-11-26 21:07:20 -06:00
Adeeb Shihadeh 6eb89cefdf
board: remove set_phone_power (#1747) 2023-11-25 13:17:08 -08:00
Adeeb Shihadeh c67c973b99 Revert "Honda: fix alt brake address check race condition (#1723)"
This reverts commit 42a62936fb.
2023-11-24 16:49:55 -08:00
Adeeb Shihadeh aa6ea0772b Revert "safety: check interceptor msg counter (#1738)"
This reverts commit 83acc65743.
2023-11-24 16:49:26 -08:00
Adeeb Shihadeh dc1fd96118
Revert "H7: fix GMLAN bitbang timer (#1542)" (#1745)
This reverts commit 5778c0ae5d.
2023-11-24 16:00:18 -08:00
Adeeb Shihadeh 666a462450
remove low level LIN support (#1744) 2023-11-23 17:18:25 -08:00
Adeeb Shihadeh 4c0d2505b7
remove k-line driver (#1743) 2023-11-23 17:09:10 -08:00
Adeeb Shihadeh 3b22bc18c6
safety: more int -> bool (#1742) 2023-11-23 16:48:08 -08:00
Adeeb Shihadeh f1cd12651c
safety: remove LIN hook (#1741)
* safety: remove LIN hook

* rm more
2023-11-23 16:30:20 -08:00
Adeeb Shihadeh 194f2d9657 safety: cleanup comments 2023-11-23 16:16:03 -08:00
Shane Smiskol 83acc65743
safety: check interceptor msg counter (#1738)
* toyota: check interceptor counter

* add counters and check rx

* honda: check counter

* clean up
2023-11-21 17:23:37 -08:00
Shane Smiskol 42a62936fb
Honda: fix alt brake address check race condition (#1723)
* common honda addr checks

* oohhhh

* rename RxCheck from merge

* more rename

* checked data and found 0x1A6 does not exist on any Bosch, so combining with 0x296 is safe

* formatting

* need this since refactor

* clean up

* fixup

* misra

* coverage caught another bug!

* another duplicate addr from multi tests

* proper base class

* formatting

* misra

* flat

* Revert "flat"

This reverts commit d5ea2adf26.
2023-11-20 19:27:18 -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