Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAN: handle higher packet rate #129

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RemoteIDModule/CANDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void CANDriver::init(uint32_t bitrate, uint32_t acceptance_code, uint32_t accept

static const twai_general_config_t g_config = {.mode = TWAI_MODE_NORMAL, .tx_io = PIN_CAN_TX, .rx_io = PIN_CAN_RX, \
.clkout_io = TWAI_IO_UNUSED, .bus_off_io = TWAI_IO_UNUSED, \
.tx_queue_len = 5, .rx_queue_len = 5, \
.tx_queue_len = 5, .rx_queue_len = 50, \
.alerts_enabled = TWAI_ALERT_NONE, .clkout_divider = 0, \
.intr_flags = ESP_INTR_FLAG_LEVEL2
};
Expand Down
3 changes: 2 additions & 1 deletion RemoteIDModule/DroneCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ void DroneCAN::processTx(void)
void DroneCAN::processRx(void)
{
CANFrame rxmsg;
while (can_driver.receive(rxmsg)) {
uint8_t count = 60;
while (count-- && can_driver.receive(rxmsg)) {
CanardCANFrame rx_frame {};
uint64_t timestamp = micros64();
rx_frame.data_len = CANFrame::dlcToDataLength(rxmsg.dlc);
Expand Down
Loading