Rev 1880 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1880 | Rev 1897 | ||
---|---|---|---|
Line 75... | Line 75... | ||
75 | int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D; |
75 | int Display_Timer, Debug_Timer,Kompass_Timer,Timer3D; |
76 | unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0; |
76 | unsigned int DebugDataIntervall = 0, Intervall3D = 0, Display_Interval = 0; |
77 | unsigned int AboTimeOut = 0; |
77 | unsigned int AboTimeOut = 0; |
78 | unsigned volatile char JetiUpdateModeActive = 0; |
78 | unsigned volatile char JetiUpdateModeActive = 0; |
Line -... | Line 79... | ||
- | 79 | ||
- | 80 | ||
- | 81 | ||
- | 82 | ||
- | 83 | ||
- | 84 | #ifdef WITH_FULL_ANALOG_TEXT /// MartinW main.h means no memsave |
|
- | 85 | #warning : "### with normal ANALOG_TEXT[32][16] ###" |
|
79 | 86 | ||
80 | const unsigned char ANALOG_TEXT[32][16] PROGMEM = |
87 | const unsigned char ANALOG_TEXT[32][16] PROGMEM = |
81 | { |
88 | { |
82 | //1234567890123456 |
89 | //1234567890123456 |
83 | "AngleNick ", //0 |
90 | "AngleNick ", //0 |
Line 94... | Line 101... | ||
94 | "Gyro Compass ", |
101 | "Gyro Compass ", |
95 | "Motor 1 ", |
102 | "Motor 1 ", |
96 | "Motor 2 ", |
103 | "Motor 2 ", |
97 | "Motor 3 ", |
104 | "Motor 3 ", |
98 | "Motor 4 ", //15 |
105 | "Motor 4 ", //15 |
99 | "16 ", |
106 | "Motor 5 ",/// |
100 | "17 ", |
107 | "Motor 6 ",/// |
101 | "18 ", |
108 | "nc alt speed ", |
102 | "19 ", |
109 | "19 ", |
103 | "Servo ", //20 |
110 | "Servo ", //20 |
104 | "Hovergas ", |
111 | "Hovergas ", |
105 | "Current [0.1A] ", |
112 | "Current [0.1A] ", |
106 | "Capacity [mAh] ", |
113 | "Capacity [mAh] ", |
107 | "Hight Setpoint ", |
114 | "Hight Setpoint ", |
108 | "25 ", //25 |
115 | "Motor 7 ", //25 /// |
109 | "26 ", |
116 | "Motor 8 ",/// |
110 | "Compass Setpoint", |
117 | "Compass Setpoint", |
111 | "I2C-Error ", |
118 | "I2C-Error ", |
112 | "BL Limit ", |
119 | "BL Limit ", |
113 | "GPS_Nick ", //30 |
120 | "GPS_Nick ", //30 |
114 | "GPS_Roll " |
121 | "GPS_Roll " |
115 | }; |
122 | }; |
116 | - | ||
Line -... | Line 123... | ||
- | 123 | ||
- | 124 | #else |
|
- | 125 | #warning : "### with reduced ANALOG_TEXT[32][13] ###" |
|
- | 126 | const unsigned char ANALOG_TEXT[32][13] PROGMEM = |
|
- | 127 | { |
|
- | 128 | //1234567890123456 |
|
- | 129 | "AngleNick ", //0 |
|
- | 130 | "AngleRoll ", |
|
- | 131 | "AccNick ", |
|
- | 132 | "AccRoll ", |
|
- | 133 | "YawGyro ", |
|
- | 134 | "Height Value ", //5 |
|
- | 135 | "AccZ ", |
|
- | 136 | "Gas ", |
|
- | 137 | "Compass Value", |
|
- | 138 | "Voltage[0.1V]", |
|
- | 139 | "ReceiverLevel", //10 |
|
- | 140 | "Gyro Compass ", |
|
- | 141 | "Motor 1 ", |
|
- | 142 | "Motor 2 ", |
|
- | 143 | "Motor 3 ", |
|
- | 144 | "Motor 4 ", //15 |
|
- | 145 | "Motor 5 ",/// |
|
- | 146 | "Motor 6 ",/// |
|
- | 147 | "nc alt speed ", |
|
- | 148 | "19 ", |
|
- | 149 | "Servo ", //20 |
|
- | 150 | "Hovergas ", |
|
- | 151 | "Current[0.1A]", |
|
- | 152 | "Capacity[mAh]", |
|
- | 153 | "Hight Setp ", |
|
- | 154 | "Motor 8 ", //25 /// |
|
- | 155 | "Motor 9 ",/// |
|
- | 156 | "Compass Setp ", |
|
- | 157 | "I2C-Error ", |
|
- | 158 | "BL Limit ", |
|
- | 159 | "GPS_Nick ", //30 |
|
- | 160 | "GPS_Roll " |
|
- | 161 | }; |
|
- | 162 | ||
- | 163 | ||
- | 164 | #endif |
|
117 | 165 | ||
118 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
166 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
119 | //++ Sende-Part der Datenübertragung |
167 | //++ Sende-Part der Datenübertragung |
120 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
168 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
121 | ISR(USART0_TX_vect) |
169 | ISR(USART0_TX_vect) |
Line 168... | Line 216... | ||
168 | NeuerDatensatzEmpfangen = 1; |
216 | NeuerDatensatzEmpfangen = 1; |
169 | AnzahlEmpfangsBytes = buf_ptr + 1; |
217 | AnzahlEmpfangsBytes = buf_ptr + 1; |
170 | RxdBuffer[buf_ptr] = '\r'; |
218 | RxdBuffer[buf_ptr] = '\r'; |
171 | if(RxdBuffer[2] == 'R') |
219 | if(RxdBuffer[2] == 'R') |
172 | { |
220 | { |
- | 221 | ||
- | 222 | #ifdef WITH_MKTOOL_Display /// MartinW main.h |
|
- | 223 | #warning : "### with MKTool Display ###" |
|
173 | LcdClear(); |
224 | LcdClear(); |
- | 225 | #endif |
|
- | 226 | ||
174 | wdt_enable(WDTO_250MS); // Reset-Commando |
227 | wdt_enable(WDTO_250MS); // Reset-Commando |
175 | ServoActive = 0; |
228 | ServoActive = 0; |
176 | } |
229 | } |
Line 177... | Line 230... | ||
177 | 230 | ||
Line 465... | Line 518... | ||
465 | while(!UebertragungAbgeschlossen); // wait for previous frame to be sent |
518 | while(!UebertragungAbgeschlossen); // wait for previous frame to be sent |
466 | SendOutData('W', FC_ADDRESS,2, &tempchar1, sizeof(tempchar1), &tempchar2, sizeof(tempchar2)); |
519 | SendOutData('W', FC_ADDRESS,2, &tempchar1, sizeof(tempchar1), &tempchar2, sizeof(tempchar2)); |
467 | } |
520 | } |
468 | break; |
521 | break; |
469 | case 'j': |
522 | case 'j': |
- | 523 | ||
- | 524 | ||
- | 525 | #ifdef WITH_JETI_SIMULATION /// MartinW main.h means no memsave |
|
- | 526 | #warning : "### with jeti update command ###" |
|
- | 527 | ||
- | 528 | ||
- | 529 | ||
470 | tempchar1 = LIBFC_GetCPUType(); |
530 | tempchar1 = LIBFC_GetCPUType(); |
471 | if((tempchar1 == CPU_ATMEGA644P) || (tempchar1 == CPU_ATMEGA1284P)) |
531 | if((tempchar1 == CPU_ATMEGA644P) || (tempchar1 == CPU_ATMEGA1284P)) |
472 | { |
532 | { |
473 | uint16_t ubrr = (uint16_t) ((uint32_t) F_CPU/ (8 * 38400L) - 1); |
533 | uint16_t ubrr = (uint16_t) ((uint32_t) F_CPU/ (8 * 38400L) - 1); |
Line 522... | Line 582... | ||
522 | TIMSK1 = 0; |
582 | TIMSK1 = 0; |
523 | TIMSK2 = 0; |
583 | TIMSK2 = 0; |
Line 524... | Line 584... | ||
524 | 584 | ||
525 | sei(); |
585 | sei(); |
- | 586 | } |
|
- | 587 | ||
- | 588 | #else |
|
- | 589 | #warning : "### without jeti update command ###" |
|
- | 590 | ||
526 | } |
591 | #endif |
Line 527... | Line 592... | ||
527 | break; |
592 | break; |
Line 528... | Line 593... | ||
528 | 593 | ||
Line 568... | Line 633... | ||
568 | if(DebugDataIntervall > 0) DebugDataAnforderung = 1; |
633 | if(DebugDataIntervall > 0) DebugDataAnforderung = 1; |
569 | AboTimeOut = SetDelay(ABO_TIMEOUT); |
634 | AboTimeOut = SetDelay(ABO_TIMEOUT); |
570 | break; |
635 | break; |
Line 571... | Line 636... | ||
571 | 636 | ||
- | 637 | case 'h':// x-1 Displayzeilen |
|
- | 638 | ||
- | 639 | #ifdef WITH_MKTOOL_Dispay /// MartinW memorysave |
|
- | 640 | #warning : "### with MKTool Display ###" |
|
572 | case 'h':// x-1 Displayzeilen |
641 | |
573 | PcZugriff = 255; |
642 | PcZugriff = 255; |
574 | if((pRxData[0] & 0x80) == 0x00) // old format |
643 | if((pRxData[0] & 0x80) == 0x00) // old format |
575 | { |
644 | { |
576 | DisplayLine = 2; |
645 | DisplayLine = 2; |
Line 588... | Line 657... | ||
588 | 657 | ||
589 | case 'l':// x-1 Displayzeilen |
658 | case 'l':// x-1 Displayzeilen |
590 | PcZugriff = 255; |
659 | PcZugriff = 255; |
591 | MenuePunkt = pRxData[0]; |
660 | MenuePunkt = pRxData[0]; |
- | 661 | DebugDisplayAnforderung1 = 1; |
|
- | 662 | ||
592 | DebugDisplayAnforderung1 = 1; |
663 | #endif |
- | 664 | break; |
|
- | 665 | ||
593 | break; |
666 | |
594 | case 'v': // Version-Anforderung und Ausbaustufe |
667 | case 'v': // Version-Anforderung und Ausbaustufe |
595 | GetVersionAnforderung = 1; |
668 | GetVersionAnforderung = 1; |
Line 596... | Line 669... | ||
596 | break; |
669 | break; |
Line 665... | Line 738... | ||
665 | Display_Interval = 0; |
738 | Display_Interval = 0; |
666 | DebugDataIntervall = 0; |
739 | DebugDataIntervall = 0; |
667 | Intervall3D = 0; |
740 | Intervall3D = 0; |
668 | } |
741 | } |
Line -... | Line 742... | ||
- | 742 | ||
- | 743 | #ifdef WITH_MKTOOL_Display //main.h |
|
- | 744 | #warning : "### with MKTool Display ###" |
|
669 | 745 | ||
670 | if(((Display_Interval>0 && CheckDelay(Display_Timer)) || DebugDisplayAnforderung) && UebertragungAbgeschlossen) |
746 | if(((Display_Interval>0 && CheckDelay(Display_Timer)) || DebugDisplayAnforderung) && UebertragungAbgeschlossen) |
671 | { |
747 | { |
672 | if(DisplayLine > 3)// new format |
748 | if(DisplayLine > 3)// new format |
673 | { |
749 | { |
Line 687... | Line 763... | ||
687 | { |
763 | { |
688 | Menu(); |
764 | Menu(); |
689 | SendOutData('L', FC_ADDRESS, 3, &MenuePunkt, sizeof(MenuePunkt), &MaxMenue, sizeof(MaxMenue), DisplayBuff, sizeof(DisplayBuff)); |
765 | SendOutData('L', FC_ADDRESS, 3, &MenuePunkt, sizeof(MenuePunkt), &MaxMenue, sizeof(MaxMenue), DisplayBuff, sizeof(DisplayBuff)); |
690 | DebugDisplayAnforderung1 = 0; |
766 | DebugDisplayAnforderung1 = 0; |
691 | } |
767 | } |
- | 768 | ||
- | 769 | #endif |
|
- | 770 | ||
692 | if(GetVersionAnforderung && UebertragungAbgeschlossen) |
771 | if(GetVersionAnforderung && UebertragungAbgeschlossen) |
693 | { |
772 | { |
694 | SendOutData('V', FC_ADDRESS, 1, (unsigned char *) &VersionInfo, sizeof(VersionInfo)); |
773 | SendOutData('V', FC_ADDRESS, 1, (unsigned char *) &VersionInfo, sizeof(VersionInfo)); |
695 | GetVersionAnforderung = 0; |
774 | GetVersionAnforderung = 0; |
696 | Debug_OK("Version gesendet"); |
775 | Debug_OK("Version gesendet"); |
Line 729... | Line 808... | ||
729 | SendOutData('C', FC_ADDRESS, 1, (unsigned char *) &Data3D,sizeof(Data3D)); |
808 | SendOutData('C', FC_ADDRESS, 1, (unsigned char *) &Data3D,sizeof(Data3D)); |
730 | Timer3D = SetDelay(Intervall3D); |
809 | Timer3D = SetDelay(Intervall3D); |
731 | } |
810 | } |
732 | if(DebugTextAnforderung != 255) // Texte für die Analogdaten |
811 | if(DebugTextAnforderung != 255) // Texte für die Analogdaten |
733 | { |
812 | { |
- | 813 | ||
- | 814 | ||
- | 815 | ||
- | 816 | #ifdef WITH_FULL_ANALOG_TEXT /// MartinW main.h means no memsave |
|
- | 817 | #warning : "### with normal ANALOG_TEXT[32][16] ###" |
|
734 | unsigned char label[16]; // local sram buffer |
818 | unsigned char label[16]; // local sram buffer |
735 | memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 16); // read lable from flash to sra |
819 | memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 16); // read lable from flash to sra |
- | 820 | SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16); |
|
- | 821 | ||
- | 822 | #else |
|
- | 823 | #warning : "### with reduced ANALOG_TEXT[32][13] ###" |
|
- | 824 | ||
- | 825 | unsigned char label[16]=" "; // local sram buffer ///MartinW; for MKTool, needs 32 bytes |
|
- | 826 | memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 13); // read lable from flash to sra |
|
736 | SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16); |
827 | SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16); |
- | 828 | #endif |
|
- | 829 | ||
- | 830 | ||
- | 831 | ||
737 | DebugTextAnforderung = 255; |
832 | DebugTextAnforderung = 255; |
738 | } |
833 | } |
739 | if(ConfirmFrame && UebertragungAbgeschlossen) // Datensatz bestätigen |
834 | if(ConfirmFrame && UebertragungAbgeschlossen) // Datensatz bestätigen |
740 | { |
835 | { |
741 | SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame)); |
836 | SendOutData('B', FC_ADDRESS, 1, (uint8_t*)&ConfirmFrame, sizeof(ConfirmFrame)); |