Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1916 → Rev 1917

/trunk/hottmenu.c
0,0 → 1,117
#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;
}
}
 
 
 
 
/trunk/hottmenu.h
0,0 → 1,107
#ifndef _HOTTMENU_H
#define _HOTTMENU_H
 
extern unsigned char HottKeyboard,HoTT_RequestedSensor;
extern unsigned char HottUpdate(unsigned char key);
 
extern void CreateHoTT_Menu(void);
extern void LIBFC_HoTT_Putchar(char);
extern void LIBFC_HoTT_Putchar_INV(char); // print Invers
extern void LIBFC_HoTT_SetPos(unsigned char);
extern void LIBFC_HoTT_Clear(void);
extern void HoTT_Menu(void);
 
typedef struct
{
unsigned char StartByte; // 0x7C
unsigned char Packet_ID; // HOTT_ELECTRIC_AIR_PACKET_ID
unsigned char WarnBeep; // Anzahl der Töne 0..36
unsigned char VoltageCell1; // 208 = 4,16V (Voltage * 50 = Wert)
unsigned char VoltageCell2; // 209 = 4,18V
unsigned char VoltageCell3; //
unsigned char VoltageCell4; //
unsigned char VoltageCell5; //
unsigned char VoltageCell6; //
unsigned char VoltageCell7; //
unsigned char VoltageCell8; //
unsigned char VoltageCell9; //
unsigned char VoltageCell10; //
unsigned char VoltageCell11; //
unsigned char VoltageCell12; //
unsigned char VoltageCell13; //
unsigned char VoltageCell14; //
unsigned int Battery1; // 51 = 5,1V
unsigned int Battery2; // 51 = 5,1V
unsigned char Temperature1; // 44 = 24°C, 0 = -20°C
unsigned char Temperature2; // 44 = 24°C, 0 = -20°C
unsigned int Altitude;
unsigned int Current; // 1 = 0.1A
unsigned int InputVoltage; // 66 = 6,6V
unsigned int Capacity; // 1 = 10mAh
unsigned int m_sec; // 3000 = 0
unsigned int m_3sec; // 3000 = 0
unsigned char NullByte1; // 0x00
unsigned char NullByte2; // 0x00
unsigned char EndByte; // 0x7D
} ElectricAirPacket_t;
 
typedef struct
{
unsigned char StartByte; // 0x7C
unsigned char Packet_ID; // 0x89 - Vario ID
unsigned char WarnBeep; // Anzahl der Töne 0..36
unsigned int Altitude; // 500 = 0m
unsigned int MaxAltitude; // 500 = 0m
unsigned int MinAltitude; // 500 = 0m
unsigned int m_sec; // 3000 = 0
unsigned int m_3sec; // 3000 = 0
unsigned int m_10sec; // 3000 = 0
unsigned char NullByte; // 0x00
unsigned char EndByte; // 0x7D
} VarioPacket_t;
 
typedef struct
{
unsigned char StartByte; // 0x7C
unsigned char Packet_ID; // 0x89 - Vario ID
unsigned char WarnBeep; // Anzahl der Töne 0..36
unsigned char Heading; // 1 = 2°
unsigned int Speed; // in km/h
unsigned char Lat_G;
unsigned char Lat_M;
unsigned char Lat_Sek1;
unsigned char Lat_Sek2;
unsigned char Lon_G;
unsigned char Lon_M;
unsigned char Lon_Sek1;
unsigned char Lon_Sek2;
unsigned int Distance; // 9000 = 0m
unsigned int Hoehe; // 500 = 0m
unsigned int Altitude; // 500 = 0m
unsigned int m_sec; // 3000 = 0
unsigned int m_3sec; // 3000 = 0
unsigned int m_10sec; // 3000 = 0
unsigned char NullByte; // 0x00
unsigned char NullByte1; // 0x00
unsigned char EndByte; // 0x7D
} GPSPacket_t;
 
typedef struct
{
unsigned char StartByte; // 0x7B
unsigned char Packet_ID; // 0x00
unsigned char WarnBeep; // Anzahl der Töne 0..36
char Text[8*21];
unsigned char EndByte; // 0x7D
} ASCIIPacket_t;
 
extern GPSPacket_t GPSPacket;
extern VarioPacket_t VarioPacket;
extern ASCIIPacket_t ASCIIPacket;
extern ElectricAirPacket_t ElectricAirPacket;
 
#define HOTT_VARIO_PACKET_ID 0x89
#define HOTT_GPS_PACKET_ID 0x8A
#define HOTT_ELECTRIC_AIR_PACKET_ID 0x8E
 
#endif
/trunk/libfc1284.a
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/main.c
309,6 → 309,7
{
static unsigned char second;
timer += 20; // 20 ms interval
if(EE_Parameter.Receiver == RECEIVER_HOTT) HoTT_Menu();
if(MissingMotor)
{
VersionInfo.HardwareError[1] |= FC_ERROR1_BL_MISSING;
/trunk/main.h
1,7 → 1,7
#ifndef _MAIN_H
#define _MAIN_H
 
//#define DEBUG // use to activate debug output to MK-Tool: use Debug(text);
#define DEBUG // use to activate debug output to MK-Tool: use Debug(text);
//#define ACT_S3D_SUMMENSIGNAL
//#define SWITCH_LEARNS_CAREFREE
//#define RECEIVER_SPEKTRUM_EXP
62,6 → 62,7
#include "capacity.h"
#include "eeprom.h"
#include "libfc.h"
#include "hottmenu.h"
#include "debug.h"
 
 
/trunk/makefile
5,11 → 5,11
F_CPU = 20000000
#-------------------------------------------------------------------
VERSION_MAJOR = 0
VERSION_MINOR = 84
VERSION_MINOR = 85
VERSION_PATCH = 0
VERSION_SERIAL_MAJOR = 11 # Serial Protocol
VERSION_SERIAL_MINOR = 0 # Serial Protocol
NC_SPI_COMPATIBLE = 19 # Navi-Kompatibilität
NC_SPI_COMPATIBLE = 21 # Navi-Kompatibilität
#-------------------------------------------------------------------
 
# get SVN revision
116,6 → 116,7
SRC = main.c uart.c timer0.c analog.c menu.c eeprom.c
SRC += twimaster.c rc.c fc.c GPS.c spi.c led.c Spektrum.c
SRC += mymath.c jetimenu.c capacity.c debug.c
SRC += hottmenu.c
 
##########################################################################################################
 
/trunk/version.txt
462,11 → 462,12
- LED-Schalter-Schwellwert von 10 auf 5 gesenkt
- Variable "JetiBeep" wird gelöscht, wenn an den Empfänger gesendet wurde
- wenn GPS deaktiviert ist, keinen Fehler bringen, wenn GPS fehlt. Auch dann nicht piepsen
- Empfangs-Piepen unterdrücken
- GPS-Sollwertverschiebung
- Empfangs-Piepen unterdrücken -> einstellbar
- MotorSmooth einstellbar
- Höhenregler: keine 'harte' IstWert-Übernahme bei Bewegen des Sticks in die Hoover-Position
- Coming Home mit Höhenvorgabe
- Coming Home als Failsafe