Skip to content

Commit

Permalink
AP_RCProtocol: use single frame API
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Sep 19, 2023
1 parent 1a8a5f2 commit 4fcf5af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_RCProtocol/AP_RCProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void AP_RCProtocol::check_added_uart(void)
// processing in frame-based mode
if (!searching && backend[_detected_protocol]->frame_input_enabled()) {
uint8_t buf[64];
while (added.uart->frames_available()) {
while (added.uart->frame_available()) {
ssize_t nbytes = added.uart->read_frame(buf, 64);
process_frame(buf, nbytes);
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/AP_RCProtocol/AP_RCProtocol_CRSF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ void AP_RCProtocol_CRSF::frame_input_enabled(AP_HAL::UARTDriver* uart, bool onof
{
AP_RCProtocol_Backend::frame_input_enabled(uart, onoff);
if (onoff) {
uart->begin_framing(CRSF_FRAMELEN_MAX, 5);
uart->begin_framing(CRSF_FRAMELEN_MAX);
} else {
uart->begin_framing(1, 1); // stop framing
uart->begin_framing(1); // stop framing
}
}

Expand Down Expand Up @@ -441,7 +441,7 @@ bool AP_RCProtocol_CRSF::decode_crsf_packet()
// change the baud rate
uart->begin(_new_baud_rate);
if (!AP_RCProtocol_Backend::frame_input_enabled()) {
uart->begin_framing(CRSF_FRAMELEN_MAX, 5);
uart->begin_framing(CRSF_FRAMELEN_MAX);
}
}
_new_baud_rate = 0;
Expand Down

0 comments on commit 4fcf5af

Please sign in to comment.