Skip to content

Commit

Permalink
Recognize channel flips on just 100ms diff.
Browse files Browse the repository at this point in the history
This allows using the APM mode switch as a normal channel rotation
switch just like you'd use a 3 position switch.
  • Loading branch information
marcmerlin committed Dec 20, 2015
1 parent 96498ae commit 7cafdb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MinimOSD_Extra_Plane_Pre_release_Beta/OSD_Panels.ino
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ void panOff(){
// Rotation switch
else {
// Switch changed from its last position
if (abs (ch_raw - ch_raw_prev1) > 200) {
if (abs (ch_raw - ch_raw_prev1) > 100) {
// but is the same than 2 positions ago
if (abs (ch_raw - ch_raw_prev2) < 200) {
if (abs (ch_raw - ch_raw_prev2) < 100) {
osd.closePanel();
// and it's been less than 1 sec since the position switch and back
if (osd_switch_time + 1000 > millis()) {
Expand Down

0 comments on commit 7cafdb9

Please sign in to comment.