mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Merge branch 'D-Lite/OP-934_rfm22b_rcvr_timeout_handling_next' into next
This commit is contained in:
commit
7c9d2ce9a5
@ -2017,6 +2017,7 @@ static enum pios_radio_event radio_receivePacket(struct pios_rfm22b_dev *radio_d
|
|||||||
#endif
|
#endif
|
||||||
#if defined(PIOS_INCLUDE_RFM22B_RCVR)
|
#if defined(PIOS_INCLUDE_RFM22B_RCVR)
|
||||||
ppm_output = true;
|
ppm_output = true;
|
||||||
|
radio_dev->ppm_fresh = true;
|
||||||
for (uint8_t i = 0; i < PIOS_RFM22B_RCVR_MAX_CHANNELS; ++i) {
|
for (uint8_t i = 0; i < PIOS_RFM22B_RCVR_MAX_CHANNELS; ++i) {
|
||||||
radio_dev->ppm_channel[i] = ppmp->channels[i];
|
radio_dev->ppm_channel[i] = ppmp->channels[i];
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ static void PIOS_RFM22B_RCVR_Supervisor(uint32_t rcvr_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RTC runs at 625Hz.
|
// RTC runs at 625Hz.
|
||||||
if (++(rfm22b_dev->ppm_supv_timer) < (PIOS_RFM22B_RCVR_TIMEOUT_MS * 1000 / 625)) {
|
if (++(rfm22b_dev->ppm_supv_timer) < (PIOS_RFM22B_RCVR_TIMEOUT_MS * 625 / 1000)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rfm22b_dev->ppm_supv_timer = 0;
|
rfm22b_dev->ppm_supv_timer = 0;
|
||||||
@ -110,7 +110,7 @@ static void PIOS_RFM22B_RCVR_Supervisor(uint32_t rcvr_id) {
|
|||||||
// Have we received fresh values since the last update?
|
// Have we received fresh values since the last update?
|
||||||
if (!rfm22b_dev->ppm_fresh) {
|
if (!rfm22b_dev->ppm_fresh) {
|
||||||
for (uint8_t i = 0; i < PIOS_RFM22B_RCVR_MAX_CHANNELS; ++i) {
|
for (uint8_t i = 0; i < PIOS_RFM22B_RCVR_MAX_CHANNELS; ++i) {
|
||||||
rfm22b_dev->ppm_channel[i] = 0;
|
rfm22b_dev->ppm_channel[i] = PIOS_RCVR_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rfm22b_dev->ppm_fresh = false;
|
rfm22b_dev->ppm_fresh = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user