21,6 → 21,12 |
#define HoTT_OBEN 125 |
#define HoTT_UNTEN 126 |
|
GPSPacket_t GPSPacket; |
VarioPacket_t VarioPacket; |
ASCIIPacket_t ASCIIPacket; |
ElectricAirPacket_t ElectricAirPacket; |
HoTTGeneral_t HoTTGeneral; |
|
const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
{ |
//0123456789123456 |
48,6 → 54,28 |
"GPS Fix lost \0" // 21 |
}; |
|
unsigned char MaxBlTempertaure = 0; |
unsigned char MinBlTempertaure = 0; |
unsigned char HottestBl = 0; |
|
void GetHottestBl(void) |
{ |
static unsigned char search = 0,tmp_max,tmp_min,who; |
if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
else |
if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
if(++search > MAX_MOTORS) |
{ |
search = 0; |
if(tmp_min != 255) MinBlTempertaure = tmp_min; else MinBlTempertaure = 0; |
MaxBlTempertaure = tmp_max; |
HottestBl = who; |
tmp_min = 255; |
tmp_max = 0; |
who = 0; |
} |
} |
|
//--------------------------------------------------------------- |
void Hott_ClearLine(unsigned char line) |
{ |
81,6 → 109,10 |
ptr = (unsigned char *) &ElectricAirPacket; |
max = sizeof(ElectricAirPacket); |
break; |
case HOTT_GENERAL_PACKET_ID: |
ptr = (unsigned char *) &HoTTGeneral; |
max = sizeof(HoTTGeneral); |
break; |
} |
z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
|
103,21 → 135,21 |
else |
if(WaypointTrimming > 0) tmp = 30000 + FromNC_AltitudeSpeed * 10; |
else tmp = 30000 - FromNC_AltitudeSpeed * 10; |
//tmp = 30000 + (int)(PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]) * 5; |
return(tmp); |
} |
|
|
//--------------------------------------------------------------- |
unsigned char HoTT_Telemety(unsigned char packet_request) |
{ |
static unsigned char search = 0,max,min,tmp_max,tmp_min; |
|
switch(packet_request) |
{ |
case HOTT_VARIO_PACKET_ID: |
VarioPacket.Altitude = HoehenWert/100 + 500; |
VarioPacket.m_sec = BuildHoTT_Vario(); |
GPSPacket.m_3sec = 120; |
GPSPacket.m_10sec = 120; |
VarioPacket.m_3sec = VarioPacket.m_sec; |
VarioPacket.m_10sec = VarioPacket.m_sec; |
if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
VarioPacket.WarnBeep = HoTT_Waring(); |
127,9 → 159,9 |
|
case HOTT_GPS_PACKET_ID: |
GPSPacket.Altitude = HoehenWert/100 + 500; |
// GPSPacket.Distance = GPSInfo.HomeDistance/10; |
// GPSPacket.Heading = GPSInfo.HomeBearing/2;//KompassValue/2; |
// GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; |
// GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
// GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
// GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
GPSPacket.m_sec = BuildHoTT_Vario(); |
GPSPacket.m_3sec = 120; |
GPSPacket.m_10sec = 0; |
138,26 → 170,19 |
return(sizeof(GPSPacket)); |
break; |
case HOTT_ELECTRIC_AIR_PACKET_ID: |
|
if(Motor[search].Temperature > tmp_max) tmp_max = Motor[search].Temperature; |
else |
if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
if(++search > MAX_MOTORS) |
{ |
search = 0; |
if(tmp_min != 255) min = tmp_min; else min = 0; |
max = tmp_max; |
tmp_min = 255; |
tmp_max = 0; |
} |
GetHottestBl(); |
ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
ElectricAirPacket.Battery1 = UBat; |
ElectricAirPacket.Battery2 = UBat; |
ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
ElectricAirPacket.m_sec = BuildHoTT_Vario(); |
ElectricAirPacket.m_3sec = 120; |
ElectricAirPacket.InputVoltage = UBat; |
ElectricAirPacket.Temperature1 = min + 20; |
ElectricAirPacket.Temperature2 = max + 20; |
ElectricAirPacket.Temperature1 = MinBlTempertaure + 20; |
ElectricAirPacket.Temperature2 = MaxBlTempertaure + 20; |
ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
ElectricAirPacket.WarnBeep = HoTT_Waring(); |
ElectricAirPacket.Current = Capacity.ActualCurrent; |
164,6 → 189,28 |
HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
return(sizeof(ElectricAirPacket)); |
break; |
case HOTT_GENERAL_PACKET_ID: |
GetHottestBl(); |
HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
HoTTGeneral.VoltageCell5 = GPSInfo.HomeDistance/20; |
if(UBat > BattLowVoltageWarning + 5) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 6)) * 3; |
else HoTTGeneral.FuelPercent = 0; |
HoTTGeneral.FuelCapacity = HoehenWert/100; ; |
HoTTGeneral.Altitude = HoehenWert/100 + 500; |
HoTTGeneral.Battery1 = UBat; |
HoTTGeneral.Battery2 = UBat; |
HoTTGeneral.m_sec = BuildHoTT_Vario(); |
HoTTGeneral.m_3sec = 120; |
HoTTGeneral.InputVoltage = UBat; |
HoTTGeneral.Temperature1 = MinBlTempertaure + 20; |
HoTTGeneral.Temperature2 = MaxBlTempertaure + 20; |
HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
HoTTGeneral.WarnBeep = HoTT_Waring(); |
HoTTGeneral.Current = Capacity.ActualCurrent; |
HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
return(sizeof(HoTTGeneral)); |
break; |
default: return(0); |
} |
} |
222,7 → 269,7 |
else HoTT_printfxy(7,4,"3D"); |
break; |
default: |
HoTT_printfxy(7,4,"! "); |
HoTT_printfxy_BLINK(7,4,"!!"); |
break; |
} |
} |