Subversion Repositories NaviCtrl

Rev

Rev 704 | Rev 743 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 704 Rev 711
Line 675... Line 675...
675
        if((abs(FromFlightCtrl.AngleNick) > 300) || (abs(FromFlightCtrl.AngleRoll) > 300))
675
        if((abs(FromFlightCtrl.AngleNick) > 300) || (abs(FromFlightCtrl.AngleRoll) > 300))
676
        {
676
        {
677
//              UART1_PutString("\r\nTilted");
677
//              UART1_PutString("\r\nTilted");
678
                return(0);
678
                return(0);
679
        }
679
        }
-
 
680
        if(NCMAG_SensorType == TYPE_LSM303D) return(2); // der Sensor muss immer so verbaut sein, weil der interne ACC manchmal spinnt
-
 
681
 
-
 
682
        if(abs(AccRawVector.Z) + abs(AccRawVector.X) + abs(AccRawVector.Y) > 9000) return(0);  // sensor defekt?
680
        // select orientation
683
        // select orientation
681
        if(AccRawVector.Z >  3300) return(1); // Flach - Bestückung oben - Pfeil nach vorn
684
        if(AccRawVector.Z >  3300) return(1); // Flach - Bestückung oben - Pfeil nach vorn
682
        else
685
        else
683
        if(AccRawVector.Z < -3300) return(2); // Flach - Bestückung unten - Pfeil nach vorn
686
        if(AccRawVector.Z < -3300) return(2); // Flach - Bestückung unten - Pfeil nach vorn
684
        else
687
        else
Line 687... Line 690...
687
        if(AccRawVector.X < -3300) return(4); // Flach - Bestückung rechts - Pfeil nach vorn
690
        if(AccRawVector.X < -3300) return(4); // Flach - Bestückung rechts - Pfeil nach vorn
688
        else
691
        else
689
        if(AccRawVector.Y >  3300) return(5); // Stehend - Pfeil nach oben - 'front' nach vorn
692
        if(AccRawVector.Y >  3300) return(5); // Stehend - Pfeil nach oben - 'front' nach vorn
690
        else
693
        else
691
        if(AccRawVector.Y < -3300) return(6); // Stehend - Pfeil nach unten  - 'front' nach vorn
694
        if(AccRawVector.Y < -3300) return(6); // Stehend - Pfeil nach unten  - 'front' nach vorn
-
 
695
 
692
        return(0);
696
        return(0);
693
}
697
}
Line 694... Line 698...
694
 
698
 
695
// ---------------------------------------------------------------------
699
// ---------------------------------------------------------------------
Line 911... Line 915...
911
 
915
 
912
                case TYPE_LSM303DLH:
916
                case TYPE_LSM303DLH:
913
                case TYPE_LSM303DLM:
917
                case TYPE_LSM303DLM:
914
//                      MagConfig.crb = LSM303DLH_CRB_GAIN_19GA;
918
//                      MagConfig.crb = LSM303DLH_CRB_GAIN_19GA;
915
                        MagConfig.crb = LSM303DLH_CRB_GAIN_40GA; // seit 2.03 -> 2.2014 
919
                        MagConfig.crb = LSM303DLH_CRB_GAIN_40GA; // seit 2.03 -> 2.2014 
916
                        MagConfig.cra = LSM303DLH_CRA_RATE_75HZ|CRA_MODE_NORMAL;;
920
                        MagConfig.cra = LSM303DLH_CRA_RATE_75HZ|CRA_MODE_NORMAL;
917
                        MagConfig.mode = MODE_CONTINUOUS;
921
                        MagConfig.mode = MODE_CONTINUOUS;
918
                        break;
922
                        break;
919
                case TYPE_LSM303D:
923
                case TYPE_LSM303D:
920
                    // -> see defined data in NCMAG_SetMagConfig();
924
                    // -> see defined data in NCMAG_SetMagConfig();
Line 999... Line 1003...
999
                                                s = 40; //reset downconter about 0,8 sec
1003
                                                s = 40; //reset downconter about 0,8 sec
1000
/*
1004
/*
1001
DebugOut.Analog[] = AccVector.X;
1005
DebugOut.Analog[] = AccVector.X;
1002
DebugOut.Analog[] = AccVector.Y;
1006
DebugOut.Analog[] = AccVector.Y;
1003
DebugOut.Analog[] = AccVector.Z;
1007
DebugOut.Analog[] = AccVector.Z;
1004
s = 2;
1008
//s = 2;
1005
*/
1009
*/
1006
                                        }
1010
                                        }
1007
                                        break;
1011
                                        break;
1008
                        }
1012
                        }
1009
                        if(send_config == 24) TimerUpdate = SetDelay(15);    // next event is the re-configuration
1013
                        if(send_config == 24) TimerUpdate = SetDelay(15);    // next event is the re-configuration