Commit Graph

251 Commits

Author SHA1 Message Date
Adeeb Shihadeh de061e4f73
remove rest of gmlan (#1908)
* remove rest of gmlan

* fix

* update struct

* update
2024-03-21 13:56:36 -07:00
Adeeb Shihadeh 567dbfe6d8
remove comma pedal (#1902) 2024-03-17 22:22:46 -07:00
Adeeb Shihadeh 6dfd4db4ab
remove rtc (#1897)
* remove rtc

* fix build

* rm taht

* revert that
2024-03-11 16:08:43 -07: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
Cameron Clough 0c7d5f11d7
use pyupgrade to update syntax (#1889) 2024-02-24 13:56:28 -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
Willem Melching eb9b0df727
Reset baudrate when connecting from Python (#1837)
* Reset baudrate when connecting from Python

* unused
2024-01-25 13:17:19 -08: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 41b008274b
pre-commit: autoupdate hooks (#1789)
* Update pre-commit hook versions

* fix

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2024-01-17 11:35:20 -08:00
Adeeb Shihadeh 08ca10e91c
add AEB enable flag (#1791) 2024-01-11 15:37:43 -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
Adeeb Shihadeh 6eb89cefdf
board: remove set_phone_power (#1747) 2023-11-25 13:17:08 -08:00
Adeeb Shihadeh 4c0d2505b7
remove k-line driver (#1743) 2023-11-23 17:09:10 -08:00
Adeeb Shihadeh a1d699b87d
SOM boot recovery (#1712)
* reset

* simpler

* only once per panda boot

* cleanup

* also check serial
2023-11-09 18:01:46 -08:00
Jason Wen 3f25ccabd6
Subaru Pre-Global: Reverse driver torque signal for certain platforms (#1648)
* Subaru Pre-Global: Reverse driver torque signal for certain platforms

* added flag

* fix tests

* use dbc instead

* duplicate

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
Co-authored-by: Justin Newberry <justin@comma.ai>
2023-11-08 15:27:20 -08:00
Adeeb Shihadeh aaa1172fa2
HITL bootkick tests (#1685)
* HITL bootkick tests

* both bootkick cases

* more

* som use gpio

* cleanup

* pretty reliable now
2023-10-06 13:38:35 -07:00
Adeeb Shihadeh f42b65ca32
skip flash if up to date (#1686)
* skip flash if up to date

* fix
2023-10-05 13:13:40 -07:00
Adeeb Shihadeh b6e37f25b6
Remove flash logging (#1674)
* Revert "Disable flash logging (#1667)"

This reverts commit 62db60595b.

* Revert "Faster log retrieval (#1484)"

This reverts commit 694aae9c26.

* Revert "Flash bounds checking outside of bootstub (#1459)"

This reverts commit 054344de6b.

* Revert "Logging (#1445)"

This reverts commit 0cc91a7f7b.

* cleanup

* cleanup
2023-09-30 12:49:46 -07:00
Adeeb Shihadeh d87d33cb51
pre-commit: autoupdate hooks (#1639)
* Update pre-commit hook versions

* fix

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-09-07 19:10:30 -07:00
Jason Wen 39bc5a4886
Nissan Altima: add a param for alternate EPS bus (#1649)
* Nissan Altima: Specify panda flag for alt bus safety config

* test this safety mode

* test this safety mode

* rm

* nl

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 00:46:33 -07:00
Adeeb Shihadeh a4fa40a713
python: show lib and fw versions in error (#1622)
* python: show lib and fw versions in error

* fix

* cleanup
2023-08-30 10:56:30 -07:00
Adeeb Shihadeh bc2f10da57 Revert "pre-commit: autoupdate hooks (#1618)"
This reverts commit 526588b3e9.
2023-08-30 10:38:12 -07:00
Adeeb Shihadeh 526588b3e9
pre-commit: autoupdate hooks (#1618)
* Update pre-commit hook versions

* fix ranges

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-30 01:27:07 -07:00
Jason Wen e6c1648835
Hyundai CAN-FD: Alternate `LKAS` steering message (#1504)
* new steering message!

* fix

* check tx

* fix var

* allow all tx to test LFA suppression

* Attempt to block laneline information to suppress LFA

* Try 0x364

* Block all bus 2/6 messages

* Final test to block LFA

* Fix tx

* in another PR

* cleanup

* lint

* Add new tx to unit test

* linter

* Apply suggestions

* Revert to this

* Unnecessary

* clean up

* rename to hda2

* prototype

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-29 23:40:14 -07:00
Adeeb Shihadeh 09cd81752d
python lib: close USB context properly (#1606)
* python lib: close USB context properly

* fix jungle

* rm that

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-08-24 19:15:37 -07:00
Justin Newberry 3d91d78018
Revert "Subaru: infrastructure to support the new angle based control… (#1601)
Revert "Subaru: infrastructure to support the new angle based controllers (#1590)"

This reverts commit ea16a54166.
2023-08-22 17:30:11 -07:00
Justin Newberry ea16a54166
Subaru: infrastructure to support the new angle based controllers (#1590) 2023-08-22 00:21:19 -07:00
Justin Newberry 8bd3e93813
Subaru: Global gen1 longitudinal safety (#1500)
* Add subaru long TX and RX messages

* misra c2012 fix

* fix tests

* Reorder signals

* increase max steering torque

* merge fix

* merge fix, remove cnt from test

* Move subaru logitudinal behind flag, add safety test

* update subaru_longitudinal checks

* cleanup

* Add subaru longitudinal checks

* misra fix

* Add subaru rpm and throttle rate limit checks

* temporary disable cruise throttle and cruise rpm checks

* update subaru long test

* update longitudinal safety and add tests

* fix tests

* fix misra

* subaru long signals limits checks

* Add controls_allowed to long tests

* remove unused variables

* Add AEB passthru and tests

* Add bus

* Update AEB logic

* Add GEN2 AEB support

* syntax fix

* Update AEB tests

* Add comment for subaru_aeb

* Do not check cruise_throttle and cruise_rpm limits when gas pressed

* use long limits struct

* Subaru: longitudinal checks only when controls_allowed, use ES_LKAS_State LKAS_Alert for AEB

* fix misra, set controls_allowed for es_brake test

* fix misra

* Fix es_brake violation check

* Add 0x323 to longitudinal test

* Remove stock fcw from aeb signals

* Use GET_BYTES

* Revert "export FW_PATH"

This reverts commit 2a5058d858.

* Revert "cleanup fw filename conventions (#1434)"

This reverts commit 4dd2735e38.

* Revert "Revert "export FW_PATH""

This reverts commit 86e8d321d0.

* Revert "Revert "cleanup fw filename conventions (#1434)""

This reverts commit 5aae6716fa.

* cleaned up safety

* cleanup subaru long safety

* subaru_aeb -> stock_aeb for other platforms

* fix unittests

* pretty

* need to upload this route

* remove AEB stuff for now

* remove unrequired rpm checks

* add comment

* added comment about acceleration and use throttle limit for rpm too

* inactive_throttle_fix

* Update board/safety/safety_subaru.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* added comments about long limits

* increase max brake

* revert that

* cleanup

* rename throttle to gas

* add safety replay

* remove todo

* rename throttle to gas

* move subaru stuff out of common test

* PR cleanup

* added min gas

* reduce initial complexity by not intercepting cruisecontrol or brake_status

* create common gas brake safety test

* remove unrelated subaru reference

* also test below min_value

* fix fwd hook test

* better name and hardcoded

* use same as acceleration limits

* revert gm

* remove callable

* also limit rpm

* remove safety replay for now

* revert unrelated changes

* pr cleanup

* remove unused gasbrake safety test

* fix ruff linter

* PR cleanup

* pr cleanup?

* added common brake test and moved generic test to base safety class

* remove duplicate test

* wip

* wip

* rename longitudinalaccelsafety

* revert limits correct test

* fix controls allowed test

* move gm over to long gas brake test

* assert that limits are reasonable

* fix typing

* fix linter again

* fix linter again

* fix linter again

* like to make it clear

* typo

* fix from merge

* clearer names

* dont need thesemore

* subaru: use common test

* fix merge issue

* inactive gas from long limits

* fix tests

* linter

* fix gen2

* fix linter

* also test torque when doing long control

* renamre transmision rpm

* consistent whitespace

* rename declarations too

* rename transmission rpm

* same line

* actually is transmission rpm

---------

Co-authored-by: Martin Lillepuu <martin@mlp.ee>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-15 18:51:13 -07:00
Justin Newberry 4ea50fbb09
Ruff: propgate config from OP (#1579) 2023-08-14 12:52:02 -07:00
Adeeb Shihadeh 972b0dca94
don't try to reflash bootstub when reconnecting 2023-08-06 23:06:26 -07:00
Adeeb Shihadeh 33a95d6bea
pedal: fix warning on invalid serial (#1563)
* pedal: fix warning on invalid serial

* fix

* fix:

* shouldn't need that

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-08-06 13:47:37 -07:00
Adeeb Shihadeh c66b98b2a6
finish esp/gps removal (#1559) 2023-08-06 12:29:54 -07:00
Adeeb Shihadeh 130092e669 python: replace warning with logging 2023-08-05 14:10:33 -07:00
Adeeb Shihadeh dc07975446
python: fast reconnect (#1558) 2023-08-04 23:52:18 -07:00
Adeeb Shihadeh d7120be904
panda jungle (#1547)
* mv jungle

* match pedal style

* fix linter

* fix fw path

* fix paths

* safety!
2023-08-03 23:55:13 -07:00
Robbe Derks a945053ade
Force relay drive (#1539)
force drive

Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 16:33:34 -07:00
Adeeb Shihadeh 7f1944cf43
debug endpoint for custom clock source period (#1538)
* debug endpoint for custom clock source period

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 16:17:42 -07:00
Adeeb Shihadeh 1b706040cd
pre-commit: autoupdate hooks (#1536)
* Update pre-commit hook versions

* fix

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-08-01 11:14:27 -07:00
Adeeb Shihadeh 268f6bc2fb
python: lock hw device inside loop (#1522) 2023-07-18 00:03:17 -07:00
Adeeb Shihadeh 5d873444b2
SPI: connect by VERSION command (#1495)
* SPI: connect by VERSION command

* shorter timeout

* add exception

* simple test

* fallback

* bootstub check

* update comments

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-16 19:33:18 -07:00
Cameron Clough 0c33554624
Ford CAN FD safety (#1455) 2023-07-16 15:09:37 +01:00
Robbe Derks 694aae9c26
Faster log retrieval (#1484)
improve get_logs
2023-06-30 17:26:39 +02:00
Igor Biletskyy a35e9a1edb
CAN health: add IRQ call and core reset counters (#1453)
* initial

* old method

* comment
2023-06-28 14:40:00 -07:00
Igor Biletskyy 0f4e8f79f5
add IRQ rate helper function (#1471)
init
2023-06-20 11:47:43 -07:00
Robbe Derks 0cc91a7f7b
Logging (#1445)
* try 1

* some fixes

* fix some misra

* first poc working

* more things

* more misra fixes

* fix misra

* add rate limiting

* fix misra

* add some unit tests through libpanda

* add more tests and fix some stuff

* fix misra again

* add startup log hitl test

* list

* don't fail on wrong timestamps

* improvements

* fix tests

* expected logs test?

* not sure why this passed

* oh, it doesn't reset

* only show last few

* guess at expected logs

* needs this

* ugh

* reduce compiler warnings

* adjust expected logs

* this is correct

* is it really 1?

* min max

* reduce spam in SPI test

* some cleanup
2023-06-13 17:00:56 +02:00
Adeeb Shihadeh 4850b13797
python: move wait into connect() (#1456)
* python: move wait into connect()

* cleanup

* set that

* add that back

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-06-11 19:06:46 -07:00
Robbe Derks b563405904
Fix multiple resets due to not getting an ACK on reset (#1450)
* add send_once

* cleaner

* add debug log

* also in the USB one

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-06-09 16:25:49 +02:00
Adeeb Shihadeh 1a9a94c519
python: add helper to wait until panda comes up (#1447)
Co-authored-by: Comma Device <device@comma.ai>
2023-06-07 19:43:43 -07:00
Adeeb Shihadeh a29ee424bc
python: remove duplicate enter_bootloader (#1442) 2023-06-04 14:54:40 -07:00