Commit Graph

234 Commits

Author SHA1 Message Date
Igor Biletskyy
285addeef2 Revert "boardd: new class USBDevice (#23015)"
This reverts commit 4061f50da3.
2021-12-16 17:11:45 -08:00
Dean Lee
4061f50da3 boardd: new class USBDevice (#23015)
* USBDevice

* merge master

* rebase master

* add to fiels_common

* inline functions

* namespace

* init err

* remove nested if

* cleanup

* bump panda for branch

* change includes

* bump panda branch

* change name

* bump master panda

Co-authored-by: Igor Biletskyy <briskspirit@users.noreply.github.com>
Co-authored-by: Igor Biletskyy <bs@privacy.im>
2021-12-16 16:53:48 -08:00
Adeeb Shihadeh
a793b949be boardd: add controls heartbeat (#23185)
* boardd: add controls heartbeat

* bump panda

* bump again

* bump panda
2021-12-15 17:58:16 -08:00
Dean Lee
4aa291c406 Use std::unique_ptr to manage memory (#23168)
* use unique_ptr

* trigger ci

* move down loggerdstate
2021-12-13 14:16:53 +01:00
Dean Lee
9decd3d8a2 util: move all functions into util namespace (#23203) 2021-12-12 14:42:23 -08:00
Robbe Derks
bb7208f4c3 add check for restoring almanac, and clear like suggested in the datasheet (#23153)
Co-authored-by: Comma Device <device@comma.ai>
2021-12-08 14:13:56 +01:00
Dean Lee
827fae8faa panda: refactor can_send (#22981)
* refactor

* merge master

* fix

* move  down

* space

* merge master

* remove struct PacketWriter, use function

* Update selfdrive/boardd/panda.cc

less violations

* Update selfdrive/boardd/panda.cc

comment

* Update selfdrive/boardd/panda.cc

add comment to counter

Co-authored-by: Igor Biletskyy <briskspirit@users.noreply.github.com>
2021-12-06 20:04:25 -08:00
Igor Biletskyy
e294e1620e len_to_dlc make static (#23120) 2021-12-03 16:37:17 -08:00
Dean Lee
599c07e027 panda: refactor can_recv (#22977)
* refactor

* use macro

* rebase master

* fix incorrect chunk_len

* cleanup

* type fix

* lines

* while

Co-authored-by: Igor Biletksyy <bs@privacy.im>
2021-12-02 16:28:38 -08:00
Igor Biletskyy
65ca9be82a boardd: split usbprotocol unittest and fix paren order in data length assert (#23065) 2021-11-29 15:34:33 -08:00
Dean Lee
35c0319f6c boardd: new function sync_time (#23033)
* sync_time

* add direction

* Update selfdrive/boardd/boardd.cc

Co-authored-by: Willem Melching <willem.melching@gmail.com>

* enum class

* rename

* caps

* lambda get_time_str

* Revert "lambda get_time_str"

This reverts commit 5eb6e19c5130b28963e9555f6c73835ac30d817d.

* static

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-29 11:19:38 +01:00
Igor Biletskyy
b2a018643f Extra check for tail_size length (#23047) 2021-11-27 12:22:54 -08:00
George Hotz
c6f62ebc4f Revert "boardd: be careful with paren order in assert"
This reverts commit 50cd8588a2.
2021-11-27 00:57:30 -05:00
George Hotz
50cd8588a2 boardd: be careful with paren order in assert 2021-11-27 00:28:33 -05:00
Dean Lee
ab9c7a11a9 boardd: const reference pandaStates to avoid copy (#23030) 2021-11-24 15:45:48 -08:00
Dean Lee
c77354009c panda: add unit tests for usb protocol (pack/unpack) (#22955)
* prepare for unit tests

* add to selfdrive_tests.yaml

* test header

* test chunk count

* rename test function

* continue

* don't check chunks count

* test recv_can

* continue

* small cleanup

* merge master

* cleanup

* rename functions

* test different packet size

* fix operator precedence problem

* refactor unpack_can_buffer

* cleanup test

* cleanup unpack_can_buffer

* add test for multiple pandas

* rename to test_panda

* restore test_boardd

* rename to test_boardd_usbprotocol

* fix typo

* bus_offset = [0,4]

* change src

* use USBPACKET_MAX_SIZE
2021-11-23 20:15:22 -08:00
Adeeb Shihadeh
d482b2d0a2 boardd: small cleanup (#23005) 2021-11-22 15:15:03 -08:00
Adeeb Shihadeh
a405fc5d43 boardd: add note about slow disconnected panda check 2021-11-21 00:32:05 -08:00
Adeeb Shihadeh
fb32381a88 boardd: set thread names 2021-11-21 00:20:33 -08:00
Adeeb Shihadeh
944fa5fa08 boardd: resolve TODO, still need that for USB errors 2021-11-20 19:06:47 -08:00
Adeeb Shihadeh
e13630dfee faster jenkins (#22973)
Co-authored-by: Comma Device <device@comma.ai>
2021-11-18 23:43:09 -08:00
Igor Biletskyy
edaf7d7604 fix chunk buffer size (#22969) 2021-11-18 14:15:06 -08:00
Dean Lee
57db99700c panda: fix len_to_dlc always return 1 if len > 24 (#22964) 2021-11-18 13:02:36 -08:00
Dean Lee
0716635808 boardd: fix a panda may be connected by multiple panda instance (#22932)
* fix bugs in main

* no auto
2021-11-17 19:25:21 -08:00
Dean Lee
841fb93def boardd/can_recv_thread: improve caching for can_frame (#22944)
* better cache

* use emplace to remove copy&realloc

* rebase master
2021-11-17 17:54:14 -08:00
Igor Biletskyy
47d0d717eb panda.cc: struct for CAN header, counter complexity, cleanup for readability (#22956)
* try struct

* can_send refactor

* cleanups

* Resize vector only when it is needed

* ...

* more cleanup
2021-11-17 16:00:18 -08:00
Dean Lee
10bca095c2 boardd/usb_connect: remove unused variable params (#22931) 2021-11-16 13:06:58 -08:00
Igor Biletskyy
04e1a25881 panda.cc: add functions to set can and data speed (#22920) 2021-11-15 16:10:39 -08:00
Willem Melching
8e12b9ca76 boardd: fix segfault when SIGINT with no pandas (#22914)
* boardd: fix segfault when SIGINT with no pandas

* remove if block

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
2021-11-15 14:10:08 +01:00
Adeeb Shihadeh
e8598f7455 add multipanda to loopback tests (#22900) 2021-11-13 17:39:51 -08:00
Adeeb Shihadeh
5ffb3e4347 boardd: apply bus offset in can recv 2021-11-13 17:11:25 -08:00
Igor Biletskyy
e293ccf016 New usb protocol for panda (#22752)
* first try

* move dlc_to_len

* panda switch to mailbox branch

* add bitstruct to pipfile

* bump panda and remove bitstruct

* few cleanups and fixes

* sanity check data.size == dlc_to_len

* check problem with test

* Revert "check problem with test"

This reverts commit b4855b7c12188d36d5d510e729344dab2cf21be9.

* clean

* revert Pipfile.lock

* that was an issue???

* fix crash

* ...

* include dlc_to_len from panda

* alph

* define macros for returned and rejected

* cleanup

* bump panda to current master
2021-11-12 16:47:26 -08:00
Mayfield
5246f0231e enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-02 17:08:53 +01:00
Dean Lee
7486a42935 boardd: pass std::vector pandas by reference (#22741) 2021-10-30 15:34:33 +02:00
Robbe Derks
585c16cd2a Multipanda support (#22402)
* squash all PR commits for easy rebase

* merged all panda rx can into one message

* fix buffers in can_send

* more cleanup and minor fixes

* fix even more stuff

* fix non-allocated send buffer

* make connecting more robust

* fix bus offset

* fix controls_mismatch?

* simplify mismatch check

* C++ style struct

* fix connect loop

* update ref

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-10-29 13:04:26 +02:00
Robbe Derks
21c4bfc7be Pigeon (ublox) initialization fixes (#22712)
* add timeout to wait_for_ack

* fix ignition edge detection race condition

* local_ignition -> ignition_local

* gate power_save on !pigeon_active

* millis_since_boot

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

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-10-28 11:23:19 +02:00
Adeeb Shihadeh
5b331fd6f5 don't set core affinity on PC (#22706) 2021-10-26 21:51:46 -07:00
Adeeb Shihadeh
93d87cdc6f test_boardd: don't modify environment at import time 2021-10-25 09:47:07 -07:00
Adeeb Shihadeh
b5960b9dc8 move nose tests to unittest (#22665)
* move to unittest

* boardd loopback

* no more nose

* phone only

* fix panda decorator
2021-10-25 09:44:04 -07:00
Adeeb Shihadeh
84de248fa7 tici: affine loggerd to efficiency cores (#22581) 2021-10-18 13:21:24 -07:00
Adeeb Shihadeh
2f1ab63920 boardd: reduce unnecessary allocations (#22494) 2021-10-08 16:16:23 -07:00
Robbe Derks
91987f38d4 Make pandaState and safetyMode a list (#22454)
* wip: move to pandaStates

* bump cereal

* wip: SafetyMode struct

* move to safetyMode

* fix typo

* this can be None

* fix potential empty pandaStates list

* fix thermald

* fix controlsd

* rename safetyModes to safetyConfigs

* update process_replay

* fix test_models

* bump cereal
2021-10-08 17:54:34 +02:00
Willem Melching
43d9478740 boardd: fix context leak in init_usb_ctx (#22472) 2021-10-07 13:24:38 +02:00
Willem Melching
b9797259ed boardd: lower log level for ublox msg timing issues 2021-10-07 11:07:43 +02:00
Willem Melching
3e854b8351 safety_setter_thread: exit on ignition low (#22426) 2021-10-04 15:00:25 +02:00
Dean Lee
47f601e50a boardd: wait for safety_setter_thread to finish while quitting panda_state_thread (#21961)
* rebase master

* merge master

* merge master

* remove space
2021-10-04 14:38:35 +02:00
Willem Melching
f4e2537b12 Split pandaState into peripheralState and pandaState (#22385)
* publish peripheralState from boardd

* refactor consumers

* rename thread

* peripheralState has panda type too

* add to process replay

* fix device build

* properly remove hardware unsupported alert

* latest peripheralState

* remove pandaState from thermal_monitor

* put that back

* add back harness check

* fix cloudlog

* needs pandaState

* Update selfdrive/thermald/tests/test_power_monitoring.py

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

* dont conflate

* Update selfdrive/thermald/tests/test_power_monitoring.py

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

* pigeon is peripheral

* cleanup

* less global

* comment

* move rtc to peripheral_control_thread

* better diff?

* whitespace

* get msg

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-10-04 11:30:11 +02:00
Willem Melching
abaa7b2d55 Don't send empty pandaState from panda_state_thread (#22393) 2021-10-01 09:05:33 +02:00
Willem Melching
a60f3c6a35 move acados deps out of devpackages (#22376)
* move acados deps out of devpackages

* fix new pylint errors
2021-09-29 23:20:33 +02:00
Dean Lee
e90eb79ceb boardd: new function get_time_str (#22158)
* new function get_time_str

* apply review
2021-09-13 10:32:12 -07:00