Reverted unwanted S.Bus changes

This commit is contained in:
Lorenz Meier
2013-01-06 01:32:39 +01:00
parent ab85d201ee
commit 83039e76d3
2 changed files with 51 additions and 63 deletions
+9 -14
View File
@@ -98,17 +98,11 @@ controls_main(void)
*/
unsigned rc_channels = system_state.rc_channels;
/*
* Track if any input got an update in this round
*/
bool rc_updated;
if (fds[0].revents & POLLIN)
locked |= dsm_input();
if (fds[1].revents & POLLIN)
locked |= sbus_input(fds[1].fd, PX4IO_INPUT_CHANNELS, &system_state.rc_channel_data,
&system_state.rc_channels, &system_state.rc_channels_timestamp, &rc_updated);
locked |= sbus_input();
/*
* If we don't have lock from one of the serial receivers,
@@ -138,17 +132,18 @@ controls_main(void)
*/
if ((hrt_absolute_time() - system_state.rc_channels_timestamp) > 200000) {
if (system_state.rc_channels > 0) {
/*
* If the RC signal status (lost / present) has
* just changed, request an update immediately.
*/
system_state.fmu_report_due = true;
}
/* set the number of channels to zero - no inputs */
system_state.rc_channels = 0;
rc_updated = true;
}
/*
* If there was a RC update OR the RC signal status (lost / present) has
* just changed, request an update immediately.
*/
system_state.fmu_report_due |= rc_updated;
/*
* PWM output updates are performed in addition on each comm update.
* the updates here are required to ensure operation if FMU is not started