/beta/Code Redesign killagreg/eeprom.h |
---|
79,6 → 79,7 |
#define RECEIVER_SPEKTRUM_LOW_RES 3 |
#define RECEIVER_JETI 4 |
#define RECEIVER_ACT_DSL 5 |
#define RECEIVER_HOTT 6 |
#define RECEIVER_UNKNOWN 0xFF |
// defines for lookup ParamSet.ChannelAssignment |
/beta/Code Redesign killagreg/hottmenu.c |
---|
0,0 → 1,126 |
#include "libfc.h" |
#include "printf_P.h" |
#include "main.h" |
#include "analog.h" |
#include "spi.h" |
#include "fc.h" |
#include "eeprom.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(uint8_t line) |
{ |
HoTT_printfxy(0,line," "); |
} |
void HoTTMenu_Update(void) |
{ |
static uint8_t what; |
switch(what++) |
{ |
case 0: |
HoTT_printfxy(0,0,"%2i.%1iV ",UBat/10, UBat%10); |
HoTT_printfxy(8,0,"%4imAh %2i:%02i",Capacity.UsedCapacity,FlightSeconds/60,FlightSeconds%60); |
break; |
case 1: |
HoTT_printfxy(0,1,"Dir:%3d%c",(int16_t)(YawGyroHeading / GYRO_DEG_FACTOR), 0x60); |
if(ParamSet.Config0 & CFG0_AIRPRESS_SENSOR) |
{ |
HoTT_printfxy_INV(10,1,"Alt:%4im %c", (int16_t)(ReadingHeight/100),VarioCharacter) |
} |
else |
{ |
HoTT_printfxy(10,1,"Alt: ---- "); |
} |
break; |
case 2: |
HoTT_printfxy(0,2,"I=%3i.%1iA %4iW ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
break; |
case 3: |
if(NCDataOkay) |
{ |
HoTT_printfxy(0,3,"Home:%3dm %3d%c", GPSInfo.HomeDistance/10, GPSInfo.HomeBearing, 0x60); |
} |
else |
{ |
Hott_ClearLine(3); |
} |
break; |
case 4: |
if(NCDataOkay) |
{ |
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); |
break; |
case 7: if(NCErrorCode) HoTT_printfxy(0,7,"ERROR: %2d ",NCErrorCode) |
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; |
} |
} |
/beta/Code Redesign killagreg/hottmenu.h |
---|
0,0 → 1,99 |
#ifndef _HOTTMENU_H |
#define _HOTTMENU_H |
extern void HoTTMenu_Update(void); |
typedef struct |
{ |
uint8_t StartByte; // 0x7C |
uint8_t Packet_ID; // HOTT_ELECTRIC_AIR_PACKET_ID |
uint8_t WarnBeep; // Anzahl der Töne 0..36 |
uint8_t VoltageCell1; // 208 = 4,16V (Voltage * 50 = Wert) |
uint8_t VoltageCell2; // 209 = 4,18V |
uint8_t VoltageCell3; // |
uint8_t VoltageCell4; // |
uint8_t VoltageCell5; // |
uint8_t VoltageCell6; // |
uint8_t VoltageCell7; // |
uint8_t VoltageCell8; // |
uint8_t VoltageCell9; // |
uint8_t VoltageCell10; // |
uint8_t VoltageCell11; // |
uint8_t VoltageCell12; // |
uint8_t VoltageCell13; // |
uint8_t VoltageCell14; // |
uint16_t Battery1; // 51 = 5,1V |
uint16_t Battery2; // 51 = 5,1V |
uint8_t Temperature1; // 44 = 24°C, 0 = -20°C |
uint8_t Temperature2; // 44 = 24°C, 0 = -20°C |
uint16_t Altitude; |
uint16_t Current; // 1 = 0.1A |
uint16_t InputVoltage; // 66 = 6,6V |
uint16_t Capacity; // 1 = 10mAh |
uint16_t m_sec; // 3000 = 0 |
uint16_t m_3sec; // 3000 = 0 |
uint8_t NullByte1; // 0x00 |
uint8_t NullByte2; // 0x00 |
uint8_t EndByte; // 0x7D |
} ElectricAirPacket_t; |
typedef struct |
{ |
uint8_t StartByte; // 0x7C |
uint8_t Packet_ID; // 0x89 - Vario ID |
uint8_t WarnBeep; // Anzahl der Töne 0..36 |
uint16_t Altitude; // 500 = 0m |
uint16_t MaxAltitude; // 500 = 0m |
uint16_t MinAltitude; // 500 = 0m |
uint16_t m_sec; // 3000 = 0 |
uint16_t m_3sec; // 3000 = 0 |
uint16_t m_10sec; // 3000 = 0 |
uint8_t NullByte; // 0x00 |
uint8_t EndByte; // 0x7D |
} VarioPacket_t; |
typedef struct |
{ |
uint8_t StartByte; // 0x7C |
uint8_t Packet_ID; // 0x89 - Vario ID |
uint8_t WarnBeep; // Anzahl der Töne 0..36 |
uint8_t Heading; // 1 = 2° |
uint16_t Speed; // in km/h |
uint8_t Lat_G; |
uint8_t Lat_M; |
uint8_t Lat_Sek1; |
uint8_t Lat_Sek2; |
uint8_t Lon_G; |
uint8_t Lon_M; |
uint8_t Lon_Sek1; |
uint8_t Lon_Sek2; |
uint16_t Distance; // 9000 = 0m |
uint16_t Hoehe; // 500 = 0m |
uint16_t Altitude; // 500 = 0m |
uint16_t m_sec; // 3000 = 0 |
uint16_t m_3sec; // 3000 = 0 |
uint16_t m_10sec; // 3000 = 0 |
uint8_t NullByte; // 0x00 |
uint8_t NullByte1; // 0x00 |
uint8_t EndByte; // 0x7D |
} GPSPacket_t; |
typedef struct |
{ |
uint8_t StartByte; // 0x7B |
uint8_t Packet_ID; // 0x00 |
uint8_t WarnBeep; // Anzahl der Töne 0..36 |
uint8_t Text[8*21]; |
uint8_t 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 |
/beta/Code Redesign killagreg/libfc.h |
---|
16,6 → 16,12 |
extern void LIBFC_JetiBox_Putchar(char c); |
extern void LIBFC_JetiBox_SetPos(uint8_t index); |
extern void LIBFC_JetiBox_Clear(void); |
extern void LIBFC_HoTT_Putchar(char c); |
extern void LIBFC_HoTT_Putchar_INV(char c); // print Invers |
extern void LIBFC_HoTT_SetPos(uint8_t index); |
extern void LIBFC_HoTT_Clear(void); |
extern uint8_t LIBFC_GetCPUType(void); |
#endif //_LIBFC_H |
/beta/Code Redesign killagreg/libfc1284.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/beta/Code Redesign killagreg/main.c |
---|
307,11 → 307,10 |
if(CheckDelay(pollingtimer)) |
{ |
pollingtimer = SetDelay(100); |
pollingtimer = SetDelay(1); |
LIBFC_Polling(); |
} |
if(UpdateMotor && ADReady) // control interval |
{ |
UpdateMotor = 0; // reset Flag, is enabled every 2 ms by ISR of timer0 |
/beta/Code Redesign killagreg/makefile |
---|
5,12 → 5,12 |
F_CPU = 20000000 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 0 |
VERSION_MINOR = 84 |
VERSION_MINOR = 85 |
VERSION_PATCH = 0 |
VERSION_SERIAL_MAJOR = 11 # Serial Protocol Major Version |
VERSION_SERIAL_MINOR = 0 # Serial Protocol Minor Version |
NC_SPI_COMPATIBLE = 19 # SPI Protocol Version |
NC_SPI_COMPATIBLE = 20 # SPI Protocol Version |
#------------------------------------------------------------------- |
#OPTIONS |
132,6 → 132,7 |
# List C source files here. (C dependencies are automatically generated.) |
SRC = main.c uart0.c timer0.c timer2.c analog.c menu.c led.c |
SRC += twimaster.c rc.c fc.c eeprom.c mymath.c spektrum.c jetimenu.c capacity.c debug.c |
SRC += hottmenu.c |
ifeq ($(EXT), MK3MAG) |
SRC += mk3mag.c |