Rev 2179 | Rev 2190 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2179 | Rev 2183 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | unsigned char *SPI_TX_Buffer; |
18 | unsigned char *SPI_TX_Buffer; |
Line 19... | Line 19... | ||
19 | 19 | ||
20 | unsigned char SPITransferCompleted, SPI_ChkSum; |
20 | unsigned char SPITransferCompleted, SPI_ChkSum; |
Line 21... | Line 21... | ||
21 | unsigned char SPI_RxDataValid,NaviDataOkay = 250; |
21 | unsigned char SPI_RxDataValid,NaviDataOkay = 250; |
- | 22 | ||
- | 23 | unsigned char SPI_CommandSequence[] = { SPI_FCCMD_STICK, SPI_FCCMD_USER, SPI_FCCMD_PARAMETER1, |
|
- | 24 | SPI_FCCMD_STICK, SPI_FCCMD_MISC, SPI_FCCMD_VERSION, |
|
- | 25 | SPI_FCCMD_STICK, SPI_FCCMD_SERVOS, SPI_FCCMD_ACCU, |
|
22 | 26 | SPI_FCCMD_STICK, SPI_FCCMD_PARAMETER2 |
|
23 | unsigned char SPI_CommandSequence[] = {SPI_FCCMD_STICK, SPI_FCCMD_USER, SPI_FCCMD_PARAMETER1, SPI_FCCMD_STICK, SPI_FCCMD_MISC, SPI_FCCMD_VERSION, SPI_FCCMD_STICK, SPI_FCCMD_SERVOS, SPI_FCCMD_ACCU}; |
27 | }; |
24 | unsigned char SPI_CommandCounter = 0; |
28 | unsigned char SPI_CommandCounter = 0; |
25 | unsigned char NC_ErrorCode = 0; |
29 | unsigned char NC_ErrorCode = 0; |
26 | unsigned char NC_GPS_ModeCharacter = ' '; |
30 | unsigned char NC_GPS_ModeCharacter = ' '; |
Line 73... | Line 77... | ||
73 | 77 | ||
74 | SPITransferCompleted = 0; |
78 | SPITransferCompleted = 0; |
Line 75... | Line 79... | ||
75 | UpdateSPI_Buffer(); // update buffer |
79 | UpdateSPI_Buffer(); // update buffer |
76 | - | ||
77 | SPI_BufferIndex = 1; |
80 | |
78 | //ebugOut.Analog[16]++; |
81 | SPI_BufferIndex = 1; |
79 | // -- Debug-Output --- |
82 | // -- Debug-Output --- |
80 | //---- |
83 | //---- |
81 | asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); |
84 | asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); asm volatile ("nop"); |
Line 218... | Line 221... | ||
218 | ToNaviCtrl.Param.Byte[8] = EE_Parameter.NaviOperatingRadius; |
221 | ToNaviCtrl.Param.Byte[8] = EE_Parameter.NaviOperatingRadius; |
219 | ToNaviCtrl.Param.Byte[9] = EE_Parameter.NaviWindCorrection; |
222 | ToNaviCtrl.Param.Byte[9] = EE_Parameter.NaviWindCorrection; |
220 | ToNaviCtrl.Param.Byte[10] = EE_Parameter.NaviAccCompensation; |
223 | ToNaviCtrl.Param.Byte[10] = EE_Parameter.NaviAccCompensation; |
221 | ToNaviCtrl.Param.Byte[11] = EE_Parameter.NaviAngleLimitation; |
224 | ToNaviCtrl.Param.Byte[11] = EE_Parameter.NaviAngleLimitation; |
222 | break; |
225 | break; |
- | 226 | case SPI_FCCMD_PARAMETER2: |
|
- | 227 | ToNaviCtrl.Param.Byte[0] = EE_Parameter.NaviOut1Parameter; // Distance between Photo releases |
|
223 | 228 | break; |
|
224 | case SPI_FCCMD_STICK: |
229 | case SPI_FCCMD_STICK: |
225 | cli(); |
230 | cli(); |
226 | tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127; |
231 | tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127; |
227 | ToNaviCtrl.Param.Byte[0] = (char) tmp; |
232 | ToNaviCtrl.Param.Byte[0] = (char) tmp; |
228 | tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127; |
233 | tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127; |