1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Merge branch 'D-Lite/OP-934_rfm22b_rcvr_timeout_handling_next' into next

This commit is contained in:
Werner Backes 2013-05-10 09:59:30 +02:00
commit 7c9d2ce9a5
2 changed files with 3 additions and 2 deletions

View File

@ -2017,6 +2017,7 @@ static enum pios_radio_event radio_receivePacket(struct pios_rfm22b_dev *radio_d
#endif
#if defined(PIOS_INCLUDE_RFM22B_RCVR)
ppm_output = true;
radio_dev->ppm_fresh = true;
for (uint8_t i = 0; i < PIOS_RFM22B_RCVR_MAX_CHANNELS; ++i) {
radio_dev->ppm_channel[i] = ppmp->channels[i];
}

View File

@ -102,7 +102,7 @@ static void PIOS_RFM22B_RCVR_Supervisor(uint32_t rcvr_id) {
}
// 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;
}
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?
if (!rfm22b_dev->ppm_fresh) {
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;