Rev 1211 | Rev 1215 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1211 | Rev 1212 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | unsigned volatile char CntCrcError = 0; |
26 | unsigned volatile char CntCrcError = 0; |
27 | unsigned volatile char AnzahlEmpfangsBytes = 0; |
27 | unsigned volatile char AnzahlEmpfangsBytes = 0; |
28 | unsigned char *pRxData = 0; |
28 | unsigned char *pRxData = 0; |
29 | unsigned char RxDataLen = 0; |
29 | unsigned char RxDataLen = 0; |
30 | unsigned volatile char PC_DebugTimeout = 0; |
30 | unsigned volatile char PC_DebugTimeout = 0; |
- | 31 | unsigned volatile char PC_MotortestActive = 0; |
|
Line 31... | Line 32... | ||
31 | 32 | ||
32 | unsigned char DebugTextAnforderung = 255; |
33 | unsigned char DebugTextAnforderung = 255; |
33 | unsigned char PcZugriff = 100; |
34 | unsigned char PcZugriff = 100; |
34 | unsigned char MotorTest[4] = {0,0,0,0}; |
35 | unsigned char MotorTest[16]; |
35 | unsigned char MeineSlaveAdresse = 1; // Flight-Ctrl |
36 | unsigned char MeineSlaveAdresse = 1; // Flight-Ctrl |
36 | unsigned char ConfirmFrame; |
37 | unsigned char ConfirmFrame; |
37 | struct str_DebugOut DebugOut; |
38 | struct str_DebugOut DebugOut; |
38 | struct str_ExternControl ExternControl; |
39 | struct str_ExternControl ExternControl; |
Line 296... | Line 297... | ||
296 | { |
297 | { |
297 | case 'K':// Kompasswert |
298 | case 'K':// Kompasswert |
298 | memcpy((unsigned char *)&KompassValue , (unsigned char *)pRxData, sizeof(KompassValue)); |
299 | memcpy((unsigned char *)&KompassValue , (unsigned char *)pRxData, sizeof(KompassValue)); |
299 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
300 | KompassRichtung = ((540 + KompassValue - KompassStartwert) % 360) - 180; |
300 | break; |
301 | break; |
301 | - | ||
302 | case 't':// Motortest |
302 | case 't':// Motortest |
303 | memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest)); |
303 | if(AnzahlEmpfangsBytes > 20) memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest)); |
- | 304 | else memcpy(&MotorTest[0], (unsigned char *)pRxData, 4); |
|
- | 305 | PC_MotortestActive = 240; |
|
304 | //while(!UebertragungAbgeschlossen); |
306 | //while(!UebertragungAbgeschlossen); |
305 | //SendOutData('T', MeineSlaveAdresse, 0); |
307 | //SendOutData('T', MeineSlaveAdresse, 0); |
306 | PcZugriff = 255; |
308 | PcZugriff = 255; |
307 | break; |
309 | break; |
Line 370... | Line 372... | ||
370 | 372 | ||
371 | switch(RxdBuffer[2]) |
373 | switch(RxdBuffer[2]) |
372 | { |
374 | { |
373 | // 't' comand placed here only for compatibility to BL |
375 | // 't' comand placed here only for compatibility to BL |
374 | case 't':// Motortest |
376 | case 't':// Motortest |
- | 377 | if(AnzahlEmpfangsBytes > 20) memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest)); |
|
375 | memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest)); |
378 | else memcpy(&MotorTest[0], (unsigned char *)pRxData, 4); |
376 | while(!UebertragungAbgeschlossen); |
379 | while(!UebertragungAbgeschlossen); |
- | 380 | SendOutData('T', MeineSlaveAdresse, 0); |
|
377 | SendOutData('T', MeineSlaveAdresse, 0); |
381 | PC_MotortestActive = 250; |
378 | PcZugriff = 255; |
382 | PcZugriff = 255; |
379 | break; |
383 | break; |
380 | // 'K' comand placed here only for compatibility to old MK3MAG software, that does not send the right Slave Address |
384 | // 'K' comand placed here only for compatibility to old MK3MAG software, that does not send the right Slave Address |
381 | case 'K':// Kompasswert |
385 | case 'K':// Kompasswert |