Skip to content

Commit

Permalink
AP_RCProtocol: disable raw logging if no RC_Channel
Browse files Browse the repository at this point in the history
We're asking the singleton here for information on whether we should do raw logging.  We may not actually be compiling the RC_Channel library in.
  • Loading branch information
peterbarker authored and tridge committed Oct 3, 2023
1 parent e41cc42 commit c1110d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/AP_RCProtocol/AP_RCProtocol_Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ void AP_RCProtocol_Backend::configure_vtx(uint8_t band, uint8_t channel, uint8_t
*/
void AP_RCProtocol_Backend::log_data(AP_RCProtocol::rcprotocol_t prot, uint32_t timestamp, const uint8_t *data, uint8_t len) const
{
#if HAL_LOGGING_ENABLED
#if HAL_LOGGING_ENABLED && AP_RC_CHANNEL_ENABLED

#if (CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX)
if (&rc() == nullptr) { // allow running without RC_Channels if we are doing the examples
return;
Expand Down Expand Up @@ -214,7 +215,7 @@ void AP_RCProtocol_Backend::log_data(AP_RCProtocol::rcprotocol_t prot, uint32_t
u32[0], u32[1], u32[2], u32[3], u32[4],
u32[5], u32[6], u32[7], u32[8], u32[9]);
}
#endif // HAL_LOGGING_ENABLED
#endif // HAL_LOGGING_ENABLED && AP_RC_CHANNEL_ENABLED
}

#endif // AP_RCPROTOCOL_ENABLED

0 comments on commit c1110d4

Please sign in to comment.