Skip to content

Commit

Permalink
CAN FD non-ISO support
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Oct 8, 2022
1 parent fb07437 commit 5bd9fe8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion panda
1 change: 1 addition & 0 deletions selfdrive/boardd/boardd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/boardd/panda.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions selfdrive/boardd/panda.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5bd9fe8

Please sign in to comment.