Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/rcl/RclGizmoIbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,20 @@ class RclGizmoIbus : public RclGizmo {
for (uint8_t i=0; i<IBus::MAX_CHANNELS; i++) {
pwm[i] = ibus.get_channel_value(i);
}
ibus.done_reading_data();
count++;
return true;
}
return false;

// !!HACK!!
// FlySky FS-i6 firmware (https://github.com/qba667/FlySkyI6) failsafe
// doesn't seem to actually change channels 1-6 even when set to
// failsafe. But channel 9-12 become > 1500 when they are 1500 if unused and
// we lost radio link. Just hardcode that and hope no one will ever be in a
// situation where all these are > 1500 except on losing radio link in failsafe!
// !!HACK!!
if (pwm[9] > 1500 && pwm[10] > 1500 && pwm[11] >1500 && pwm[12] > 1500) {
return false;
}
return true;
}
};
5 changes: 5 additions & 0 deletions src/rcl/ibus/IBus.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ class IBus {
*/
bool has_new_data() const;

/**
* @brief Reset new data available after read is complete
*/
void done_reading_data() { m_data_available_flag = false; }

/**
* @brief Get communication statistics
*
Expand Down