Subversion Repositories FlightCtrl

Rev

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

Rev 2346 Rev 2348
Line 20... Line 20...
20
unsigned char SPITransferCompleted, SPI_ChkSum;
20
unsigned char SPITransferCompleted, SPI_ChkSum;
21
unsigned char SPI_RxDataValid,NaviDataOkay = 250;
21
unsigned char SPI_RxDataValid,NaviDataOkay = 250;
Line 22... Line 22...
22
 
22
 
23
unsigned char SPI_CommandSequence[] = { SPI_FCCMD_STICK, SPI_FCCMD_USER, SPI_FCCMD_PARAMETER1,
23
unsigned char SPI_CommandSequence[] = { SPI_FCCMD_STICK, SPI_FCCMD_USER, SPI_FCCMD_PARAMETER1,
24
                                                                                SPI_FCCMD_STICK, SPI_FCCMD_VERSION, SPI_FCCMD_BL_ACCU,
24
                                                                                SPI_FCCMD_STICK, SPI_FCCMD_VERSION, SPI_FCCMD_BL_ACCU,
25
                                        SPI_FCCMD_STICK, SPI_FCCMD_MISC,SPI_FCCMD_SERVOS,  
25
                                        SPI_FCCMD_STICK, SPI_FCCMD_USER, SPI_FCCMD_MISC,SPI_FCCMD_SERVOS,
26
                                                                                SPI_FCCMD_STICK, SPI_FCCMD_PARAMETER2, SPI_FCCMD_BL_ACCU
26
                                                                                SPI_FCCMD_STICK, SPI_FCCMD_PARAMETER2, SPI_FCCMD_BL_ACCU
27
                                                                                };
27
                                                                                };
28
unsigned char SPI_CommandCounter = 0;
28
unsigned char SPI_CommandCounter = 0;
29
unsigned char NC_ErrorCode = 0;
29
unsigned char NC_ErrorCode = 0;
Line 172... Line 172...
172
//if(FC_StatusFlags2 & FC_STATUS2_WAIT_FOR_TAKEOFF) ToNaviCtrl.Param.Byte[8] &= ~FC_STATUS_FLY;
172
//if(FC_StatusFlags2 & FC_STATUS2_WAIT_FOR_TAKEOFF) ToNaviCtrl.Param.Byte[8] &= ~FC_STATUS_FLY;
173
                FC_StatusFlags &= ~(FC_STATUS_CALIBRATE | FC_STATUS_START);
173
                FC_StatusFlags &= ~(FC_STATUS_CALIBRATE | FC_STATUS_START);
174
                    ToNaviCtrl.Param.Byte[9] = ActiveParamSet;
174
                    ToNaviCtrl.Param.Byte[9] = ActiveParamSet;
175
                                ToNaviCtrl.Param.Byte[10] = EE_Parameter.ComingHomeAltitude;
175
                                ToNaviCtrl.Param.Byte[10] = EE_Parameter.ComingHomeAltitude;
176
                                ToNaviCtrl.Param.Byte[11] = FC_StatusFlags2;
176
                                ToNaviCtrl.Param.Byte[11] = FC_StatusFlags2;
-
 
177
                                if(!(PORTC & (1<<PORTC2))) FC_StatusFlags2 &= ~FC_STATUS2_OUT1_ACTIVE;       // Out1 (J16)
177
        break;
178
        break;
178
 
-
 
179
     case SPI_FCCMD_BL_ACCU:
179
     case SPI_FCCMD_BL_ACCU:
180
                        ToNaviCtrl.Param.Int[0] = Capacity.ActualCurrent; // 0.1A
180
                        ToNaviCtrl.Param.Int[0] = Capacity.ActualCurrent; // 0.1A
181
                        ToNaviCtrl.Param.Int[1] = Capacity.UsedCapacity; // mAh
181
                        ToNaviCtrl.Param.Int[1] = Capacity.UsedCapacity; // mAh
182
                        ToNaviCtrl.Param.Byte[4] = (unsigned char) UBat; // 0.1V
182
                        ToNaviCtrl.Param.Byte[4] = (unsigned char) UBat; // 0.1V
183
                                ToNaviCtrl.Param.Byte[5] = GetChannelValue(EE_Parameter.NaviGpsModeChannel);  // GPS-Mode control 
183
                                ToNaviCtrl.Param.Byte[5] = GetChannelValue(EE_Parameter.NaviGpsModeChannel);  // GPS-Mode control