Browse Source

HAL_SITL: fixed constructoring ordering bug in AP_ESC_Telem

on cygwin RCOutput was being constructed before AP_ESC_Telem, leading
to a panic
c415-sdk
Andrew Tridgell 4 years ago committed by Randy Mackay
parent
commit
7c7d58d2a0
  1. 7
      libraries/AP_HAL_SITL/RCOutput.cpp
  2. 2
      libraries/AP_HAL_SITL/RCOutput.h

7
libraries/AP_HAL_SITL/RCOutput.cpp

@ -85,7 +85,12 @@ void RCOutput::push(void) @@ -85,7 +85,12 @@ void RCOutput::push(void)
memcpy(_sitlState->pwm_output, _pending, SITL_NUM_CHANNELS * sizeof(uint16_t));
_corked = false;
}
esc_telem.update();
if (esc_telem == nullptr) {
esc_telem = new AP_ESC_Telem_SITL;
}
if (esc_telem != nullptr) {
esc_telem->update();
}
}
/*

2
libraries/AP_HAL_SITL/RCOutput.h

@ -37,7 +37,7 @@ public: @@ -37,7 +37,7 @@ public:
private:
SITL_State *_sitlState;
AP_ESC_Telem_SITL esc_telem;
AP_ESC_Telem_SITL *esc_telem;
uint16_t _freq_hz;
uint16_t _enable_mask;

Loading…
Cancel
Save