Subversion Repositories NaviCtrl

Rev

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

Rev 598 Rev 605
Line 115... Line 115...
115
u8  FromFC_VarioCharacter = ' ';
115
u8  FromFC_VarioCharacter = ' ';
116
s16 GPS_Aid_StickMultiplikator = 0;
116
s16 GPS_Aid_StickMultiplikator = 0;
117
u8 NC_GPS_ModeCharacter = ' ';
117
u8 NC_GPS_ModeCharacter = ' ';
118
u8 FCCalibActive = 0;
118
u8 FCCalibActive = 0;
119
u8 FC_is_Calibrated = 0;
119
u8 FC_is_Calibrated = 0;
120
Motor_t Motor[12];
120
Motor_t Motor[MAX_MOTORS];
121
u8 Motor_Version[12]; // das kann nicht in die struct, weil der PC die Struktur bekommt
121
u8 Motor_Version[MAX_MOTORS]; // das kann nicht in die struct, weil der PC die Struktur bekommt
122
u8 NC_To_FC_Flags = 0;
122
u8 NC_To_FC_Flags = 0;
123
u8 BL_MinOfMaxPWM = 255;  // indication if all BL-controllers run on full power
123
u8 BL_MinOfMaxPWM = 255;  // indication if all BL-controllers run on full power
124
u8 Logging_BL_MinOfMaxPWM = 255;
124
u8 Logging_BL_MinOfMaxPWM = 255;
125
u8 ErrorCheck_BL_MinOfMaxPWM = 255;
125
u8 ErrorCheck_BL_MinOfMaxPWM = 255;
126
u32 FC_I2C_ErrorConter;
126
u32 FC_I2C_ErrorConter;
Line 297... Line 297...
297
void SPI0_UpdateBuffer(void)
297
void SPI0_UpdateBuffer(void)
298
{
298
{
299
        static u32 timeout = 0;
299
        static u32 timeout = 0;
300
        static u8 counter = 50,hott_index = 0, last_error_code = 0, enable_injecting = 0;
300
        static u8 counter = 50,hott_index = 0, last_error_code = 0, enable_injecting = 0;
301
        static s16 last_wp_event = 0;
301
        static s16 last_wp_event = 0;
-
 
302
        u8 index;
302
        s16 tmp;
303
        s16 tmp;
303
        s32 i1,i2;
304
        s32 i1,i2;
304
/*
305
/*
305
        union
306
        union
306
        {
307
        {
Line 683... Line 684...
683
                                BL_MinOfMaxPWM = FromFlightCtrl.Param.Byte[3];  
684
                                BL_MinOfMaxPWM = FromFlightCtrl.Param.Byte[3];  
684
                                if(BL_MinOfMaxPWM < Logging_BL_MinOfMaxPWM)     Logging_BL_MinOfMaxPWM = BL_MinOfMaxPWM;        // hold the value until logged
685
                                if(BL_MinOfMaxPWM < Logging_BL_MinOfMaxPWM)     Logging_BL_MinOfMaxPWM = BL_MinOfMaxPWM;        // hold the value until logged
685
                                if(BL_MinOfMaxPWM < ErrorCheck_BL_MinOfMaxPWM)  ErrorCheck_BL_MinOfMaxPWM = BL_MinOfMaxPWM;             // hold the value until Error processed
686
                                if(BL_MinOfMaxPWM < ErrorCheck_BL_MinOfMaxPWM)  ErrorCheck_BL_MinOfMaxPWM = BL_MinOfMaxPWM;             // hold the value until Error processed
686
                                Parameter.NaviGpsModeControl = FromFlightCtrl.Param.Byte[4];
687
                                Parameter.NaviGpsModeControl = FromFlightCtrl.Param.Byte[4];
687
                                FromFC_VarioCharacter = FromFlightCtrl.Param.Byte[5];
688
                                FromFC_VarioCharacter = FromFlightCtrl.Param.Byte[5];
-
 
689
                                index = FromFlightCtrl.Param.Byte[2] % MAX_MOTORS;
688
                                Motor[FromFlightCtrl.Param.Byte[2]].NotReadyCnt = FromFlightCtrl.Param.Byte[6];
690
                                Motor[index].NotReadyCnt = FromFlightCtrl.Param.Byte[6];
689
                                Motor_Version[FromFlightCtrl.Param.Byte[2]] = FromFlightCtrl.Param.Byte[7];
691
                                Motor_Version[index] = FromFlightCtrl.Param.Byte[7];
690
                                Motor[FromFlightCtrl.Param.Byte[2]].MaxPWM = FromFlightCtrl.Param.Byte[8];
692
                                Motor[index].MaxPWM = FromFlightCtrl.Param.Byte[8];
691
                                Motor[FromFlightCtrl.Param.Byte[2]].State = FromFlightCtrl.Param.Byte[9];
693
                                Motor[index].State = FromFlightCtrl.Param.Byte[9];
692
                                Motor[FromFlightCtrl.Param.Byte[2]].Temperature = FromFlightCtrl.Param.Byte[10];
694
                                Motor[index].Temperature = FromFlightCtrl.Param.Byte[10];
693
                                Motor[FromFlightCtrl.Param.Byte[2]].Current = FromFlightCtrl.Param.Byte[11];
695
                                Motor[index].Current = FromFlightCtrl.Param.Byte[11];
694
                                if(FromFC_VarioCharacter == '+' || FromFC_VarioCharacter == '-') // manual setpoint clears the NC-Parameter command
696
                                if(FromFC_VarioCharacter == '+' || FromFC_VarioCharacter == '-') // manual setpoint clears the NC-Parameter command
695
                                {
697
                                {
696
                                        NCParams_ClearValue(NCPARAMS_ALTITUDE_RATE);
698
                                        NCParams_ClearValue(NCPARAMS_ALTITUDE_RATE);
697
                                }
699
                                }
698
                                if(!(SimulationFlags & SIMULATION_ACTIVE)) NaviData.Current = FC.BAT_Current;
700
                                if(!(SimulationFlags & SIMULATION_ACTIVE)) NaviData.Current = FC.BAT_Current;
Line 712... Line 714...
712
                                CHK_POTI_MM(Parameter.NaviWindCorrection,FromFlightCtrl.Param.Byte[9],0,255);
714
                                CHK_POTI_MM(Parameter.NaviWindCorrection,FromFlightCtrl.Param.Byte[9],0,255);
713
                                CHK_POTI_MM(Parameter.NaviAccCompensation,FromFlightCtrl.Param.Byte[10],0,255);
715
                                CHK_POTI_MM(Parameter.NaviAccCompensation,FromFlightCtrl.Param.Byte[10],0,255);
714
                                CHK_POTI_MM(Parameter.NaviAngleLimitation,FromFlightCtrl.Param.Byte[11],0,255);
716
                                CHK_POTI_MM(Parameter.NaviAngleLimitation,FromFlightCtrl.Param.Byte[11],0,255);
715
                                break;
717
                                break;
716
                        case SPI_FCCMD_PARAMETER2:
718
                        case SPI_FCCMD_PARAMETER2:
717
                                CHK_POTI_MM(Parameter.AutoPhotoDistance,FromFlightCtrl.Param.Byte[0],0,255);
719
                                CHK_POTI_MM(FC.AutoPhotoDistance,FromFlightCtrl.Param.Byte[0],0,255);
718
                                if(FromFlightCtrl.Param.Byte[1]) FC.FromFC_SpeakHoTT = FromFlightCtrl.Param.Byte[1];     // will be cleared in the SD-Logging
720
                                if(FromFlightCtrl.Param.Byte[1]) FC.FromFC_SpeakHoTT = FromFlightCtrl.Param.Byte[1];     // will be cleared in the SD-Logging
719
                                FC.BAT_UsedCapacity = FromFlightCtrl.Param.Int[1]; // 2 & 3
721
                                FC.BAT_UsedCapacity = FromFlightCtrl.Param.Int[1]; // 2 & 3
720
                                Parameter.FromFC_LowVoltageHomeActive = FromFlightCtrl.Param.Byte[4];
722
                                Parameter.FromFC_LowVoltageHomeActive = FromFlightCtrl.Param.Byte[4];
721
                                if(FromFlightCtrl.Param.Byte[5]) FromFC_LoadWP_List = FromFlightCtrl.Param.Byte[5];
723
                                if(FromFlightCtrl.Param.Byte[5]) FromFC_LoadWP_List = FromFlightCtrl.Param.Byte[5];
722
                                if(FromFlightCtrl.Param.Byte[6]) FromFC_Load_SinglePoint = FromFlightCtrl.Param.Byte[6];
724
                                if(FromFlightCtrl.Param.Byte[6]) FromFC_Load_SinglePoint = FromFlightCtrl.Param.Byte[6];