Subversion Repositories FlightCtrl

Rev

Rev 1221 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1221 Rev 1222
Line 150... Line 150...
150
#define SPI_TXBUFFER_LEN sizeof(ToNaviCtrl)
150
#define SPI_TXBUFFER_LEN sizeof(ToNaviCtrl)
151
uint8_t *SPI_TxBuffer;
151
uint8_t *SPI_TxBuffer;
152
uint8_t SPI_TxBufferIndex = 0;
152
uint8_t SPI_TxBufferIndex = 0;
Line 153... Line 153...
153
 
153
 
154
uint8_t SPITransferCompleted, SPI_ChkSum;
154
uint8_t SPITransferCompleted, SPI_ChkSum;
-
 
155
uint8_t SPI_RxDataValid = 0;
-
 
156
uint8_t NCDataOkay = 0;
Line 155... Line 157...
155
uint8_t SPI_RxDataValid;
157
uint8_t NCSerialDataOkay = 0;
156
 
158
 
Line 157... Line 159...
157
uint8_t SPI_CommandSequence[] = { SPI_CMD_USER, SPI_CMD_STICK, SPI_CMD_PARAMETER1, SPI_CMD_STICK, SPI_CMD_MISC, SPI_CMD_VERSION };
159
uint8_t SPI_CommandSequence[] = { SPI_CMD_USER, SPI_CMD_STICK, SPI_CMD_PARAMETER1, SPI_CMD_STICK, SPI_CMD_MISC, SPI_CMD_VERSION };
Line 177... Line 179...
177
        ToNaviCtrl.Sync2 = SPI_TXSYNCBYTE2;
179
        ToNaviCtrl.Sync2 = SPI_TXSYNCBYTE2;
Line 178... Line 180...
178
 
180
 
179
        ToNaviCtrl.Command = SPI_CMD_USER;
181
        ToNaviCtrl.Command = SPI_CMD_USER;
180
        ToNaviCtrl.IntegralNick = 0;
182
        ToNaviCtrl.IntegralNick = 0;
-
 
183
        ToNaviCtrl.IntegralRoll = 0;
-
 
184
        NCSerialDataOkay = 0;
Line 181... Line 185...
181
        ToNaviCtrl.IntegralRoll = 0;
185
        NCDataOkay = 0;
Line 182... Line 186...
182
 
186
 
183
        SPI_RxDataValid = 0;
187
        SPI_RxDataValid = 0;
Line 292... Line 296...
292
                // update gps controls
296
                // update gps controls
293
                if(abs(FromNaviCtrl.GPSStickNick) < 512 && abs(FromNaviCtrl.GPSStickRoll) < 512 && (ParamSet.GlobalConfig & CFG_GPS_ACTIVE))
297
                if(abs(FromNaviCtrl.GPSStickNick) < 512 && abs(FromNaviCtrl.GPSStickRoll) < 512 && (ParamSet.GlobalConfig & CFG_GPS_ACTIVE))
294
                {
298
                {
295
                        GPSStickNick    = FromNaviCtrl.GPSStickNick;
299
                        GPSStickNick    = FromNaviCtrl.GPSStickNick;
296
                        GPSStickRoll    = FromNaviCtrl.GPSStickRoll;
300
                        GPSStickRoll    = FromNaviCtrl.GPSStickRoll;
-
 
301
                        NCDataOkay = 250;
297
                }
302
                }
298
                // update compass readings
303
                // update compass readings
299
                if(FromNaviCtrl.CompassHeading <= 360)
304
                if(FromNaviCtrl.CompassHeading <= 360)
300
                {
305
                {
301
                        CompassHeading = FromNaviCtrl.CompassHeading;
306
                        CompassHeading = FromNaviCtrl.CompassHeading;
Line 309... Line 314...
309
                {
314
                {
310
                        case SPI_KALMAN:
315
                        case SPI_KALMAN:
311
                                FCParam.KalmanK = FromNaviCtrl.Param.Byte[0];
316
                                FCParam.KalmanK = FromNaviCtrl.Param.Byte[0];
312
                                FCParam.KalmanMaxFusion = FromNaviCtrl.Param.Byte[1];
317
                                FCParam.KalmanMaxFusion = FromNaviCtrl.Param.Byte[1];
313
                                FCParam.KalmanMaxDrift = FromNaviCtrl.Param.Byte[2];
318
                                FCParam.KalmanMaxDrift = FromNaviCtrl.Param.Byte[2];
-
 
319
                                NCSerialDataOkay = FromNaviCtrl.Param.Byte[3];
-
 
320
                                DebugOut.Analog[29] = NCSerialDataOkay;
314
                                break;
321
                                break;
Line 315... Line 322...
315
 
322
 
316
                        default:
323
                        default:
317
                                break;
324
                                break;