Rev 1919 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
#include "libfc.h"
#include "printf_P.h"
#include "main.h"
#include "spi.h"
#include "capacity.h"
#define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
#define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
#define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
#define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
void Hott_ClearLine(unsigned char line)
{
HoTT_printfxy(0,line," ");
}
void HoTT_Menu(void)
{
static unsigned char what;
switch(what++)
{
case 0: HoTT_printfxy(0,0,"%2i.%1iV ",UBat/10, UBat%10);
HoTT_printfxy(8,0,"%4imAh %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60);
break;
case 1:
HoTT_printfxy(0,1,"Dir:%3d%c",(int)(ErsatzKompass / GIER_GRAD_FAKTOR), 0x60);
if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
HoTT_printfxy_INV(10,1,"Alt:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
else HoTT_printfxy(10,1,"Alt: ---- ", (int16_t)(HoehenWert/100),VarioCharacter);
break;
case 2:
HoTT_printfxy(0,2,"I=%3i.%1iA %4iW ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower);
break;
case 3:
if(NaviDataOkay)
{
HoTT_printfxy(0,3,"Home:%3dm %3d%c", GPSInfo.HomeDistance/10, GPSInfo.HomeBearing, 0x60);
}
else
{
Hott_ClearLine(3);
}
break;
case 4:
if(NaviDataOkay)
{
HoTT_printfxy(0,4,"GPS:%2um/s Sat:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
switch (GPSInfo.SatFix)
{
case SATFIX_3D:
HoTT_printfxy(16,4," 3D ");
break;
case SATFIX_2D:
case SATFIX_NONE:
default:
HoTT_printfxy(16,4,"NoFix");
break;
}
if(GPSInfo.Flags & FLAG_DIFFSOLN)
{
HoTT_printfxy(16,4,"DGPS ");
}
}
else
{ //012345678901234567890
HoTT_printfxy(0,4,"No NaviCtrl! ");
}
break;
case 5:
HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC ", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,0x60);
break;
case 6:
if(RequiredMotors == 4) Hott_ClearLine(6);
else
if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,0x60)
else
if(RequiredMotors > 6) HoTT_printfxy(0,6,"%3i %3i %3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature,0x6D);
//HoTT_printfxy(0,6,"%2x:%c %2x:%c %c",Poti3,Poti3,Poti3+1,Poti3+1, 'A'+128);
break;
case 7: if(NC_ErrorCode) HoTT_printfxy(0,7,"ERROR: %2d ",NC_ErrorCode)
else HoTT_printfxy(0,7," www.MikroKopter.de ");
break;
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16: break;
/*
012345678901234567890
+++++++++++++++++++++
13,8V 1234mAh 12:30 0
Dir:180° Alt: 123m + 1
GPS: 10Sat DGPS PH CF 2
Home: 280° 123m 3
I=23A P=123W Max=123 4
BL1-4: 11 22 33 44°C 5
BL5-8: 55 66 77 88°C 6
No Error 7
+++++++++++++++++++++
*/
default: what = 0;
break;
}
}