Rev 882 | Rev 930 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 882 | Rev 921 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | unsigned char *SPI_TX_Buffer; |
14 | unsigned char *SPI_TX_Buffer; |
Line 15... | Line 15... | ||
15 | 15 | ||
16 | unsigned char SPITransferCompleted, SPI_ChkSum; |
16 | unsigned char SPITransferCompleted, SPI_ChkSum; |
Line 17... | Line 17... | ||
17 | unsigned char SPI_RxDataValid; |
17 | unsigned char SPI_RxDataValid; |
18 | 18 | ||
Line 19... | Line 19... | ||
19 | unsigned char SPI_CommandSequence[] = { SPI_CMD_USER, SPI_CMD_STICK, SPI_CMD_USER, SPI_CMD_STICK, SPI_CMD_CAL_COMPASS }; |
19 | unsigned char SPI_CommandSequence[] = { SPI_CMD_USER, SPI_CMD_STICK, SPI_CMD_PARAMETER1, SPI_CMD_STICK, SPI_CMD_CAL_COMPASS}; |
Line 20... | Line 20... | ||
20 | unsigned char SPI_CommandCounter = 0; |
20 | unsigned char SPI_CommandCounter = 0; |
Line 171... | Line 171... | ||
171 | ToNaviCtrl.Param.Byte[2] = Parameter_UserParam3; |
171 | ToNaviCtrl.Param.Byte[2] = Parameter_UserParam3; |
172 | ToNaviCtrl.Param.Byte[3] = Parameter_UserParam4; |
172 | ToNaviCtrl.Param.Byte[3] = Parameter_UserParam4; |
173 | ToNaviCtrl.Param.Byte[4] = Parameter_UserParam5; |
173 | ToNaviCtrl.Param.Byte[4] = Parameter_UserParam5; |
174 | ToNaviCtrl.Param.Byte[5] = Parameter_UserParam6; |
174 | ToNaviCtrl.Param.Byte[5] = Parameter_UserParam6; |
175 | ToNaviCtrl.Param.Byte[6] = Parameter_UserParam7; |
175 | ToNaviCtrl.Param.Byte[6] = Parameter_UserParam7; |
- | 176 | ToNaviCtrl.Param.Byte[7] = Parameter_UserParam8; |
|
- | 177 | ToNaviCtrl.Param.Byte[8] = (unsigned char) MikroKopterFlags; |
|
- | 178 | MikroKopterFlags &= ~(FLAG_CALIBRATE | FLAG_START); |
|
- | 179 | ToNaviCtrl.Param.Byte[9] = (unsigned char) UBat; |
|
- | 180 | ToNaviCtrl.Param.Byte[10] =(unsigned char) EE_Parameter.UnterspannungsWarnung; |
|
- | 181 | ToNaviCtrl.Param.Byte[11] =(unsigned char) eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]); |
|
- | 182 | break; |
|
- | 183 | ||
- | 184 | case SPI_CMD_PARAMETER1: |
|
- | 185 | ToNaviCtrl.Param.Byte[0] = Parameter_NaviGpsModeControl; // Parameters for the Naviboard |
|
- | 186 | ToNaviCtrl.Param.Byte[1] = Parameter_NaviGpsGain; |
|
- | 187 | ToNaviCtrl.Param.Byte[2] = Parameter_NaviGpsP; |
|
- | 188 | ToNaviCtrl.Param.Byte[3] = Parameter_NaviGpsI; |
|
- | 189 | ToNaviCtrl.Param.Byte[4] = Parameter_NaviGpsD; |
|
- | 190 | ToNaviCtrl.Param.Byte[5] = Parameter_NaviGpsACC; |
|
- | 191 | ToNaviCtrl.Param.Byte[6] = EE_Parameter.NaviGpsMinSat; |
|
- | 192 | ToNaviCtrl.Param.Byte[7] = EE_Parameter.NaviStickThreshold; |
|
- | 193 | ToNaviCtrl.Param.Byte[8] = 15; // MaxRadius |
|
176 | break; |
194 | break; |
Line 177... | Line 195... | ||
177 | 195 | ||
178 | case SPI_CMD_STICK: |
196 | case SPI_CMD_STICK: |
179 | tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127; |
197 | tmp = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]; if(tmp > 127) tmp = 127; else if(tmp < -127) tmp = -127; |
Line 187... | Line 205... | ||
187 | ToNaviCtrl.Param.Byte[4] = (unsigned char) Poti1; |
205 | ToNaviCtrl.Param.Byte[4] = (unsigned char) Poti1; |
188 | ToNaviCtrl.Param.Byte[5] = (unsigned char) Poti2; |
206 | ToNaviCtrl.Param.Byte[5] = (unsigned char) Poti2; |
189 | ToNaviCtrl.Param.Byte[6] = (unsigned char) Poti3; |
207 | ToNaviCtrl.Param.Byte[6] = (unsigned char) Poti3; |
190 | ToNaviCtrl.Param.Byte[7] = (unsigned char) Poti4; |
208 | ToNaviCtrl.Param.Byte[7] = (unsigned char) Poti4; |
191 | ToNaviCtrl.Param.Byte[8] = (unsigned char) SenderOkay; |
209 | ToNaviCtrl.Param.Byte[8] = (unsigned char) SenderOkay; |
192 | - | ||
193 | break; |
210 | break; |
194 | case SPI_CMD_CAL_COMPASS: |
211 | case SPI_CMD_CAL_COMPASS: |
195 | if(WinkelOut.CalcState > 5) |
212 | if(WinkelOut.CalcState > 5) |
196 | { |
213 | { |
197 | WinkelOut.CalcState = 0; |
214 | WinkelOut.CalcState = 0; |