Browse Source

AP_Periph: allow build with ESC telemetry and BLHeli support

gps-1.3.1
Andrew Tridgell 3 years ago committed by Tom Pittenger
parent
commit
d34579c275
  1. 5
      Tools/AP_Periph/AP_Periph.h
  2. 7
      Tools/AP_Periph/rc_out.cpp
  3. 2
      Tools/AP_Periph/wscript

5
Tools/AP_Periph/AP_Periph.h

@ -194,6 +194,11 @@ public: @@ -194,6 +194,11 @@ public:
#endif
#ifdef HAL_PERIPH_ENABLE_RC_OUT
#if HAL_WITH_ESC_TELEM
AP_ESC_Telem esc_telem;
uint32_t last_esc_telem_update_ms;
#endif
SRV_Channels servo_channels;
bool rcout_has_new_data_to_update;

7
Tools/AP_Periph/rc_out.cpp

@ -116,6 +116,13 @@ void AP_Periph_FW::rcout_update() @@ -116,6 +116,13 @@ void AP_Periph_FW::rcout_update()
SRV_Channels::cork();
SRV_Channels::output_ch_all();
SRV_Channels::push();
#if HAL_WITH_ESC_TELEM
uint32_t now_ms = AP_HAL::millis();
if (now_ms - last_esc_telem_update_ms >= 100) {
last_esc_telem_update_ms = now_ms;
esc_telem.update();
}
#endif
}
#endif // HAL_PERIPH_ENABLE_RC_OUT

2
Tools/AP_Periph/wscript

@ -60,6 +60,8 @@ def build(bld): @@ -60,6 +60,8 @@ def build(bld):
'AP_AccelCal',
'AP_Logger',
'AC_PID',
'AP_BLHeli',
'AP_ESC_Telem',
]
bld.ap_stlib(
name= 'AP_Periph_libs',

Loading…
Cancel
Save