Rev 1068 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1068 | Rev 1076 | ||
---|---|---|---|
Line 655... | Line 655... | ||
655 | static int chanNickPrev = 0; |
655 | static int chanNickPrev = 0; |
656 | static int chanRollPrev = 0; |
656 | static int chanRollPrev = 0; |
Line 657... | Line 657... | ||
657 | 657 | ||
658 | static int stick_nick,stick_roll; |
658 | static int stick_nick,stick_roll; |
659 | ParameterZuordnung(); |
659 | ParameterZuordnung(); |
660 | 660 | ||
661 | #define MAX_CHAN_VAL 125L |
661 | #define MAX_CHAN_VAL 125L |
Line 662... | Line 662... | ||
662 | #define COS45 7071L // cos( -45 ) * 10000 |
662 | #define COS45 7071L // cos( -45 ) * 10000 |
663 | 663 | ||
Line 664... | Line 664... | ||
664 | long chanNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]]; |
664 | long chanNick = PPM_in[EE_Parameter.Kanalbelegung[K_NICK]]; |
665 | long chanRoll = -PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]; |
665 | long chanRoll = PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]; |
- | 666 | ||
- | 667 | int chanNickDiff; |
|
- | 668 | int chanRollDiff; |
|
- | 669 | ||
- | 670 | /* Über Parameter läßt sich zwischen "+" und "X" - Formations |
|
Line -... | Line 671... | ||
- | 671 | * umschalten (sh. parameter.h) |
|
- | 672 | */ |
|
666 | 673 | if( PARAM_X_FORMATION ) { |
|
667 | int chanNickDiff; |
674 | |
668 | int chanRollDiff; |
675 | chanRoll = -chanRoll; |
Line 669... | Line 676... | ||
669 | 676 | ||
670 | // Stick-Koordinatensystem um -45° (rechts) drehen |
677 | // Stick-Koordinatensystem um -45° (rechts) drehen |
- | 678 | chanNick *= COS45; |
|
- | 679 | chanRoll *= COS45; |
|
- | 680 | ||
Line -... | Line 681... | ||
- | 681 | int chanNickTemp = ( chanNick - chanRoll ) / 10000L; |
|
671 | chanNick *= COS45; |
682 | int chanRollTemp = ( chanRoll + chanNick ) / 10000L; |
- | 683 | ||
- | 684 | chanNick = chanNickTemp; |
|
- | 685 | chanRoll = -chanRollTemp; |
|
- | 686 | ||
- | 687 | if (chanNick > MAX_CHAN_VAL) |
|
672 | chanRoll *= COS45; |
688 | chanNick = MAX_CHAN_VAL; |
- | 689 | if (chanNick < -MAX_CHAN_VAL) |
|
Line 673... | Line -... | ||
673 | - | ||
674 | int chanNickTemp = ( chanNick - chanRoll ) / 10000L; |
- | |
675 | int chanRollTemp = ( chanRoll + chanNick ) / 10000L; |
- | |
676 | - | ||
677 | chanNick = chanNickTemp; |
- | |
678 | chanRoll = -chanRollTemp; |
- | |
679 | - | ||
680 | if (chanNick > MAX_CHAN_VAL) |
- | |
681 | chanNick = MAX_CHAN_VAL; |
- | |
682 | if (chanNick < -MAX_CHAN_VAL) |
690 | chanNick = -MAX_CHAN_VAL; |
683 | chanNick = -MAX_CHAN_VAL; |
691 | if (chanRoll > MAX_CHAN_VAL) |
Line 684... | Line 692... | ||
684 | if (chanRoll > MAX_CHAN_VAL) |
692 | chanRoll = MAX_CHAN_VAL; |
685 | chanRoll = MAX_CHAN_VAL; |
693 | if (chanRoll < -MAX_CHAN_VAL) |