Rev 2466 | Rev 2497 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2466 | Rev 2496 | ||
---|---|---|---|
Line 82... | Line 82... | ||
82 | unsigned volatile char SioTmp = 0; |
82 | unsigned volatile char SioTmp = 0; |
83 | unsigned volatile char NeuerDatensatzEmpfangen = 0; |
83 | unsigned volatile char NeuerDatensatzEmpfangen = 0; |
84 | unsigned volatile char NeueKoordinateEmpfangen = 0; |
84 | unsigned volatile char NeueKoordinateEmpfangen = 0; |
85 | unsigned volatile char UebertragungAbgeschlossen = 1; |
85 | unsigned volatile char UebertragungAbgeschlossen = 1; |
86 | unsigned volatile char CntCrcError = 0; |
86 | unsigned volatile char CntCrcError = 0; |
87 | unsigned volatile char AnzahlEmpfangsBytes = 0; |
87 | unsigned volatile char AnzahlEmpfangsBytes = 0; // achtung: das ist die AscII-Buffer länge, nicht die Nettodatenlänge |
88 | unsigned volatile char TxdBuffer[MAX_SENDE_BUFF]; |
88 | unsigned volatile char TxdBuffer[MAX_SENDE_BUFF]; |
89 | unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
89 | unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF]; |
Line 90... | Line 90... | ||
90 | 90 | ||
91 | unsigned char *pRxData = 0; |
91 | unsigned char *pRxData = 0; |
Line 96... | Line 96... | ||
96 | 96 | ||
97 | unsigned char PcZugriff = 100; |
97 | unsigned char PcZugriff = 100; |
98 | unsigned char MotorTest[16]; |
98 | unsigned char MotorTest[16]; |
99 | unsigned char MeineSlaveAdresse = 1; // Flight-Ctrl |
99 | unsigned char MeineSlaveAdresse = 1; // Flight-Ctrl |
- | 100 | unsigned char ConfirmFrame; |
|
100 | unsigned char ConfirmFrame; |
101 | unsigned char ExternalControlTimeout = 0; |
101 | struct str_DebugOut DebugOut; |
102 | struct str_DebugOut DebugOut; |
102 | struct str_ExternControl ExternControl; |
103 | struct str_ExternControl ExternalControl; |
103 | struct str_VersionInfo VersionInfo; |
104 | struct str_VersionInfo VersionInfo; |
104 | struct str_WinkelOut WinkelOut; |
105 | struct str_WinkelOut WinkelOut; |
Line 105... | Line 106... | ||
105 | struct str_Data3D Data3D; |
106 | struct str_Data3D Data3D; |
Line 617... | Line 618... | ||
617 | DebugTextAnforderung = pRxData[0]; |
618 | DebugTextAnforderung = pRxData[0]; |
618 | if (DebugTextAnforderung > 31) DebugTextAnforderung = 31; |
619 | if (DebugTextAnforderung > 31) DebugTextAnforderung = 31; |
619 | PcZugriff = 255; |
620 | PcZugriff = 255; |
620 | break; |
621 | break; |
621 | case 'b': |
622 | case 'b': |
- | 623 | if(AnzahlEmpfangsBytes < 20) // prevents that the old frame is guilty |
|
- | 624 | { |
|
622 | memcpy((unsigned char *)&ExternControl, (unsigned char *)pRxData, sizeof(ExternControl)); |
625 | memcpy((unsigned char *)&ExternalControl, (unsigned char *)pRxData, sizeof(ExternalControl)); |
623 | ConfirmFrame = ExternControl.Frame; |
626 | ConfirmFrame = ExternalControl.Frame; |
- | 627 | ExternalControlTimeout = 100; // 2 seconds timeout |
|
624 | PcZugriff = 255; |
628 | } |
625 | break; |
629 | break; |
626 | case 'c': // Poll the 3D-Data |
630 | case 'c': // Poll the 3D-Data |
627 | if(!Intervall3D) { if(pRxData[0]) Timer3D = SetDelay(pRxData[0] * 10);} |
631 | if(!Intervall3D) { if(pRxData[0]) Timer3D = SetDelay(pRxData[0] * 10);} |
628 | Intervall3D = pRxData[0] * 10; |
632 | Intervall3D = pRxData[0] * 10; |
629 | AboTimeOut = SetDelay(ABO_TIMEOUT); |
633 | AboTimeOut = SetDelay(ABO_TIMEOUT); |
Line 787... | Line 791... | ||
787 | Debug_OK("Version gesendet"); |
791 | Debug_OK("Version gesendet"); |
788 | } |
792 | } |
Line 789... | Line 793... | ||
789 | 793 | ||
790 | if(GetExternalControl && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
794 | if(GetExternalControl && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen |
791 | { |
795 | { |
792 | SendOutData('G',MeineSlaveAdresse, 1, (unsigned char *) &ExternControl, sizeof(ExternControl)); |
796 | SendOutData('G',MeineSlaveAdresse, 1, (unsigned char *) &ExternalControl, sizeof(ExternalControl)); |
793 | GetExternalControl = 0; |
797 | GetExternalControl = 0; |
794 | } |
798 | } |
795 | if(((DebugDataIntervall>0 && CheckDelay(Debug_Timer)) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
799 | if(((DebugDataIntervall>0 && CheckDelay(Debug_Timer)) || DebugDataAnforderung) && UebertragungAbgeschlossen) |
796 | { |
800 | { |