Rev 2176 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2176 | Rev 2177 | ||
---|---|---|---|
Line 107... | Line 107... | ||
107 | int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D; |
107 | int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D; |
108 | unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0; |
108 | unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0; |
109 | unsigned int AboTimeOut = 0; |
109 | unsigned int AboTimeOut = 0; |
110 | unsigned volatile char ReceiverUpdateModeActive = 0; // 1 = Update 2 = JetiBox-Simulation |
110 | unsigned volatile char ReceiverUpdateModeActive = 0; // 1 = Update 2 = JetiBox-Simulation |
Line -... | Line 111... | ||
- | 111 | ||
- | 112 | ||
- | 113 | ||
- | 114 | ||
- | 115 | ||
- | 116 | #ifdef WITH_FULL_ANALOG_TEXT /// MartinW main.h means no memsave |
|
- | 117 | #warning : "### with normal ANALOG_TEXT[32][16] ###" |
|
111 | 118 | ||
112 | const unsigned char ANALOG_TEXT[32][16] PROGMEM = |
119 | const unsigned char ANALOG_TEXT[32][16] PROGMEM = |
113 | { |
120 | { |
114 | //1234567890123456 |
121 | //1234567890123456 |
115 | "AngleNick ", //0 |
122 | "AngleNick ", //0 |
Line 126... | Line 133... | ||
126 | "Gyro Compass ", |
133 | "Gyro Compass ", |
127 | "Motor 1 ", |
134 | "Motor 1 ", |
128 | "Motor 2 ", |
135 | "Motor 2 ", |
129 | "Motor 3 ", |
136 | "Motor 3 ", |
130 | "Motor 4 ", //15 |
137 | "Motor 4 ", //15 |
131 | "16 ", |
138 | "PAN-Cos ",//MartinR |
132 | "17 ", |
139 | "PAN-Sin ",//MartinR |
133 | "18 ", |
140 | "PAN-Servo ",//MartinR |
134 | "19 ", |
141 | "Servo-Roll ",//MartinR |
135 | "Servo ", //20 |
142 | "Servo-Nick ", //20 |
136 | "Hovergas ", |
143 | "Hovergas ", |
137 | "Current [0.1A] ", |
144 | "Current [0.1A] ", |
138 | "Capacity [mAh] ", |
145 | "Capacity [mAh] ", |
139 | "Height Setpoint ", |
146 | "Hight Setpoint ", |
140 | "25 ", //25 |
147 | "FC_StatusFlags ", //25 ///MartinR |
141 | "26 ", //"26 CPU OverLoad ", |
148 | "FC_StatusFlags2 ",///MartinR |
142 | "Compass Setpoint", |
149 | "Compass Setpoint", |
143 | "I2C-Error ", |
150 | "I2C-Error ", |
144 | "BL Limit ", |
151 | "BL Limit ", |
145 | "GPS_Nick ", //30 |
152 | "GPS_Nick ", //30 |
146 | "GPS_Roll " |
153 | "GPS_Roll " |
147 | }; |
154 | }; |
Line -... | Line 155... | ||
- | 155 | ||
- | 156 | ||
- | 157 | #else |
|
- | 158 | #warning : "### with reduced ANALOG_TEXT[32][13] ###" |
|
- | 159 | const unsigned char ANALOG_TEXT[32][13] PROGMEM = |
|
- | 160 | { |
|
- | 161 | //1234567890123456 |
|
- | 162 | "AngleNick ", //0 |
|
- | 163 | "AngleRoll ", |
|
- | 164 | "AccNick ", |
|
- | 165 | "AccRoll ", |
|
- | 166 | "YawGyro ", |
|
- | 167 | "Height Value ", //5 |
|
- | 168 | "AccZ ", |
|
- | 169 | "Gas ", |
|
- | 170 | "Compass Value", |
|
- | 171 | "Voltage[0.1V]", |
|
- | 172 | "ReceiverLevel", //10 |
|
- | 173 | "Gyro Compass ", |
|
- | 174 | "Motor 1 ", |
|
- | 175 | "Motor 2 ", |
|
- | 176 | "Motor 3 ", |
|
- | 177 | "Motor 4 ", //15 |
|
- | 178 | "PAN-cos ",//MartinR |
|
- | 179 | "PAN-sin ",//MartinR |
|
- | 180 | "PAN-Servo ",//MartinR |
|
- | 181 | "Servo-Roll ",//MartinR |
|
- | 182 | "Servo-Nick ", //20 |
|
- | 183 | "Hovergas ", |
|
- | 184 | "Current[0.1A]", |
|
- | 185 | "Capacity[mAh]", |
|
- | 186 | "Hight Setp ", |
|
- | 187 | "FC_Flags ", //25 ///MartinR |
|
- | 188 | "FC_Flags2 ",///MartinR |
|
- | 189 | "Compass Setp ", |
|
- | 190 | "I2C-Error ", |
|
- | 191 | "BL Limit ", |
|
- | 192 | "GPS_Nick ", //30 |
|
- | 193 | "GPS_Roll " |
|
- | 194 | }; |
|
- | 195 | ||
- | 196 | ||
148 | 197 | #endif |
|
149 | 198 | ||
150 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
199 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
151 | //++ Sende-Part der Datenübertragung |
200 | //++ Sende-Part der Datenübertragung |
152 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
201 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Line 200... | Line 249... | ||
200 | NeuerDatensatzEmpfangen = 1; |
249 | NeuerDatensatzEmpfangen = 1; |
201 | AnzahlEmpfangsBytes = buf_ptr + 1; |
250 | AnzahlEmpfangsBytes = buf_ptr + 1; |
202 | RxdBuffer[buf_ptr] = '\r'; |
251 | RxdBuffer[buf_ptr] = '\r'; |
203 | if(RxdBuffer[2] == 'R') |
252 | if(RxdBuffer[2] == 'R') |
204 | { |
253 | { |
- | 254 | ||
- | 255 | #ifdef WITH_MKTOOL_Display /// MartinW main.h |
|
- | 256 | #warning : "### with MKTool Display ###" |
|
205 | LcdClear(); |
257 | LcdClear(); |
- | 258 | #endif |
|
- | 259 | ||
206 | wdt_enable(WDTO_250MS); // Reset-Commando |
260 | wdt_enable(WDTO_250MS); // Reset-Commando |
207 | ServoActive = 0; |
261 | ServoActive = 0; |
208 | } |
262 | } |
Line 209... | Line 263... | ||
209 | 263 | ||
Line 498... | Line 552... | ||
498 | SendOutData('W', FC_ADDRESS,2, &tempchar1, sizeof(tempchar1), &tempchar2, sizeof(tempchar2)); |
552 | SendOutData('W', FC_ADDRESS,2, &tempchar1, sizeof(tempchar1), &tempchar2, sizeof(tempchar2)); |
499 | } |
553 | } |
500 | break; |
554 | break; |
501 | case 'j': |
555 | case 'j': |
502 | if(MotorenEin) break; |
556 | if(MotorenEin) break; |
- | 557 | ||
- | 558 | #ifdef WITH_JETI_SIMULATION /// MartinW main.h means no memsave |
|
- | 559 | #warning : "### with jeti update command ###" |
|
- | 560 | ||
- | 561 | ||
- | 562 | ||
503 | tempchar1 = LIBFC_GetCPUType(); |
563 | tempchar1 = LIBFC_GetCPUType(); |
504 | if((tempchar1 == CPU_ATMEGA644P) || (tempchar1 == CPU_ATMEGA1284P)) |
564 | if((tempchar1 == CPU_ATMEGA644P) || (tempchar1 == CPU_ATMEGA1284P)) |
505 | { |
565 | { |
506 | uint16_t ubrr = (uint16_t) ((uint32_t) F_CPU/ (8 * 38400L) - 1); |
566 | uint16_t ubrr = (uint16_t) ((uint32_t) F_CPU/ (8 * 38400L) - 1); |
Line 556... | Line 616... | ||
556 | TIMSK1 = 0; |
616 | TIMSK1 = 0; |
557 | TIMSK2 = 0; |
617 | TIMSK2 = 0; |
Line 558... | Line 618... | ||
558 | 618 | ||
559 | sei(); |
619 | sei(); |
- | 620 | } |
|
- | 621 | ||
- | 622 | #else |
|
- | 623 | #warning : "### without jeti update command ###" |
|
- | 624 | ||
560 | } |
625 | #endif |
Line 561... | Line 626... | ||
561 | break; |
626 | break; |
Line 562... | Line 627... | ||
562 | 627 | ||
Line 602... | Line 667... | ||
602 | if(DebugDataIntervall > 0) DebugDataAnforderung = 1; |
667 | if(DebugDataIntervall > 0) DebugDataAnforderung = 1; |
603 | AboTimeOut = SetDelay(ABO_TIMEOUT); |
668 | AboTimeOut = SetDelay(ABO_TIMEOUT); |
604 | break; |
669 | break; |
Line 605... | Line 670... | ||
605 | 670 | ||
- | 671 | case 'h':// x-1 Displayzeilen |
|
- | 672 | ||
- | 673 | #ifdef WITH_MKTOOL_Display /// MartinW memorysave |
|
- | 674 | #warning : "### with MKTool Display ###" |
|
606 | case 'h':// x-1 Displayzeilen |
675 | |
607 | PcZugriff = 255; |
676 | PcZugriff = 255; |
608 | if((pRxData[0] & 0x80) == 0x00) // old format |
677 | if((pRxData[0] & 0x80) == 0x00) // old format |
609 | { |
678 | { |
610 | DisplayLine = 2; |
679 | DisplayLine = 2; |
611 | Display_Interval = 0; |
680 | Display_Interval = 0; |
Line 622... | Line 691... | ||
622 | 691 | ||
623 | case 'l':// x-1 Displayzeilen |
692 | case 'l':// x-1 Displayzeilen |
624 | PcZugriff = 255; |
693 | PcZugriff = 255; |
625 | MenuePunkt = pRxData[0]; |
694 | MenuePunkt = pRxData[0]; |
- | 695 | DebugDisplayAnforderung1 = 1; |
|
- | 696 | ||
626 | DebugDisplayAnforderung1 = 1; |
697 | #endif |
627 | break; |
698 | break; |
628 | case 'v': // Version-Anforderung und Ausbaustufe |
699 | case 'v': // Version-Anforderung und Ausbaustufe |
629 | GetVersionAnforderung = 1; |
700 | GetVersionAnforderung = 1; |
Line 699... | Line 770... | ||
699 | Display_Interval = 0; |
770 | Display_Interval = 0; |
700 | DebugDataIntervall = 0; |
771 | DebugDataIntervall = 0; |
701 | Intervall3D = 0; |
772 | Intervall3D = 0; |
702 | } |
773 | } |
Line -... | Line 774... | ||
- | 774 | ||
- | 775 | #ifdef WITH_MKTOOL_Display //main.h |
|
- | 776 | #warning : "### with MKTool Display ###" |
|
703 | 777 | ||
704 | if(((Display_Interval>0 && CheckDelay(Display_Timer)) || DebugDisplayAnforderung) && UebertragungAbgeschlossen) |
778 | if(((Display_Interval>0 && CheckDelay(Display_Timer)) || DebugDisplayAnforderung) && UebertragungAbgeschlossen) |
705 | { |
779 | { |
706 | if(DisplayLine > 3)// new format |
780 | if(DisplayLine > 3)// new format |
707 | { |
781 | { |
Line 721... | Line 795... | ||
721 | { |
795 | { |
722 | Menu(); |
796 | Menu(); |
723 | SendOutData('L', FC_ADDRESS, 3, &MenuePunkt, sizeof(MenuePunkt), &MaxMenue, sizeof(MaxMenue), DisplayBuff, sizeof(DisplayBuff)); |
797 | SendOutData('L', FC_ADDRESS, 3, &MenuePunkt, sizeof(MenuePunkt), &MaxMenue, sizeof(MaxMenue), DisplayBuff, sizeof(DisplayBuff)); |
724 | DebugDisplayAnforderung1 = 0; |
798 | DebugDisplayAnforderung1 = 0; |
725 | } |
799 | } |
- | 800 | ||
- | 801 | #endif |
|
- | 802 | ||
726 | if(GetVersionAnforderung && UebertragungAbgeschlossen) |
803 | if(GetVersionAnforderung && UebertragungAbgeschlossen) |
727 | { |
804 | { |
728 | SendOutData('V', FC_ADDRESS, 1, (unsigned char *) &VersionInfo, sizeof(VersionInfo)); |
805 | SendOutData('V', FC_ADDRESS, 1, (unsigned char *) &VersionInfo, sizeof(VersionInfo)); |
729 | GetVersionAnforderung = 0; |
806 | GetVersionAnforderung = 0; |
730 | Debug_OK("Version gesendet"); |
807 | Debug_OK("Version gesendet"); |
Line 763... | Line 840... | ||
763 | SendOutData('C', FC_ADDRESS, 1, (unsigned char *) &Data3D,sizeof(Data3D)); |
840 | SendOutData('C', FC_ADDRESS, 1, (unsigned char *) &Data3D,sizeof(Data3D)); |
764 | Timer3D = SetDelay(Intervall3D); |
841 | Timer3D = SetDelay(Intervall3D); |
765 | } |
842 | } |
766 | if(DebugTextAnforderung != 255) // Texte für die Analogdaten |
843 | if(DebugTextAnforderung != 255) // Texte für die Analogdaten |
767 | { |
844 | { |
- | 845 | ||
- | 846 | ||
- | 847 | ||
- | 848 | #ifdef WITH_FULL_ANALOG_TEXT /// MartinW main.h means no memsave |
|
- | 849 | #warning : "### with normal ANALOG_TEXT[32][16] ###" |
|
768 | unsigned char label[16]; // local sram buffer |
850 | unsigned char label[16]; // local sram buffer |
769 | memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 16); // read lable from flash to sra |
851 | memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 16); // read lable from flash to sra |
- | 852 | SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16); |
|
- | 853 | ||
- | 854 | #else |
|
- | 855 | #warning : "### with reduced ANALOG_TEXT[32][13] ###" |
|
- | 856 | ||
- | 857 | unsigned char label[16]=" "; // local sram buffer ///MartinW; for MKTool, needs 32 bytes |
|
- | 858 | memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 13); // read lable from flash to sra |
|
770 | SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16); |
859 | SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16); |
- | 860 | #endif |
|
- | 861 | ||
- | 862 | ||
- | 863 | ||
771 | DebugTextAnforderung = 255; |
864 | DebugTextAnforderung = 255; |
772 | } |
865 | } |
773 | if(ConfirmFrame && UebertragungAbgeschlossen) // Datensatz bestätigen |
866 | if(ConfirmFrame && UebertragungAbgeschlossen) // Datensatz bestätigen |
774 | { |
867 | { |
775 | SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame)); |
868 | SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame)); |