mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
OP-1686 Slave Oplink may want to receive PPM data in PPM_Only mode
This commit is contained in:
parent
d161ebbc74
commit
b9bfcd18d2
@ -751,7 +751,7 @@ void PIOS_Board_Init(void)
|
|||||||
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
|
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
|
||||||
|
|
||||||
/* Set the PPM callback if we should be receiving PPM. */
|
/* Set the PPM callback if we should be receiving PPM. */
|
||||||
if (ppm_mode) {
|
if (ppm_mode || (ppm_only && !is_coordinator)) {
|
||||||
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
|
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ void PIOS_Board_Init(void)
|
|||||||
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
|
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
|
||||||
|
|
||||||
/* Set the PPM callback if we should be receiving PPM. */
|
/* Set the PPM callback if we should be receiving PPM. */
|
||||||
if (ppm_mode) {
|
if (ppm_mode || (ppm_only && !is_coordinator)) {
|
||||||
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
|
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,10 +487,9 @@ void PIOS_Board_Init(void)
|
|||||||
#ifdef PIOS_INCLUDE_ADC
|
#ifdef PIOS_INCLUDE_ADC
|
||||||
PIOS_ADC_Init();
|
PIOS_ADC_Init();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PIOS_Board_PPM_callback(const int16_t *channels)
|
static void PIOS_Board_PPM_callback(const int16_t * channels) {
|
||||||
{
|
|
||||||
#if defined(PIOS_INCLUDE_PPM) && defined(PIOS_INCLUDE_PPM_OUT)
|
#if defined(PIOS_INCLUDE_PPM) && defined(PIOS_INCLUDE_PPM_OUT)
|
||||||
if (pios_ppm_out_id) {
|
if (pios_ppm_out_id) {
|
||||||
for (uint8_t i = 0; i < RFM22B_PPM_NUM_CHANNELS; ++i) {
|
for (uint8_t i = 0; i < RFM22B_PPM_NUM_CHANNELS; ++i) {
|
||||||
@ -506,7 +505,7 @@ static void PIOS_Board_PPM_callback(const int16_t *channels)
|
|||||||
}
|
}
|
||||||
#endif /* PIOS_INCLUDE_SERVO */
|
#endif /* PIOS_INCLUDE_SERVO */
|
||||||
#endif /* PIOS_INCLUDE_PPM && PIOS_INCLUDE_PPM_OUT */
|
#endif /* PIOS_INCLUDE_PPM && PIOS_INCLUDE_PPM_OUT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
@ -774,7 +774,7 @@ void PIOS_Board_Init(void)
|
|||||||
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
|
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only);
|
||||||
|
|
||||||
/* Set the PPM callback if we should be receiving PPM. */
|
/* Set the PPM callback if we should be receiving PPM. */
|
||||||
if (ppm_mode) {
|
if (ppm_mode || (ppm_only && !is_coordinator)) {
|
||||||
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
|
PIOS_RFM22B_SetPPMCallback(pios_rfm22b_id, PIOS_Board_PPM_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user