mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 10:03:55 +08:00
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
This commit is contained in:
2
panda
2
panda
Submodule panda updated: ffb3109e28...2f3e2825e5
@@ -407,6 +407,7 @@ std::optional<bool> send_panda_states(PubMaster *pm, const std::vector<Panda *>
|
||||
cs[j].setCanDataSpeed(can_health.can_data_speed);
|
||||
cs[j].setCanfdEnabled(can_health.canfd_enabled);
|
||||
cs[j].setBrsEnabled(can_health.brs_enabled);
|
||||
cs[j].setCanfdNonIso(can_health.canfd_non_iso);
|
||||
}
|
||||
|
||||
// Convert faults bitset to capnp list
|
||||
|
||||
@@ -360,6 +360,10 @@ void Panda::set_data_speed_kbps(uint16_t bus, uint16_t speed) {
|
||||
usb_write(0xf9, bus, (speed * 10));
|
||||
}
|
||||
|
||||
void Panda::set_canfd_non_iso(uint16_t bus, bool non_iso) {
|
||||
usb_write(0xfc, bus, non_iso);
|
||||
}
|
||||
|
||||
static uint8_t len_to_dlc(uint8_t len) {
|
||||
if (len <= 8) {
|
||||
return len;
|
||||
|
||||
@@ -91,6 +91,7 @@ class Panda {
|
||||
void send_heartbeat(bool engaged);
|
||||
void set_can_speed_kbps(uint16_t bus, uint16_t speed);
|
||||
void set_data_speed_kbps(uint16_t bus, uint16_t speed);
|
||||
void set_canfd_non_iso(uint16_t bus, bool non_iso);
|
||||
void can_send(capnp::List<cereal::CanData>::Reader can_data_list);
|
||||
bool can_receive(std::vector<can_frame>& out_vec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user