Subversion Repositories FlightCtrl

Rev

Rev 1917 | Rev 1920 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1917 Rev 1919
Line 8... Line 8...
8
#define HoTT_printf(format, args...)        {  _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
8
#define HoTT_printf(format, args...)        {  _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
Line 9... Line 9...
9
 
9
 
10
#define HoTT_printfxy_INV(x,y,format, args...)  { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
10
#define HoTT_printfxy_INV(x,y,format, args...)  { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
Line -... Line 11...
-
 
11
#define HoTT_printf_INV(format, args...)        {  _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
-
 
12
 
Line -... Line 13...
-
 
13
#define VOICE_MINIMALE_EINGANSSPANNUNG    16
-
 
14
#define VOICE_BEEP                         5
11
#define HoTT_printf_INV(format, args...)        {  _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
15
 
12
 
16
 
13
 
17
//---------------------------------------------------------------
14
void Hott_ClearLine(unsigned char line)
18
void Hott_ClearLine(unsigned char line)
-
 
19
{
Line -... Line 20...
-
 
20
 HoTT_printfxy(0,line,"                     ");
-
 
21
}
-
 
22
//---------------------------------------------------------------
-
 
23
 
-
 
24
unsigned char HoTT_Waring(void)
-
 
25
{
-
 
26
  if(FC_StatusFlags & FC_STATUS_LOWBAT) return(VOICE_MINIMALE_EINGANSSPANNUNG);
-
 
27
  if(MotorenEin && NC_ErrorCode)                return(VOICE_BEEP);
-
 
28
  return(0);
-
 
29
}
-
 
30
 
-
 
31
//---------------------------------------------------------------
-
 
32
unsigned char HoTT_Telemety(unsigned char packet_request)
-
 
33
{
-
 
34
 switch(packet_request)
-
 
35
 {
-
 
36
  case HOTT_VARIO_PACKET_ID:
-
 
37
                VarioPacket.Altitude = HoehenWert + 500;  
-
 
38
                if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude;
-
 
39
                if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude;            
-
 
40
                VarioPacket.WarnBeep = HoTT_Waring();
-
 
41
                HoTT_DataPointer = (unsigned char *) &VarioPacket;
-
 
42
                return(sizeof(VarioPacket));
-
 
43
                break;
-
 
44
  case HOTT_GPS_PACKET_ID:
-
 
45
                GPSPacket.Altitude = HoehenWert  + 500 + 30;  
-
 
46
                GPSPacket.Hoehe  = GPSPacket.Altitude;
-
 
47
                GPSPacket.Distance = GPSInfo.HomeDistance/10;
-
 
48
                GPSPacket.Heading++;
-
 
49
                GPSPacket.WarnBeep = HoTT_Waring();
-
 
50
                HoTT_DataPointer = (unsigned char *) &GPSPacket;
-
 
51
                return(sizeof(GPSPacket));  
-
 
52
                break;
-
 
53
  case HOTT_ELECTRIC_AIR_PACKET_ID:
-
 
54
                ElectricAirPacket.Altitude++;
-
 
55
                ElectricAirPacket.Battery1++;
-
 
56
                ElectricAirPacket.Capacity++;
-
 
57
                ElectricAirPacket.WarnBeep = HoTT_Waring();
-
 
58
                HoTT_DataPointer = (unsigned char *) &ElectricAirPacket;
-
 
59
                return(sizeof(ElectricAirPacket));
-
 
60
                break;
-
 
61
  default: return(0);
15
{
62
  }            
16
 HoTT_printfxy(0,line,"                     ");
63
}
17
}
64
 
18
 
65
//---------------------------------------------------------------
19
void HoTT_Menu(void)
66
void HoTT_Menu(void)
-
 
