Commit Graph

77 Commits

Author SHA1 Message Date
Jason Wen
5dc009be50 Merge branch 'upstream/panda/master' into sync-20251114 2025-11-16 02:40:37 -05:00
Adeeb Shihadeh
7973ba4492 CAN driver cleanup (#2276)
* it's all the same thing

* not live

* less macro

* lil more

* bool

* lil more
2025-09-10 20:00:41 -07:00
Jason Wen
39517742e6 Merge branch 'upstream/panda/master' into sync-20250908
# Conflicts:
#	python/__init__.py
2025-09-08 00:31:55 -04:00
Adeeb Shihadeh
e5a39a2cef misc cleanup (#2261)
* cleanup

* fix jungle

* one more
2025-08-26 15:01:22 -07:00
Adeeb Shihadeh
1ce986f75c bye bye f4 (#2259)
* bye bye f4

* lil more

* fix mac build

* update health idx
2025-08-26 12:37:36 -07:00
Jason Wen
2f42800648 Merge branch 'upstream/panda/master' into sync-20250731
# Conflicts:
#	pyproject.toml
#	python/__init__.py
2025-07-31 21:28:55 -04:00
Adeeb Shihadeh
1d9aa1beba SPI: spi_error_count is a better name (#2248)
SPI: rename spi_checksum_error_count -> spi_error_count
2025-07-30 18:20:18 -07:00
Adeeb Shihadeh
5ac6305a95 quick garbage collection pass (#2231)
* remove DPANDA

* -22

* lil more

* canfd

* lil more

* update cppcheck

* uart cleanup

* always harness

* sbu sense

* lil more

* enable spi

* rm ENABLE_SPI
2025-07-19 21:05:12 -07:00
Jason Wen
c52400dacd Merge branch 'upstream/panda/master' into sync-20250605 2025-06-05 21:43:36 -04:00
Maxime Desroches
e462c34d3d endpoint to set TIM1 period and channel pulse length (#2222)
works
2025-06-03 18:37:28 -07:00
Jason Wen
d09eebc6cb Merge branch 'upstream/panda/master' into sync-20250331 2025-03-31 21:32:13 -04:00
Jason Wen
ccb9581b1c Car safety: custom safety params (#75)
* init

* use latest opendbc pr ref
2025-03-15 17:19:30 -04:00
Robbe Derks
e3e5787650 Refactor and cleanup board init (part 1) (#2094)
* refactor out red chiplet

* global can mode set

* global led disable

* this is already done globally

* global harness init

* global spi gpio init

* init OBD_SBUx_RELAY pins in harness init

* this is already done in harness init

* global set_can_mode

* fix SWD on F4

* no more has_obd

* global enable_transceivers

* Revert "global set_can_mode"

This reverts commit 09e19c3e0c29aa69dbd5c3bb361e38f53c28f757.

---------

Co-authored-by: Comma Device <device@comma.ai>
2025-03-12 17:26:07 +01:00
Jason Wen
928b0eb225 MADS: remove controlsAllowedLat to maintain compatibility with stock cereal (#67) 2025-01-19 20:39:56 -05:00
Jason Wen
3ae376ecfe Modular Assistive Driving System (MADS) (#57)
* improvements on the state machine for exiting controls and improvements on replay drive, and optimizations

* New tests on hyundai for now to see how they behave with lkas  and main button pressed interchangeably

* cleaning up hyundai tests and ensuring we always cleanup mads states at the end of the tests

* Adjusting tests

* Adjusting the tests a bit more to ensure clean states

* Cleaning up and simplifying logic

* ensuring all tests always cleanup

* improving the state

* make static happy

* Refactor safety replay script for better debugging and update Honda safety code

The commit performs a comprehensive revision of the safety replay script, specifically focusing on introducing debug variables and enhancing the logging capabilities for improved debugging. Furthermore, changes were made to the Honda safety code. The test helpers within libpanda were also expanded for inclusion of additional test conditions.

* Introduce 'ACC_MAIN_OFF' as a new disengagement reason in Sunnypilot's 'safety_mads.h'

The Sunnypilot's 'safety_mads.h' file has been updated to include 'ACC_MAIN_OFF' as a new cause for disconnection in the 'DisengageReason' enumeration. If an 'acc_main_off' signal is received, the 'mads_exit_controls' function halts all requests for lateral control engagement. Additionally, the status of 'controls_requested_lat' now mirrors 'controls_allowed_lat' after a button press.

* simpler logic cleaner

* reorder code for readability

* tmp

* Refactor state transitions and add event handlers

Renamed StateTransition to EdgeTransition for clarity and updated related logic. Introduced event handlers for button presses and ACC state changes, reducing duplicated control flow code. Improved encapsulation and maintainability by restructuring state update functions.

* reorder

* Refactor MADS state handling logic

Removed redundant event handler functions and unnecessary timestamp fields to streamline the code. Simplified button and binary state updates by integrating logic directly into transition checks. Commented out unused fields

* adding some more tests

* split init

* format

* update naming

* Refine lateral control request logic in safety_mads.h

The logic for setting the `controls_requested_lat` variable in safety_mads.h has been refined. Previously, it switched state based on the current value of `controls_allowed_lat`. Now, it also takes into account the current state of `acc_main`, ensuring a more nuanced control request mechanism that accounts for different operational scenarios.

* Fix button state handling in mads_exit_controls logic.

Refactor button state transitions to better handle lateral control requests when ACC is active. Ensure controls are correctly disengaged under specific conditions, by setting `controls_requested_lat` more reliably during state transitions. This change improves safety by preventing inadvertent disengagement when ACC is not active.

* Add test for LKAS button press with ACC main on

This commit introduces a new test to ensure that controls remain enabled when the LKAS/LFA button is pressed while ACC main is on. It checks that LKAS button operations don't interfere with control permissions in this specific configuration, improving test coverage and preventing potential safety issues.

* Add mismatch detection and change mads_acc_main to bool

Enhanced mismatch detection logic by tracking cases where 'controls_allowed' is true while 'controls_allowed_lat' is false, updating the script to print relevant debug information. Additionally, changed the data type of 'mads_acc_main' and 'mads_acc_main_prev' from int to bool for improved type accuracy and consistency.

* update controls_allowed_lat_pkt on health pkt to actually follow is_lat_active() which has the final word on whether we can allow lat or not.

* Can't perform this test on toyota as we never really process a button disengagement for toyota

* wow, we forgot about pcm hyundai can-fd

* nuke nuke nuke

* Revert "nuke nuke nuke"

This reverts commit 9bf0de640a3439ac43c27bcbc6568853966d370b.

* update name

* event driven update states

* add get_pcm_main_cruise_available

* split PCM and non-PCM main cruise tets

* fix some

* pcm main cruise availability mutation

* toyota pass fake lkas btn pressed

* more

* make pcm acc main rising edge on init

* only falling edge when actually 0 (need test for mutation)

* misra

* remove state flags, main button related

* skip lkas related tests with toyota and subaru fake button

* need for honda

* static

* mutation

* misra

* skip nidec pcm alt

* engage mads if controls allowed rising

* static

* remove non pcm properties

* fixup! engage mads if controls allowed rising

* move back

* fix static

* move around

* Hyundai openpilot longitudinal main cruise button state handling

* main button unit test

* acc_main_on mismatch unit tests

* clean up old main cruise button unit tests

* add more reasons

* cleanup

* rename

* rearrange

* Revert "rearrange"

This reverts commit f07caaa5b98b74c23667b387430ac48ba95bf21c.

* more rearrange

* rename

* more

* too slow

* Revert "too slow"

This reverts commit 31a249aebfa9c985e37be050e525b6924ca9e83d.

* too slow v2

* cleanup

* rename

* more cleanup

* Parse more flags from alt exp, more tests, hyundai main cruise allowed

* missed

* mutation for controls allowed rising edge

* ford mutation

* Update tests/safety/test.sh

Co-authored-by: DevTekVE <devtekve@gmail.com>

* license

* unused

* remove

* comment

* Apply suggestions from code review

Co-authored-by: DevTekVE <devtekve@gmail.com>

* comment

* refactor alternative experience handling with helper function

* use always allowed mads button alt exp

* rename

* parenthesis

* use alternative experience for unit tests inits

* cleanup

* rename

* mutation tests for alternative experience flags

* bump timer

* test for disengage and no disengage lateral on brake

* test allow MADS engage with brake pressed

* rename

* move around

* button combo test

* use acc_main_on directly from global

* fix caught failures from last commit's fix

* Revert "use acc_main_on directly from global"

This reverts commit 346964f55d020a287a1a679e22691ad8873e2a64.

* Properly fix lmao

* Add support for LKAS button handling across Chrysler platforms

Introduced LKAS button message parsing for multiple Chrysler platforms, including specific handling for center stack button messages. Updated tests and safety configurations to reflect these changes, ensuring compatibility with different vehicle variants. This enhances modularity and improves safety feature integration.

* Dockerfile: point to sunnypilot/opendbc

* Happy days :)

* clean

* testx

* Revert "Happy days :)"

This reverts commit 7ea27b53c8f3b1e37677c1ce9498229fceac9de6.

* symlink prior building

* comment

* only parse mads lateral, not stock op's lateral

* do not allow controls allowed if acc_main_on is off

* expose system_enabled, do not allow controls allowed to steer if system_mads is off

* fix hyundai tests with acc_main_on requirement

* fix test with new controls allowed with system_mads off

* fix replay drive

* Change 'DISABLE_DISENGAGE_LATERAL_ON_BRAKE' to 'DISENGAGE_LATERAL_ON_BRAKE'

The commit modifies the usage of the 'DISABLE_DISENGAGE_LATERAL_ON_BRAKE' variable globally and replaces it with 'DISENGAGE_LATERAL_ON_BRAKE'. This change promotes correct and clear semantics, since the variable now indicates a state rather than the negation of a state.

* Adding some more debug printouts on replay drive

* remove unified engagement mode in panda

* treat MADS button as user entry

* controls allow should be allowed at all times

* squash! treat MADS button as user entry

* heartbeat for mads

* heartbeat mismatch exit control

* remove always allow mads button from alt

* move to safety_mads

* check heartbeat directly in main

* remove main cruise allowed from alt

* uint

* squash! check heartbeat directly in main

* update tests

* not needed

* fix mads_exit_controls sometimes not assigning disengage reason

* more disengage lateral on brake tests

* extern

* missesd

* honda mutation test

* again

* rename

* more dlob test

* update name

* fix tests

* fix panda tests

* Refactor MADS state management to simplify pointer usage.

This change replaces many pointer-based state variables with direct ones, improving code readability and reducing complexity. It also standardizes the use of `const` for parameters and updates function implementations accordingly. These improvements enhance maintainability and reduce potential for pointer-related errors.

* Simplify braking logic in m_mads_check_braking function

Removed redundant conditions to streamline braking logic. This change maintains functionality while improving code readability and maintainability. Only necessary checks are now performed to determine disengagement.

* Prevent lateral control engagement during braking

Added a condition to disable lateral control engagement when braking with disengage-on-brake enabled. This change is marked as a demonstration and is not final for merging. Moved the disengage_reason to be set only when an actual disengagement occurred.

* Refactor MADS state handling and fix type consistency

Remove redundant `get_mads_state` inline definition and migrate it to a static function. Fix return type syntax in `get_mads_pending_disengage_reason`. Minor formatting adjustments improve readability and code clarity.

Refactor disengagement logic with enhanced reason tracking

Added distinction between active and pending disengagement reasons to improve system state tracking. Updated related enums, structs, and logic to ensure proper handling during control transitions. Added new safety tests to verify behavior under braking and ACC conditions.

Refactoring lateral control permissions and brake checks in MADS

This revision refactors the MADS safety code. The aim is to simplify and improve readability. Operations and checks for brake states and lateral control permissions have been consolidated into fewer methods. In addition, unused 'previous_disengage' state tracking has been removed from MADSState structure to avoid unnecessary state tracking. Moreover, the 'can_allow_controls_lat' function has been removed entirely and its functionality has been incorporated into other functions, reducing the function count and complexity of the code. The braking status is now tracked with BinaryStateTracking for consistency. These changes maintain the system's functionality while optimizing the code and improving maintainability.

* Why MISRA, why!? WHY!???? I DIDNT EVEN TOUCH THIS FILE OR NOWHERE NEAR!

* Some format

* no more messing with misra

* const

* more generic names

* revert to validate

* are you srs

* make gpio.h stock again and add to supression lists the check on gpio.h since we are not even touching it and we don't plan on ever doing so

* hard code to skip heartbeat check

* update comment

* cleanup

* Update tests/safety/test_honda.py

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2024-12-15 18:05:31 -05:00
Jason Wen
9adc1717dc Revert "Modular Assistive Driving System (MADS) (#40)" (#54)
This reverts commit 4c2ccd7fe5.
2024-12-09 18:35:11 -05:00
DevTekVE
4c2ccd7fe5 Modular Assistive Driving System (MADS) (#40)
* alternative experience

* safety init

* fix

* more update

* not really

* misra

* Add Custom MIT License (#38)

* brake check was not handled

* revert

* alt -> lkas

* explicit checks

* support toyota and ford

* rename

* hyundai can-fd support

* only allow lkas if enabled

* hyundai: main button handling

* revert

* hyundai: main button heartbeat

* add logging for controls allowed lateral

* fix panda safety

* ford btn

* toyota btn

* fca btn

* honda btn

* mads safety tests

* more tests

* safety misra

* safety mutation

* misra

* mutation experiment

* fix

* ford test main button

* ford test lkas button

* more ford test

* hyundai lkas and main

* more ford

* hyundai canfd

* rename

* rename

* cleaner

* more fixes

* more hyundai tests

* no longer needed

* thanks for tests!

* more tests for lat

* more explicit

* make sure to reset

* try this out

* probably needed

* move

* misra

* not needed

* move to safety_mads

* not really needed

* remove

* MADS: Refactor MADS safety with improved state management (pull request #46)

Refactor MADS safety with improved state management

This commit introduces a major refactoring of the MADS safety module, improving state management and control flow. Key changes include:

Core Changes:
- Introduced a MADSState struct to centralize state management
- Removed global state variables in favor of structured state
- Implemented button transition handling with explicit state tracking (PRESSED/RELEASED/NO_CHANGE)
- Added state flags for button availability detection
- Simplified lateral control permission logic

Button Handling:
- Separated main button and LKAS button state tracking
- Added independent engagement states for each button
- Improved button press detection across multiple platforms
- Added support for main and LKAS buttons on Hyundai platforms
- Modified ACC main state handling

Testing:
- Added comprehensive test coverage for MADS state transitions
- Added new MADS-specific test base class for consistent testing across platforms
- Added mutation testing for state management
- Extended timeout for mutation tests from 5 to 8 minutes
- Added extensive button press validation tests
- Enhanced debugging output in replay drive tests

The refactored code provides a more organized implementation of MADS safety features while maintaining compatibility with existing safety checks.

* adding note

* adding ford (WIP)

* adding honda (WIP)

* adding toyota (WIP)

* adding chrysler (WIP)

* Standardize Button State Handling Across Platforms

Refactor button state handling by replacing integer constants with an enumerated `ButtonState` type and updating logic to improve readability and maintainability. This change affects button press detection in Ford, Honda, Hyundai, and Toyota safety modules and aligns them with a unified MADS button state approach. Enums provide a clearer understanding of button states and transitions, facilitating easier maintenance and future enhancements.

* Disable LKAS button press logic in Honda and Toyota safety.

The code for processing LKAS button presses has been commented out in both Honda and Toyota safety implementations. This change aims to investigate or temporarily halt the button press effects without removing the logic altogether. It will be important to test for any impacts this may have on vehicle control functionality.

* Remove commented out code in toyota_rx_hook function

This commit cleans up the toyota_rx_hook function by removing unnecessary commented-out code that checks for LKAS button presses on bus 2. This helps improve code readability and maintainability without altering the existing functionality.

* GM, mazda, nissan, subaru (global & preglobal)

* Honda LKAS

* Revert "Remove commented out code in toyota_rx_hook function"

This reverts commit d6b012c01a08118d91fad56c9f6ac2f92b671968.

* Toyota, Subaru Global LKAS

* nissan fix

* gm fix

* use speed msg to force rx

* im bored

* misra

* subaru/toyota/honda

* nope

* attempt

* go through all buttons

* try nissan

* more nissan

* nissan tests passed!

* subaru lkas test (not sure why it's not passing 2 and 3 values)

* Improved code organization in safety_subaru.h and test_subaru.py

This commit includes a minor restructuring in safety_subaru.h and test_subaru.py for better readability and flow. The condition check in safety_subaru.h for lkas_hud now has explicit parentheses. With regard to test_subaru.py, an unnecessary import was removed, and the sequence of steps in the test was reordered - now enabling mads and cleaning up mads_states happens before each subtest.

* Refactor tests to use _speed_msg instead of _user_brake_msg.

Updated the MADS safety tests to utilize the _speed_msg(0) function call in place of _user_brake_msg(False).

* Reworking the tests a little for clarity

* disabling lkas again on toyota temporarily

* fix mads condition to engage

* hyundai and honda good with new tests

* Redoing more tests

* update for safety tick ensuring mads control is exited while lagging

* Updating tests for toyota

* cleaning up tests on hkg

* commenting out temp_debug for future use

* revert

* constants

* cleanup

* format!

* match yota

* Apply suggestions from code review

* force

* explicit checks

* revert

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2024-12-05 19:39:36 -05:00
Adeeb Shihadeh
2fbf0c5ff8 fix indendation 2024-11-21 11:07:57 -08:00
Willem Melching
4a11d52e07 Control over FD flag of CAN messages (#2085)
* Control over FD flag of CAN messages

* misra
2024-11-21 11:04:09 -08:00
Maxime Desroches
ac9c1b3b3f misra8.7 (#2033)
* 8_7

* fix test
2024-09-20 15:51:27 -07:00
Maxime Desroches
ed831773ea misra21.15 (#2030)
* cast

* remove suppression

* make it more explicit
2024-09-19 10:35:11 -07:00
Adeeb Shihadeh
a727cecdb8 remove unused deepsleep stuff (#1914) 2024-03-22 14:48:49 -07:00
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
6dfd4db4ab remove rtc (#1897)
* remove rtc

* fix build

* rm taht

* revert that
2024-03-11 16:08:43 -07: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
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
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
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
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
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
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
f1cd12651c safety: remove LIN hook (#1741)
* safety: remove LIN hook

* rm more
2023-11-23 16:30:20 -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
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
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
c66b98b2a6 finish esp/gps removal (#1559) 2023-08-06 12:29:54 -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
Robbe Derks
694aae9c26 Faster log retrieval (#1484)
improve get_logs
2023-06-30 17:26:39 +02:00
Igor Biletskyy
5889e3784f H7: fix FDCAN_IR register check (#1480)
* init

* typo

* misra

* leftover
2023-06-21 18:56:10 -07:00
Igor Biletskyy
9d56e80390 Change can_health request method (#1472)
* init

* fix typo

* remove tx lost as fake and add rx lsot
2023-06-20 12:29:20 -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
Robbe Derks
2c937656cf Continuous harness detection (#1402)
* read in mV and make threshold board-dependent

* refactor and add SBU voltages to health

* refactor relay driving

* more refactoring and readout lock

* avoid race condition

* fix misra

* continuous detection

* 1Hz is fine

* another race condition

* use harness detection to trigger bootkick

* update orientation detection test

* more in-depth harness tests

* fix ignition

* fix

* raise threshold
2023-05-08 13:30:23 +02:00
Robbe Derks
fea1feb598 ADC cleanup (#1401)
* cleanup function names

* cleanup voltage reading

* define constant

* fix misra

* remove comments
2023-05-04 13:22:01 +02:00
Adeeb Shihadeh
3c75a8bc00 add fan stall count to health (#1355)
* add fan stall count to health

* fix misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:30:56 -07:00