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