Rev 2536 | Rev 2540 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2536 | Rev 2537 | ||
---|---|---|---|
Line 78... | Line 78... | ||
78 | } |
78 | } |
Line 79... | Line 79... | ||
79 | 79 | ||
80 | void Menu(void) |
80 | void Menu(void) |
81 | { |
81 | { |
- | 82 | unsigned char i; |
|
- | 83 | static char DisableMenu = 0, AccMenu = 0, changed = 0; |
|
- | 84 | ||
- | 85 | if(!DisableMenu) |
|
82 | unsigned char i; |
86 | { |
83 | if(RemoteKeys & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue;} |
87 | if(RemoteKeys & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue;} |
84 | if(RemoteKeys & KEY2) { if(MenuePunkt == MaxMenue) MenuePunkt = 0; else MenuePunkt++;} |
88 | if(RemoteKeys & KEY2) { if(MenuePunkt == MaxMenue) MenuePunkt = 0; else MenuePunkt++;} |
- | 89 | if((RemoteKeys & KEY1) && (RemoteKeys & KEY2)) MenuePunkt = 0; |
|
85 | if((RemoteKeys & KEY1) && (RemoteKeys & KEY2)) MenuePunkt = 0; |
90 | } |
86 | LcdClear(); |
91 | LcdClear(); |
87 | if(MenuePunkt < 10) {LCD_printfxy(17,0,"[%i]",MenuePunkt);} |
92 | if(MenuePunkt < 10) {LCD_printfxy(17,0,"[%i]",MenuePunkt);} |
Line 88... | Line 93... | ||
88 | else {LCD_printfxy(16,0,"[%i]",MenuePunkt);}; |
93 | else {LCD_printfxy(16,0,"[%i]",MenuePunkt);}; |
Line 154... | Line 159... | ||
154 | case 5: |
159 | case 5: |
155 | LCD_printfxy(0,0,"Gyro - Sensor"); |
160 | LCD_printfxy(0,0,"Gyro - Sensor"); |
156 | LCD_printfxy(0,1,"Nick %4i (%4i)",AdWertNick - AdNeutralNick/8, AdNeutralNick); |
161 | LCD_printfxy(0,1,"Nick %4i (%4i)",AdWertNick - AdNeutralNick/8, AdNeutralNick); |
157 | LCD_printfxy(0,2,"Roll %4i (%4i)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll); |
162 | LCD_printfxy(0,2,"Roll %4i (%4i)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll); |
158 | LCD_printfxy(0,3,"Yaw %4i (%4i)",AdNeutralGier - AdWertGier, AdNeutralGier); |
163 | LCD_printfxy(0,3,"Yaw %4i (%4i)",AdNeutralGier - AdWertGier, AdNeutralGier); |
159 | // LCD_printfxy(0,1,"Nick %4i (%3i.%x)",AdWertNick - AdNeutralNick/8, AdNeutralNick/16, (AdNeutralNick%16)/2); |
- | |
160 | // LCD_printfxy(0,2,"Roll %4i (%3i.%x)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll/16, (AdNeutralRoll%16)/2); |
- | |
161 | // LCD_printfxy(0,1,"Nick %4i (%4i)",AdWertNickFilter, AdNeutralNick); |
- | |
162 | // LCD_printfxy(0,2,"Roll %4i (%4i)",AdWertRollFilter, AdNeutralRoll); |
- | |
163 | // LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralGier - AdWertGier, AdNeutralGier/2); |
- | |
164 | - | ||
165 | /* |
- | |
166 | // entfernt aus Platzmangel |
- | |
167 | if(PlatinenVersion == 10) |
- | |
168 | { |
- | |
169 | LCD_printfxy(0,1,"Nick%4i (%3i.%i)",AdWertNick - AdNeutralNick/8, AdNeutralNick/8, AdNeutralNick%8); |
- | |
170 | LCD_printfxy(0,2,"Roll%4i (%3i.%i)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll/8, AdNeutralRoll%8); |
- | |
171 | LCD_printfxy(0,3,"Gier%4i (%3i)",AdNeutralGier - AdWertGier, AdNeutralGier); |
- | |
172 | } |
- | |
173 | else |
164 | AccMenu = 0; |
174 | if((PlatinenVersion == 11) || (PlatinenVersion >= 20)) |
- | |
175 | { |
- | |
176 | LCD_printfxy(0,1,"Nick %4i (%3i.%x)",AdWertNick - AdNeutralNick/8, AdNeutralNick/16, (AdNeutralNick%16)/2); |
- | |
177 | LCD_printfxy(0,2,"Roll %4i (%3i.%x)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll/16, (AdNeutralRoll%16)/2); |
- | |
178 | LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralGier - AdWertGier, AdNeutralGier/2); |
- | |
179 | } |
- | |
180 | else |
- | |
181 | if(PlatinenVersion == 13) |
- | |
182 | { |
- | |
183 | LCD_printfxy(0,1,"Nick %4i (%3i)(%3i)",AdWertNick - AdNeutralNick/8, AdNeutralNick/16,AnalogOffsetNick); |
- | |
184 | LCD_printfxy(0,2,"Roll %4i (%3i)(%3i)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll/16,AnalogOffsetRoll); |
- | |
185 | LCD_printfxy(0,3,"Yaw %4i (%3i)(%3i)",AdNeutralGier - AdWertGier, AdNeutralGier/2,AnalogOffsetGier); |
- | |
186 | } |
- | |
187 | */ |
- | |
188 | break; |
165 | break; |
189 | case 6: |
166 | case 6: |
- | 167 | switch(AccMenu) |
|
- | 168 | { |
|
- | 169 | case 0: |
|
190 | LCD_printfxy(0,0,"ACC - Sensor"); |
170 | LCD_printfxy(0,0,"ACC - Sensor"); |
191 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdWertAccNick,NeutralAccX); |
171 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdWertAccNick,NeutralAccX); |
192 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdWertAccRoll,NeutralAccY); |
172 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdWertAccRoll,NeutralAccY); |
193 | LCD_printfxy(0,3,"Z %4i (%3i)",AdWertAccHoch,(int)NeutralAccZ); |
173 | LCD_printfxy(0,3,"Z %4i (%3i)(cal)",AdWertAccHoch,(int)NeutralAccZ); |
- | 174 | if(RemoteKeys & KEY4) AccMenu++; |
|
- | 175 | changed = 0; |
|
- | 176 | break; |
|
- | 177 | case 1: |
|
- | 178 | LCD_printfxy(0,0,"Calibration:"); |
|
- | 179 | LCD_printfxy(0,1,"ACC: N:%3i R:%3i ",NeutralAccY,NeutralAccX); |
|
- | 180 | if(ChannelNick || ChannelRoll) LCD_printfxy(0,2,"Stick: (%i/%i) !! ",ChannelNick,ChannelRoll); |
|
- | 181 | if((FC_StatusFlags & FC_STATUS_MOTOR_RUN) && ((NC_GPS_ModeCharacter == ' ') || (NC_GPS_ModeCharacter == '/') || (NC_GPS_ModeCharacter == '-'))) |
|
- | 182 | { |
|
- | 183 | DisableMenu = 1; |
|
- | 184 | if(!EE_Parameter.Driftkomp) EE_Parameter.Driftkomp = 6; // enables the Gyro-Drift compensation to make sure that a litlte calibration error won't effect the attitude |
|
- | 185 | if(RemoteKeys & KEY1) { NeutralAccY--; changed = 1;} |
|
- | 186 | if(RemoteKeys & KEY2) { NeutralAccY++; changed = 1;} |
|
- | 187 | if(RemoteKeys & KEY3) { NeutralAccX--; changed = 1;} |
|
- | 188 | if(RemoteKeys & KEY4) { NeutralAccX++; changed = 1;} |
|
- | 189 | LCD_printfxy(13,0,"on "); |
|
- | 190 | if(changed) LCD_printfxy(0,3,"land to safe ") |
|
- | 191 | else LCD_printfxy(0,3,"use keys to trim ACC") |
|
- | 192 | } |
|
- | 193 | else |
|
- | 194 | { |
|
- | 195 | LCD_printfxy(13,0,"off"); |
|
- | 196 | DisableMenu = 0; |
|
- | 197 | if(!(FC_StatusFlags & FC_STATUS_MOTOR_RUN) && changed) |
|
- | 198 | { |
|
- | 199 | LCD_printfxy(0,3,"Safe? (yes)(no)"); |
|
- | 200 | if(RemoteKeys & KEY3) { StoreNeutralToEeprom(); AccMenu = 0;} |
|
- | 201 | if(RemoteKeys & KEY4) { changed = 0;} |
|
- | 202 | } |
|
- | 203 | else LCD_printfxy(0,3,"Fly with GPS off"); |
|
- | 204 | } |
|
- | 205 | break; |
|
- | 206 | default: AccMenu = 0; break; |
|
- | 207 | } |
|
194 | break; |
208 | break; |
195 | case 7: |
209 | case 7: |
196 | LCD_printfxy(0,0,"Voltage: %3i.%1iV",UBat/10, UBat%10); |
210 | LCD_printfxy(0,0,"Voltage: %3i.%1iV",UBat/10, UBat%10); |
197 | LCD_printfxy(0,1,"Current: %3i.%1iA",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
211 | LCD_printfxy(0,1,"Current: %3i.%1iA",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
198 | LCD_printfxy(0,2,"Power: %4iW",Capacity.ActualPower); |
212 | LCD_printfxy(0,2,"Power: %4iW",Capacity.ActualPower); |
199 | LCD_printfxy(0,3,"Discharge: %5imAh", Capacity.UsedCapacity); |
213 | LCD_printfxy(0,3,"Discharge: %5imAh", Capacity.UsedCapacity); |
- | 214 | AccMenu = 0; |
|
200 | break; |
215 | break; |
201 | case 8: |
216 | case 8: |
202 | LCD_printfxy(0,0,"Receiver"); |
217 | LCD_printfxy(0,0,"Receiver"); |
203 | LCD_printfxy(0,2,"RC-Quality: %4i", SenderOkay); |
218 | LCD_printfxy(0,2,"RC-Quality: %4i", SenderOkay); |
204 | LCD_printfxy(0,3,"RC-Channels:%4i", Channels-1); |
219 | LCD_printfxy(0,3,"RC-Channels:%4i", Channels-1); |