Commit Graph

52 Commits

Author SHA1 Message Date
Dean Lee
97e9d55588 cpplint: build/include_what_you_use (#29556)
* include_what_you_use

* remove comments

* include <memory>

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2d99521e75
2023-08-23 13:25:17 -07:00
Dean Lee
69d7394e5c boardd: check fw version when connecting (#28823)
* Check fw version when connecting

* apply reviews

* mv to boardd

* don't keep looping

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: b9cffac29c
2023-07-08 20:06:10 -07:00
Comma Device
8a91f7cd30 boardd: only look for new usb pandas
old-commit-hash: 78df554217
2023-05-25 19:35:57 -07:00
Adeeb Shihadeh
bf804f25bf boardd: connect to SPI panda by UID (#27035)
* move list

* connect by serial

* cleanup hw serial

* little more

* rm excessive print

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 66ff2de0a2
2023-01-21 19:42:10 -08:00
Robbe Derks
f2cab9a00c No more magic for the can chunks (#26861)
* remove magic and add checksum

* add comms reset

* bump submodule
old-commit-hash: 3136985b95
2023-01-13 15:01:55 -08:00
Adeeb Shihadeh
dda7913a33 boardd: misc spi fixes (#26670)
old-commit-hash: 9cc06e9ea6
2022-12-02 11:51:25 -08:00
Adeeb Shihadeh
a6f2f2d751 boardd: cleanup defs from panda (#26628)
* more stuff

* bump pnada
old-commit-hash: c3e3047080
2022-11-29 16:05:46 -08:00
Adeeb Shihadeh
5c123f01b4 boardd: prep for SPI + factor out USB (#26356)
* merge origin/spi-panda

* just prep

* boardd: factor out USB comms

* fix those

* add to release files

* little more
old-commit-hash: 06be96cae2
2022-11-04 16:36:27 -07:00
Greg Hogan
1d4e4197e2 add CAN-FD non-ISO mode support (#25947)
CAN FD non-ISO support

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: d5ef6f82e6
2022-10-12 15:40:19 -07:00
Igor Biletskyy
e39767b1cb boardd: add CAN health to pandaStates (#25800)
* init

* try this

* mistake

* fix

* bump cereal

* make obvious

* fixes

* remove comment

* one helath header

* ..

* preallocate vectors
old-commit-hash: 53959082e7
2022-09-20 12:39:12 -07:00
Adeeb Shihadeh
caac56b92e USB power mode cleanup (#25619)
* first pass at usb power mode cleanup

* fix build

* a sneaky one

* little more

* fix build

* bump pnada

* remove that

* power monitoring cleanup

* fix tests

* bump submodules
old-commit-hash: 28cb1897cb
2022-08-31 21:13:53 -07:00
Shane Smiskol
121b708ba1 Change safetyParam to uint16_t (#24376)
* bump panda & cereal

* bump panda

* rest of references

* regen TOYOTA with safety param 578, TOYOTA2 with 329

* regen rest of routes

* update ref

* bump cereal
old-commit-hash: 4190d2608a
2022-05-02 13:34:31 -07:00
Shane Smiskol
ebec632ea2 Make safetyParam unsigned (#24160)
* bump panda & cereal

* make unsigned in boardd

* update health packet version

bump panda

* fix definition

* bump

* regen TOYOTA2 route

* upload route

* oh, ndog param wasn't being set

* regenerate routes with non-zero safety params

* update refs

* regen routes and update refs

* bump panda

* update refs

* update refs

* bump submodules to master
old-commit-hash: 6e62df65d7
2022-04-21 00:01:05 -07:00
Shane Smiskol
4bbc197433 update unsafeMode to alternativeExperience (#23995)
* update unsafeMode to alternativeExperience

* fix

* fix

* bump submodules

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e91613bc62
2022-03-24 14:59:16 -07:00
Igor Biletskyy
c60d1ca766 panda.cc: add panda deep sleep mode(#23911)
* needed for panda deepsleep mode

* add set_deepsleep to panda.cc

* rename to enable_deepsleep

* remove void

* fix value

* bump panda
old-commit-hash: 0b64ddb678
2022-03-07 18:55:16 -08:00
Willem Melching
baebb2c932 handle usb error in reading panda state (#23686)
old-commit-hash: f2eb84eef0
2022-02-10 13:52:24 +01:00
Adeeb Shihadeh
e1f383c25a boardd: get health struct from panda (#23648)
old-commit-hash: 9dca040ed9
2022-01-27 19:22:44 -08:00
Adeeb Shihadeh
962c53cad5 boardd: add blocked msg cnt (#23647)
* boardd: add blocked msg cnt

* bump panda

* bump panda
old-commit-hash: 43c6ea8e73
2022-01-27 17:48:24 -08:00
Shane Smiskol
183715ccea controlsd: verify unsafe mode consistency (#23563)
* add unsafe mode check to controlsd

bump submodules

forgot to add to health_t struct

bump

ahh forgot to set it!

bump

bump

clean up

clean up

bump

* fix ordering

* move to end

* unsigned

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 31d147dca2
2022-01-25 12:09:13 +01:00
Igor Biletskyy
f532819faf Revert "boardd: new class USBDevice (#23015)"
This reverts commit 6965aa0b903060ab38aace31c15fefdc7a0429eb.

old-commit-hash: 285addeef2
2021-12-16 17:11:45 -08:00
Dean Lee
49c35a70b5 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>
old-commit-hash: 4061f50da3
2021-12-16 16:53:48 -08:00
Adeeb Shihadeh
0386f99c1f boardd: add controls heartbeat (#23185)
* boardd: add controls heartbeat

* bump panda

* bump again

* bump panda
old-commit-hash: a793b949be
2021-12-15 17:58:16 -08:00
Dean Lee
a0c6a65d09 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>
old-commit-hash: 827fae8faa
2021-12-06 20:04:25 -08:00
Igor Biletskyy
be3a376967 len_to_dlc make static (#23120)
old-commit-hash: e294e1620e
2021-12-03 16:37:17 -08:00
Dean Lee
15bac98ad4 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>
old-commit-hash: 599c07e027
2021-12-02 16:28:38 -08:00
Dean Lee
a919e5721e 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
old-commit-hash: c77354009c
2021-11-23 20:15:22 -08:00
Igor Biletskyy
989270ac56 fix chunk buffer size (#22969)
old-commit-hash: edaf7d7604
2021-11-18 14:15:06 -08:00
Igor Biletskyy
8844b560d0 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
old-commit-hash: 47d0d717eb
2021-11-17 16:00:18 -08:00
Igor Biletskyy
34ad595349 panda.cc: add functions to set can and data speed (#22920)
old-commit-hash: 04e1a25881
2021-11-15 16:10:39 -08:00
Igor Biletskyy
841c20b412 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
old-commit-hash: e293ccf016
2021-11-12 16:47:26 -08:00
Robbe Derks
dbe4641e04 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>
old-commit-hash: 585c16cd2a
2021-10-29 13:04:26 +02:00
Adeeb Shihadeh
39811d083f boardd: reduce unnecessary allocations (#22494)
old-commit-hash: 2f1ab63920
2021-10-08 16:16:23 -07:00
Willem Melching
11066c6236 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>
old-commit-hash: f4e2537b12
2021-10-04 11:30:11 +02:00
Igor Biletskyy
2e1ea456f0 add function to list connected pandas to panda.cc (#21989)
* add list() to panda.cc

* std:size instead of sizeof

* refactor usb init

* change serial length to 26 to get null terminated

* safer char to string

* forgot variable

* initialize descriptor array

* ...

* move init usb out of class

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 603ad435be
2021-08-30 19:20:50 -07:00
Igor Biletskyy
b82c83ccae Add argument to Panda to connect by serial number (#21905)
* Add list() to panda.cc

* add default

* change var names

* comments

* advices

* revert

* ...

* ..

* connect by serial

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: fc56ae70ee
2021-08-19 19:06:24 -07:00
Adeeb Shihadeh
f8cd0061c8 log on startup when panda heartbeat is lost (#21151)
* log when heartbeat lost

* bump panda

* bump panda

* add to pandaState

* move that
old-commit-hash: f04d6a9b3f
2021-06-04 23:22:08 -07:00
Dean Lee
5609f32cee Cleanup includes (#20925)
* remove #include <pthread.h>

* remove #include<stdbool.h> for cc files

* remove #include<iostream>
old-commit-hash: 0495426535
2021-05-17 10:31:31 +02:00
Adeeb Shihadeh
3fbeb1299e boardd: set can and pandaState valid flags (#20899)
* boardd: set can and pandaState valid flags

* add event

* bump cereal

* consistency
old-commit-hash: e694f0b4d6
2021-05-14 21:26:02 -07:00
Dean Lee
e333e4f189 Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20d
2021-05-08 22:15:17 -07:00
Willem Melching
1d79459667 Remove panda set power functions (#20712)
* remove panda set power functions

* removed
old-commit-hash: 34328ba305
2021-04-20 15:31:19 +02:00
Willem Melching
e3d92dc714 verify safetyParam read back from PandaState (#20384)
* verify safetyParam read back from PandaState

* update ref

* bump panda
old-commit-hash: 3c23226edc
2021-03-17 14:20:05 +01:00
Adeeb Shihadeh
865974a40b turn pigeon off when going offroad (#20296)
* cleanup

* power off pigeon

* comment

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: dd74f09eab
2021-03-09 22:48:27 -08:00
Adeeb Shihadeh
05eb44115e cereal cleanup part 2 (#20092)
* car stuff

* thermal

* Revert "car stuff"

This reverts commit 77fd1c65ebd01abfa8493ae12c9e6b14f7ada976.

* panda state

* camera stuff

* start deg

* most is building

* builds

* planner + controls run

* fix up paramsd

* cleanup

* process replay passes

* fix webcam build

* camerad

* no more frame

* thermald

* ui

* paramsd

* camera replay

* fix long tests

* fix camerad tests

* maxSteeringAngle

* bump cereal

* more frame

* cereal master
old-commit-hash: 312b681a46
2021-02-16 21:39:32 -08:00
Adeeb Shihadeh
966945880b Cereal cleanup (#20003)
* start cleanup

* fan speed

* cleanup dm

* fix cereal

* hwType -> pandaType

* update refs

* update refs

* bump cereal

* freeSpacePercent

* cereal master
old-commit-hash: 000bd226aa
2021-02-03 19:57:30 -08:00
Dean Lee
41368ada11 Panda: use 'std::atomic<bool> connected' to ensure thread-safety (#19954)
old-commit-hash: 0b75a85adc
2021-01-28 11:35:13 -08:00
Dean Lee
24ffdd6183 Panda: refactor get_firmware_version, return std::optional<std::vector> (#19896)
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: c4215d8476
2021-01-28 16:25:05 +01:00
Dean Lee
7194e5926e panda: refactor get_serial, return std::optional<std::string> (#19895)
old-commit-hash: 96cc633d91
2021-01-28 16:21:18 +01:00
Dean Lee
c8935f44a1 Fix panda: dangling pointer problem in can_receive (#19892)
* refactor can_receive

* still send empty msg
old-commit-hash: b0c0de5b66
2021-01-26 16:04:38 +01:00
Dean Lee
fe457a93d5 Panda: replace pthread_mutex with std::mutex (#19909)
old-commit-hash: 5594b8f3cb
2021-01-26 14:57:55 +01:00
Shane Smiskol
2b9b7182d8 Abstract set_unsafe_mode function to Panda (#2431)
* Abstract set_unsafe_mode function to panda.cc

* whoops

* use uint16_t
old-commit-hash: 5eea86cbf4
2020-10-28 13:21:07 -07:00