67
{
20
{
68
 static unsigned char what;
-
 
69
 switch(what++)
21
 static unsigned char what;
70
  {
22
 switch(what++)
71
        case 0:  
23
  {
72
                        HoTT_printfxy(0,0,"%2i.%1iV   ",UBat/10, UBat%10);
24
        case 0:  HoTT_printfxy(0,0,"%2i.%1iV   ",UBat/10, UBat%10);
73
                if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy_INV(6,0,"!!",UBat/10, UBat%10);
25
                        HoTT_printfxy(8,0,"%4imAh %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60);
74
                        HoTT_printfxy(8,0,"%4imAh %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60);
26
                        break;
75
                        break;
27
        case 1:  
76
        case 1:  
28
                        HoTT_printfxy(0,1,"Dir:%3d%c",(int)(ErsatzKompass / GIER_GRAD_FAKTOR), 0x60);
77
                        HoTT_printfxy(0,1,"DIR:%3d%c",(int)(ErsatzKompass / GIER_GRAD_FAKTOR), 0x60);
29
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
78
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
30
                                HoTT_printfxy_INV(10,1,"Alt:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
79
                                HoTT_printfxy_INV(10,1,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
31
            else HoTT_printfxy(10,1,"Alt: ----    ", (int16_t)(HoehenWert/100),VarioCharacter);
80
            else HoTT_printfxy(10,1,"ALT: ----    ", (int16_t)(HoehenWert/100),VarioCharacter);
32
            break;
81
            break;
Line 44... Line 93...
44
                        }
93
                        }
45
                        break;
94
                        break;
46
        case 4:  
95
        case 4:  
47
                        if(NaviDataOkay)
96
                        if(NaviDataOkay)
48
                        {
97
                        {
49
                                HoTT_printfxy(0,4,"GPS:%2um/s Sat:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
98
                                HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
50
                                switch (GPSInfo.SatFix)
99
                                switch (GPSInfo.SatFix)
51
                                {
100
                                {
52
                                        case SATFIX_3D:
101
                                        case SATFIX_3D:
53
                                                HoTT_printfxy(16,4,"  3D ");
102
                                                HoTT_printfxy(16,4,"  3D ");
54
                                                break;
103
                                                break;
Line 55... Line 104...
55
               
104
               
56
                                        case SATFIX_2D:
105
                                        case SATFIX_2D:
57
                                        case SATFIX_NONE:
106
                                        case SATFIX_NONE:
58
                                        default:
107
                                        default:
59
                                                HoTT_printfxy(16,4,"NoFix");
108
                                                HoTT_printfxy(16,4,"NOFIX");
60
                                                break;
109
                                                break;
61
                                }      
110
                                }      
62
                                if(GPSInfo.Flags & FLAG_DIFFSOLN)
111
                                if(GPSInfo.Flags & FLAG_DIFFSOLN)
63
                                {
112
                                {
Line 76... Line 125...
76
                    if(RequiredMotors == 4) Hott_ClearLine(6);
125
                    if(RequiredMotors == 4) Hott_ClearLine(6);
77
                                else
126
                                else
78
                                if(RequiredMotors == 6)  HoTT_printfxy(0,6,"%3i %3i%cC         ", Motor[4].Temperature, Motor[5].Temperature,0x60)
127
                                if(RequiredMotors == 6)  HoTT_printfxy(0,6,"%3i %3i%cC         ", Motor[4].Temperature, Motor[5].Temperature,0x60)
79
                                else
128
                                else
80
                                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);
129
                                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);
81
//HoTT_printfxy(0,6,"%2x:%c %2x:%c %c",Poti3,Poti3,Poti3+1,Poti3+1, 'A'+128);
130
//HoTT_printfxy(0,6,"%2x:%c %c %c %c %c %c %c %c ",Parameter_UserParam1,Parameter_UserParam1,Parameter_UserParam1+1,Parameter_UserParam1+2,Parameter_UserParam1+3,Parameter_UserParam1+4,Parameter_UserParam1+5,Parameter_UserParam1+6 ,Parameter_UserParam1+7 ,Parameter_UserParam1+8);
82
                        break;
131
                        break;
83
        case 7: if(NC_ErrorCode) HoTT_printfxy(0,7,"ERROR: %2d ",NC_ErrorCode)
132
        case 7: if(NC_ErrorCode) {Hott_ClearLine(7); HoTT_printfxy_INV(3,7,"ERROR: %2d ",NC_ErrorCode);}
84
                        else HoTT_printfxy(0,7," www.MikroKopter.de ");
133
                        else HoTT_printfxy(0,7," www.MikroKopter.de ");
85
                        break;
134
                        break;
-
 
135
 
86
        case 8:
136
        case 8: ASCIIPacket.WarnBeep = HoTT_Waring();
-
 
137
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
87
        case 9:
138
        case 9:
88
        case 10:
139
        case 10:
89
        case 11:
140
        case 11:
90
        case 12:
141
        case 12:
91
        case 13:
142
        case 13:
92
        case 14:
143
        case 14:  
93
        case 15:
144
        case 15:  
94
        case 16:  break;
145
        case 16:  
-
 
146
                                break;
-
 
147
 
Line 95... Line 148...
95
 
148
 
96
/*
149
/*
97
012345678901234567890
150
012345678901234567890
98
+++++++++++++++++++++
151
+++++++++++++++++++++