0,0 → 1,580 |
/*#######################################################################################*/ |
/* !!! THIS IS NOT FREE SOFTWARE !!! */ |
/*#######################################################################################*/ |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Copyright (c) 2008 Ingo Busker, Holger Buss |
// + Nur für den privaten Gebrauch / NON-COMMERCIAL USE ONLY |
// + FOR NON COMMERCIAL USE ONLY |
// + www.MikroKopter.com |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
// + bzgl. der Nutzungsbedingungen aufzunehmen. |
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
// + Verkauf von Luftbildaufnahmen, usw. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
// + eindeutig als Ursprung verlinkt werden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
// + Benutzung auf eigene Gefahr |
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Portierung oder Nutzung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
// + mit unserer Zustimmung zulässig |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
// + this list of conditions and the following disclaimer. |
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
// + from this software without specific prior written permission. |
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permitted |
// + for non-commercial use (directly or indirectly) |
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
// + with our written permission |
// + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
// + clearly linked as origin |
// + * porting the sources to other systems or using the software on other systems (except hardware from www.mikrokopter.de) is not allowed |
// |
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// + POSSIBILITY OF SUCH DAMAGE. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#include <stdlib.h> |
#include "91x_lib.h" |
#include "main.h" |
#include "led.h" |
#include "ubx.h" |
#include "GPS.h" |
#include "timer1.h" |
#include "compass.h" |
#include "spi_slave.h" |
#include "menu.h" |
#include "uart1.h" |
#include "ncmag.h" |
#include "logging.h" |
#include "settings.h" |
#include "sdc.h" |
|
u8 DispPtr = 0; |
s8 DisplayBuff[DISPLAYBUFFSIZE]; |
|
|
u8 MenuItem = 0; |
u8 MaxMenuItem = 27; |
|
void Menu_Putchar(char c) |
{ |
if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
} |
|
void Menu_Clear(void) |
{ |
u8 i; |
for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
} |
|
// Display with 20 characters in 4 lines |
void Menu_Update(u8 Keys) |
{ |
s32 i1,i2; |
u8 sign; |
|
if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
Menu_Clear(); |
// print menu item number in the upper right corner |
if(MenuItem < 10) |
{ |
LCD_printfxy(17,0,"[%i]",MenuItem); |
} |
else // Menuitem >= 10 |
{ |
LCD_printfxy(16,0,"[%i]",MenuItem); |
} |
|
switch(MenuItem) |
{ |
// Version Info |
case 0: |
LCD_printfxy(0,0,"++ Navi-Ctrl ++"); |
LCD_printfxy(0,1,"HW V%d.%d SW V%d.%02d%c", UART_VersionInfo.HWMajor/10, UART_VersionInfo.HWMajor%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH); |
if(FC.StatusFlags3 & FC_STATUS3_REDUNDANCE_AKTIVE) LCD_printfxy(19,1,"R"); |
if(ErrorCode) |
{ |
LCD_printfxy(0,2,"Error: %d",ErrorCode); |
LCD_printfxy(0,3,"%s",ErrorMSG); |
} |
else |
{ |
LCD_printfxy(0,2,"%s",ErrorMSG); |
LCD_printfxy(0,3,"(c) HiSystems GmbH"); |
} |
if(FC.StatusFlags3 & FC_STATUS3_BOAT) LCD_printfxy(16,2,"BOAT"); |
break; |
case 1: |
if (GPSData.Status == INVALID) |
{ |
LCD_printfxy(0,0,"No GPS data"); |
LCD_printfxy(0,1,"Lon: "); |
LCD_printfxy(0,2,"Lat: "); |
LCD_printfxy(0,3,"Alt: "); |
} |
else // newdata or processed |
{ |
LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
switch (GPSData.SatFix) |
{ |
case SATFIX_NONE: |
LCD_printfxy(7,0,"NoFix"); |
break; |
case SATFIX_2D: |
LCD_printfxy(7,0,"2DFix"); |
break; |
case SATFIX_3D: |
LCD_printfxy(7,0,"3DFix"); |
break; |
default: |
LCD_printfxy(7,0,"??Fix"); |
break; |
} |
if(GPSData.Flags & FLAG_DIFFSOLN) |
{ |
LCD_printfxy(12,0,"/DGPS"); |
} |
else |
{ |
LCD_printfxy(12,0," "); |
} |
|
if(GPSData.Position.Longitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(GPSData.Position.Longitude)/10000000L; |
i2 = abs(GPSData.Position.Longitude)%10000000L; |
LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
if(GPSData.Position.Latitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(GPSData.Position.Latitude)/10000000L; |
i2 = abs(GPSData.Position.Latitude)%10000000L; |
LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
if(GPSData.Position.Altitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(GPSData.Position.Altitude)/1000L; |
i2 = abs(GPSData.Position.Altitude)%1000L; |
LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m", sign, i1, i2); |
} |
break; |
case 2: |
if (GPSData.Status == INVALID) |
{ |
LCD_printfxy(0,0,"No GPS data"); |
LCD_printfxy(0,1,"Speed N: "); |
LCD_printfxy(0,2,"Speed E: "); |
LCD_printfxy(0,3,"Speed T: "); |
} |
else // newdata or processed |
{ |
LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
switch (GPSData.SatFix) |
{ |
case SATFIX_NONE: |
LCD_printfxy(7,0,"NoFix"); |
break; |
case SATFIX_2D: |
LCD_printfxy(7,0,"2DFix"); |
break; |
case SATFIX_3D: |
LCD_printfxy(7,0,"3DFix"); |
break; |
default: |
LCD_printfxy(7,0,"??Fix"); |
break; |
} |
if(GPSData.Flags & FLAG_DIFFSOLN) |
{ |
LCD_printfxy(12,0,"/DGPS"); |
} |
else |
{ |
LCD_printfxy(12,0," "); |
} |
|
LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
} |
break; |
case 3: |
LCD_printfxy(0,0,"GPS UTC Time"); |
if (!SystemTime.Valid) |
{ |
LCD_printfxy(0,1," "); |
LCD_printfxy(0,2," No time data! "); |
LCD_printfxy(0,3," "); |
} |
else // newdata or processed |
{ |
LCD_printfxy(0,1," "); |
LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
} |
break; |
case 4: // Navi Params 1 from FC |
LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
break; |
case 5: // Navi Params 2 from FC |
LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
LCD_printfxy(0,1,"WP_Radius: %3im",MaxWP_Radius_in_m); |
LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
LCD_printfxy(0,3,"AccComp: %3i", Parameter.NaviSpeedCompensation); |
break; |
case 6: // Navi Params 3 from FC |
LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
break; |
case 7: // Max Ranges |
LCD_printfxy(0,0,"Maximum flying "); |
LCD_printfxy(0,1,"Range: %4im ", AbsoluteFlyingRange_m); |
LCD_printfxy(0,2,"Descend: %4im ", AutoDescendRange_m); |
LCD_printfxy(0,3,"Altitude:%4im ", AbsoluteFlyingAltitude); |
if(!AbsoluteFlyingRange_m) LCD_printfxy(9,1,"disabled"); |
if(!AutoDescendRange_m) LCD_printfxy(9,2,"disabled"); |
if(!AbsoluteFlyingAltitude) LCD_printfxy(9,3,"disabled"); |
break; |
case 8: |
LCD_printfxy(0,0,"Home Position"); |
if(NaviData.HomePosition.Status == INVALID) |
{ |
LCD_printfxy(0,1," "); |
LCD_printfxy(0,2," Is not set. "); |
LCD_printfxy(0,3," "); |
} |
else |
{ |
if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
LCD_printfxy(0,3,"Alt:%c%04ld.%1dm",sign, i1, i2/1000); |
switch(Parameter.HomeYawMode) |
{ |
case NO_CHANGE: LCD_printfxy(17,3,"(-)"); break; |
case FRONT_TO_HOME: LCD_printfxy(17,3,"(F)"); break; |
case REAR_TO_HOME: LCD_printfxy(17,3,"(R)"); break; |
case LIKE_AT_START: LCD_printfxy(17,3,"(S)"); break; |
} |
} |
break; |
case 9: |
LCD_printfxy(0,0,"Target Position"); |
if(NaviData.TargetPosition.Status == INVALID) |
{ |
LCD_printfxy(0,1," "); |
LCD_printfxy(0,2," Is not set. "); |
LCD_printfxy(0,3," "); |
} |
else |
{ |
if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
LCD_printfxy(0,3,"Alt:%c%04ld.%03ldm",sign, i1, i2); |
} |
break; |
case 10: // RC stick controls from FC |
LCD_printfxy(0,0,"RC-Sticks" ); |
LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
LCD_printfxy(0,3,"RC-Level: %3i", FC.RC_Quality); // Remote Control Level from FC |
break; |
case 11: // RC poti controls from FC |
LCD_printfxy(0,0,"RC-Potis 1" ); |
LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
break; |
case 12: // RC poti controls from FC |
LCD_printfxy(0,0,"RC-Potis 2" ); |
LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
break; |
case 13: // attitude from FC |
if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(FromFlightCtrl.AngleNick)/10; |
i2 = abs(FromFlightCtrl.AngleNick)%10; |
LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(FromFlightCtrl.AngleRoll)/10; |
i2 = abs(FromFlightCtrl.AngleRoll)%10; |
LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
if(FromFlightCtrl.AccNick < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(FromFlightCtrl.AccNick)/10; |
i2 = abs(FromFlightCtrl.AccNick)%10; |
LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
if(FromFlightCtrl.AccRoll < 0) sign = '-'; |
else sign = '+'; |
i1 = abs(FromFlightCtrl.AccRoll)/10; |
i2 = abs(FromFlightCtrl.AccRoll)%10; |
LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
break; |
case 14: // gyros from FC |
LCD_printfxy(0,0,"GyroNick: %4i", FromFlightCtrl.GyroNick); |
LCD_printfxy(0,1,"GyroRoll: %4i", FromFlightCtrl.GyroRoll); |
LCD_printfxy(0,2,"GyroYaw: %4i", FromFlightCtrl.GyroYaw); |
if(FC_is_Calibrated) LCD_printfxy(0,3,"Calibrated ") |
else LCD_printfxy(0,3,"not calibrated"); |
break; |
case 15: |
LCD_printfxy(0,0,"Compass: %3i", FromFlightCtrl.GyroHeading / 10); |
LCD_printfxy(0,1,"Man.-Offset:%3i", FC.FromFC_CompassOffset / 10); |
if(FC.FromFC_DisableDeclination) |
{ |
LCD_printfxy(0,2,"Mag.Declinat.:disabl"); |
} |
else |
{ |
if(GeoMagDec < 0) sign = '-'; |
else sign = '+'; |
LCD_printfxy(0,2,"Mag.Declinat.:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
} |
LCD_printfxy(0,3,"True Compass: %3i", GyroCompassCorrected/10); |
break; |
case 16: // User Parameter |
LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
break; |
case 17: // User Parameter |
LCD_printfxy(0,0,"SD-Card Logs"); |
if(SDCardInfo.Valid == 1) |
{ |
LCD_printfxy(0,1,"GPX:%4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval); |
LCD_printfxy(0,2,"KML:%4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval); |
} |
else |
LCD_printfxy(0,1,"no card in slot "); |
break; |
case 18: // magnetic field |
if(Compass_CalState) |
{ |
LCD_printfxy(0,0,"Calibration:"); |
LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
LCD_printfxy(9,3,"(ESC)(NEXT)"); |
switch(Compass_CalState) |
{ |
case 1: |
case 3: |
LCD_printfxy(7,1,"pause"); |
break; |
|
case 2: |
LCD_printfxy(7,1,"horizontal"); |
break; |
|
case 4: |
LCD_printfxy(7,1,"vertical"); |
break; |
|
case 5: |
LCD_printfxy(7,1,"data saved"); |
LCD_printfxy(8,3," (END) "); |
break; |
|
default: |
break; |
} |
} |
else |
{ |
if(GeoMagDec < 0) sign = '-'; |
else sign = '+'; |
LCD_printfxy(0,0,"Magnetic Field"); |
LCD_printfxy(0,1,"X:%5i",MagVector.X); |
LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
LCD_printfxy(8,1,"Field:%3i",EarthMagneticField/5); |
if(Compass_I2CPort == NCMAG_PORT_EXTERN) LCD_printfxy(11,2,"Extern") |
else LCD_printfxy(11,2,"Intern"); |
// LCD_printfxy(8,2,"Dec:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
// LCD_printfxy(8,3,"Inc:%2i", EarthMagneticInclination); |
LCD_printfxy(15,3,"(CAL)"); |
} |
if(Keys & KEY4) // next step |
{ |
if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
else Compass_SetCalState(0); |
} |
if(Keys & KEY3)Compass_SetCalState(0); // cancel |
break; |
case 19: |
if(GeoMagDec < 0) sign = '-'; |
else sign = '+'; |
LCD_printfxy(0,0,"Magnetic Field"); |
LCD_printfxy(0,1,"Field:%3i (Percent)",EarthMagneticField/5); |
LCD_printfxy(0,2,"Declination:%c%i.%1i ", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
LCD_printfxy(0,3,"Inclination:%2i (%2i)", EarthMagneticInclination, EarthMagneticInclinationTheoretic); |
break; |
case 20: |
LCD_printfxy(0,0,"SD-Setting "); |
LCD_printfxy(0,2,"WP-Dynamic:%4i ",WaypointAcceleration); |
break; |
case 21: |
LCD_printfxy(0,0,"CPU Processing "); |
LCD_printfxy(0,2,"GPS-Data: %2i.%iHz ",FreqNewGpsDataIn5Sec/10, FreqNewGpsDataIn5Sec%10); |
LCD_printfxy(0,3,"GPS-Update:%2i.%iHz ",FreqGpsProcessedIn5Sec/10, FreqGpsProcessedIn5Sec%10); |
if(FreqNewGpsDataIn5Sec >= 48 && FreqNewGpsDataIn5Sec <= 52) LCD_printfxy(18,2,"OK") else LCD_printfxy(18,2,"!!"); |
if(FreqGpsProcessedIn5Sec >= 350) LCD_printfxy(18,3,"OK") else LCD_printfxy(18,3,"!!"); |
break; |
case 22: |
LCD_printfxy(0,0,"BL Current" ); |
LCD_printfxy(11,3,"(in 0.1A)" ); |
for(i1 = 0; i1 < 3; i1++) |
{ |
LCD_printfxy(0,i1+1,"%3d %3d %3d %3d ",BL3_Current(i1*4),BL3_Current(i1*4+1),BL3_Current(i1*4+2),BL3_Current(i1*4+3)); |
if(Motor[4 + i1 * 4].State == 0) break; |
} |
break; |
|
case 23: |
LCD_printfxy(0,0,"Ext. Compass" ); |
if(Compass_I2CPort == NCMAG_PORT_EXTERN) |
{ |
u8 tmp; |
LCD_printfxy(0,1,"ACC X Y Z"); |
LCD_printfxy(0,2," %5d %5d %5d", AccVector.X/40, AccVector.Y/40, AccVector.Z/40); |
tmp = NCMAG_GetOrientationFromAcc(); |
LCD_printfxy(0,3,"Orientat.: "); |
if(!tmp) LCD_printfxy(11,3,"??") else LCD_printfxy(11,3,"%2d",tmp); |
LCD_printfxy(15,3,"(%d)",NCMAG_Orientation); |
} |
else |
{ |
LCD_printfxy(0,1,"Not connected"); |
} |
break; |
|
case 24: |
{ |
static u8 index = 1; |
if(Keys & KEY3) // next step |
{ |
if(index < ToFC_MaxWpListIndex) index++; |
else index = 1; |
} |
if(Keys & KEY4) FromFC_LoadWP_List = index; |
LCD_printfxy(0,0,"Load WPL (fix)" ); |
LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
// 12345678901234567890 |
LCD_printfxy(0,2,"Points Index "); |
LCD_printfxy(0,3," %3d %3d LOAD", PointList_GetCount(), index); |
} |
break; |
case 25: |
{ |
static u8 index = 1; |
if(Keys & KEY3) |
{ |
if(index < ToFC_MaxWpListIndex) index++; |
else index = 1; |
} |
LCD_printfxy(0,0,"Load WPL (Rel)" ); |
LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
// 12345678901234567890 |
LCD_printfxy(0,2,"Points Index "); |
if(GPSData.SatFix == SATFIX_3D) |
{ |
LCD_printfxy(0,3," %3d %3d LOAD", PointList_GetCount(), index); |
if(Keys & KEY4) FromFC_LoadWP_List = index | 0x80; |
} |
else LCD_printfxy(0,3," No Satfix ! ", index); |
|
} |
break; |
case 26: |
{ |
static u8 index = 1; |
if(Keys & KEY3) |
{ |
if(index < ToFC_MaxWpListIndex) index++; |
else index = 1; |
} |
if(Keys & KEY4) FromFC_Load_SinglePoint = index; |
LCD_printfxy(0,0,"Load Point" ); |
LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
// 12345678901234567890 |
// LCD_printfxy(0,2,"Points Index "); |
LCD_printfxy(0,3,"Number: %3d (LOAD)", index); |
} |
break; |
case 27: |
{ |
static u8 index = 1; |
if(Keys & KEY3) |
{ |
if(index < ToFC_MaxWpListIndex) index++; |
else index = 1; |
} |
LCD_printfxy(0,0,"Save Point" ); |
LCD_printfxy(0,1,"Alt: %3dm", NaviData.Altimeter/20); |
// 12345678901234567890 |
LCD_printfxy(0,2,"Dir: %3d ", CompassSetpointCorrected/10); |
if(GPSData.SatFix == SATFIX_3D) |
{ |
LCD_printfxy(0,3,"Number: %3d (SAVE)", index); |
if(Keys & KEY4) FromFC_Save_SinglePoint = index; |
} |
else LCD_printfxy(0,3," No Satfix ! ", index); |
} |
break; |
default: |
//MaxMenuItem = MenuItem - 1; |
MenuItem = 0; |
break; |
} |
} |