AP_HAL_SITL: flush data from select call as we don't wait select in AP_Periph

This commit is contained in:
bugobliterator 2020-09-13 00:28:10 +05:30 committed by Andrew Tridgell
parent ed3683fce3
commit 0d41db5520
2 changed files with 3 additions and 1 deletions

View File

@ -469,6 +469,8 @@ bool CANIface::select(bool &read_select, bool &write_select,
{
// Detecting whether we need to block at all
bool need_block = !write_select; // Write queue is infinite
// call poll here to flush some tx
_poll(true, true);
if (read_select && _hasReadyRx()) {
need_block = false;

View File

@ -57,6 +57,7 @@ public:
#if !defined(HAL_BUILD_AP_PERIPH)
enum safety_state safety_switch_state(void) override;
void set_cmdline_parameters() override;
#endif
bool trap() const override {
@ -70,7 +71,6 @@ public:
#endif
}
void set_cmdline_parameters() override;
private:
SITL_State *sitlState;