Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1793 → Rev 1799

/branches/v0.82a MartinW_Jeti+/Spektrum.c
15,6 → 15,7
#endif
//--------------------------------------------------------------//
//--------------------------------------------------------------//
 
/*
void SpektrumBinding(void)
{
75,6 → 76,7
void SpektrumUartInit(void)
//############################################################################
{
/* MartinW Codesize red
// -- Start of USART1 initialisation for Spekturm seriell-mode
// USART1 Control and Status Register A, B, C and baud rate register
uint8_t sreg = SREG;
128,6 → 130,7
// restore global interrupt flags
SREG = sreg;
*/ //MartinW Codesize red
return;
}
 
210,6 → 213,8
//############################################################################
void SpektrumParser(unsigned char c)
{
/* //MartinW Codesize red
 
static unsigned char Sync=0, FrameCnt=0, ByteHigh=0, ReSync=1, Frame2=0;
unsigned int Channel, index = 0;
signed int signal = 0, tmp;
404,4 → 409,5
SpektrumTimer = MIN_FRAMEGAP;
}
}
*/ //MartinW Codesize red
}
/branches/v0.82a MartinW_Jeti+/fc.c
57,6 → 57,21
#include "mymath.h"
#include "isqrt.h"
 
//MartinW; added vars
unsigned char loop1, loop2, loop3;
unsigned char settingdest = 5;
int keynumber=-7;
 
unsigned short CurrentOffset = 0;///
 
unsigned char pos1, pos2, pos3, pos4=0;
unsigned char Motors0,Motors1,Motors2,Motors3,Motors4,Motors5,Motors6,Motors7;
unsigned char Motors0max,Motors1max,Motors2max,Motors3max,Motors4max,Motors5max,Motors6max,Motors7max;
unsigned short MotorsTmax;
unsigned char updatemotors=5;
//MartinW; added vars
 
 
unsigned char h,m,s;
unsigned int BaroExpandActive = 0;
int MesswertNick,MesswertRoll,MesswertGier,MesswertGierBias, RohMesswertNick,RohMesswertRoll;
185,6 → 200,16
DebugOut.Analog[13] = Motor[1].SetPoint;
DebugOut.Analog[14] = Motor[2].SetPoint;
DebugOut.Analog[15] = Motor[3].SetPoint;
 
//MartinW added Debug ouputs
DebugOut.Analog[16] = Motor[4].SetPoint;
DebugOut.Analog[17] = Motor[5].SetPoint;
DebugOut.Analog[24] = Motor[6].SetPoint;
DebugOut.Analog[25] = Motor[7].SetPoint;
DebugOut.Analog[26] = Motor[8].SetPoint;
DebugOut.Analog[27] = Motor[9].SetPoint;
//MartinW added Debug ouputs
 
DebugOut.Analog[20] = ServoNickValue;
DebugOut.Analog[22] = Capacity.ActualCurrent;
DebugOut.Analog[23] = Capacity.UsedCapacity;
1715,9 → 1740,48
else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
 
 
/* //MartinW original Motorsmoothing
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
*/
 
 
 
// MartinW; variable MS START
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
// else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
// Arthur P: the original code allowed the motor value to drop to 0 or negative values
// straight off, i.e. could amplify an intended decrease excessively while upregulation
// is dampened. The modification would still allow immediate drop below intended value
// but would dampen this. This would still allow for airbraking of the prop to have effect
// but it might lead to less sudden excessive drops in rpm with only gradual recovery.
// 090807 Arthur P: Due to problems with uart.c which still refers to user parameter 1 and 2 and
// possible timing issues with the shutter interval load, removed the shutter interval functions
// and switched to use of userparam6 for the motor smoothing.
// 091114 Inserted modification into 0.76g source code.
// 20100804 Modified v.0.80d code where motorsmoothing is no longer a separate function.
// Downsmoothing either uses default v.0.7x+ 150% downstep (user para 7 == 0),
// 50% downstep (user para 7 == 1 or 2), or downsteps of x% (userpara7 ==):
// 66.6% (3), 75% (4), 80% (5), 90% (10), 95% (20), 97.5% (40), 98% (50), 99% (100).
else
{
if(Parameter_UserParam7 < 2)
{ // Original function
tmp_int = 2 * tmp_int - tmp_motorwert[i];
}
else
{
// If userpara7 >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/Parameter_UserParam7);
}
}
 
// MartinW; variable MS END
 
 
LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
Motor[i].SetPoint = tmp_int / 4;
Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total)
/branches/v0.82a MartinW_Jeti+/fc.h
32,6 → 32,19
#define Poti7 Poti[6]
#define Poti8 Poti[7]
 
// MartinW; added vals
extern unsigned char Motors0,Motors1,Motors2,Motors3,Motors4,Motors5,Motors6,Motors7;
unsigned char Motors0max,Motors1max,Motors2max,Motors3max,Motors4max,Motors5max,Motors6max,Motors7max;
unsigned short MotorsTmax;
extern unsigned char updatemotors;
extern unsigned char loop1, loop2, loop3;
extern unsigned char settingdest;
extern unsigned char pos1, pos2, pos3, pos4;
extern int keynumber;
extern unsigned short CurrentOffset;///
extern signed char jetivalue1,jetivalue2,jetivalue3,jetivalue4;
// MartinW; added vals
 
extern unsigned char Sekunde,Minute;
extern unsigned int BaroExpandActive;
extern long IntegralNick,IntegralNick2;
86,6 → 99,8
extern char VarioCharacter;
extern int HoverGas;
 
extern int StickGas;// Martinw; for Jetimenu
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
extern unsigned char Parameter_Hoehe_P;
/branches/v0.82a MartinW_Jeti+/flight.pnproj
1,0 → 0,0
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="jeti.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="spi.h"></File><File path="spi.c"></File><File path="led.h"></File><File path="led.c"></File><File path="fc.c"></File><File path="mymath.c"></File><File path="mymath.h"></File><File path="isqrt.S"></File><File path="Spektrum.c"></File><File path="Spektrum.h"></File><File path="eeprom.h"></File><File path="eeprom.c"></File><File path="libfc.h"></File><File path="debug.c"></File><File path="debug.h"></File></Project>
<Project name="Flight-Ctrl"><File path="uart.h"></File><File path="jeti.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="printf_P.h"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="old_macros.h"></File><File path="twimaster.c"></File><File path="version.txt"></File><File path="twimaster.h"></File><File path="rc.c"></File><File path="rc.h"></File><File path="fc.h"></File><File path="menu.h"></File><File path="menu.c"></File><File path="_Settings.h"></File><File path="analog.c"></File><File path="analog.h"></File><File path="GPS.c"></File><File path="gps.h"></File><File path="License.txt"></File><File path="spi.h"></File><File path="spi.c"></File><File path="led.h"></File><File path="led.c"></File><File path="fc.c"></File><File path="mymath.c"></File><File path="mymath.h"></File><File path="isqrt.S"></File><File path="Spektrum.c"></File><File path="Spektrum.h"></File><File path="eeprom.h"></File><File path="eeprom.c"></File><File path="libfc.h"></File><File path="debug.c"></File><File path="debug.h"></File><File path="jetimenu.c"></File><File path="jetimenu.h"></File><File path="jetimenu2.c"></File></Project>
/branches/v0.82a MartinW_Jeti+/jetimenu.c
12,6 → 12,15
#define JETIBOX_KEY_NONE 0x0F
#define JETIBOX_KEY_UNDEF 0x00
 
//MartinW added Key's
#define JETIBOX_KEY_LANDR 0x9F // 159
#define JETIBOX_KEY_DownANDR 0x5F // 95
#define JETIBOX_KEY_DownANDL 0xCF // 207
#define JETIBOX_KEY_DownANDUP 0x6F // 111
#define JETIBOX_KEY_UPANDL 0xAF // 175
#define JETIBOX_KEY_UPANDR 0x3F // 63
//MartinW added Key's
 
#define JetiBox_printfxy(x,y,format, args...) { LIBFC_JetiBox_SetPos(y * 16 + x); _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);}
#define JetiBox_printf(format, args...) { _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);}
 
19,8 → 28,9
// the menu functions
// -----------------------------------------------------------
 
void Menu_Status(uint8_t key)
{ //0123456789ABCDEF
 
void Menu_Status(uint8_t key)
{ //0123456789ABCDEF
JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10);
if(NaviDataOkay)
{
46,7 → 56,7
JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature);
if(RequiredMotors <= 4)
{
JetiBox_printfxy(0,1,"Temperatures ");
JetiBox_printfxy(0,1,"Temperatures");
}
else
if(RequiredMotors <= 6)
58,8 → 68,21
 
void Menu_Battery(uint8_t key)
{ //0123456789ABCDEF
JetiBox_printfxy(0,0,"%2i.%1iV %3i.%1iA", UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
JetiBox_printfxy(0,1,"%4iW %6imAh",Capacity.ActualPower, Capacity.UsedCapacity);
 
if(Capacity.ActualCurrent > MotorsTmax) MotorsTmax = Capacity.ActualCurrent; ///
 
JetiBox_printfxy(0,0,"%2i.%1iV", UBat/10, UBat%10);
//0123456789ABCDEF
if(!MotorenEin)
{
JetiBox_printfxy(10,0,"%3i.%1iA",MotorsTmax/10, MotorsTmax%10);
}
else
{
JetiBox_printfxy(10,0,"%3i.%1iA",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
}
JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity);
}
 
 
92,7 → 115,474
}
}
 
void Menu_Current(uint8_t key)
{ //0123456789ABCDEF
loop1 ++;
if(loop1 >= updatemotors)
{
loop1=0;
Motors0 =Motor[0].Current;
Motors1 =Motor[1].Current;
Motors2 =Motor[2].Current;
Motors3 =Motor[3].Current;
Motors4 =Motor[4].Current;
Motors5 =Motor[5].Current;
Motors6 =Motor[6].Current;
Motors7 =Motor[7].Current;
}
if(Motor[0].Current > Motors0max) Motors0max = Motor[0].Current;
if(Motor[1].Current > Motors1max) Motors1max = Motor[1].Current;
if(Motor[2].Current > Motors2max) Motors2max = Motor[2].Current;
if(Motor[3].Current > Motors3max) Motors3max = Motor[3].Current;
if(Motor[4].Current > Motors4max) Motors4max = Motor[4].Current;
if(Motor[5].Current > Motors5max) Motors5max = Motor[5].Current;
if(Motor[6].Current > Motors6max) Motors6max = Motor[6].Current;
if(Motor[7].Current > Motors7max) Motors7max = Motor[7].Current;
 
if(!MotorenEin)
{
Motors0=Motors0max;Motors1=Motors1max;Motors2=Motors2max;Motors3=Motors3max;Motors4=Motors4max;Motors5=Motors5max;Motors6=Motors6max;Motors7=Motors7max;
}
JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motors0-(CurrentOffset/RequiredMotors), Motors1-(CurrentOffset/RequiredMotors), Motors2-(CurrentOffset/RequiredMotors), Motors3-(CurrentOffset/RequiredMotors));
JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motors4-(CurrentOffset/RequiredMotors), Motors5-(CurrentOffset/RequiredMotors), Motors6-(CurrentOffset/RequiredMotors), Motors6-(CurrentOffset/RequiredMotors));
if(RequiredMotors <= 4)
{
JetiBox_printfxy(0,1,"Currents T%3i.%1iA",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
}
else
if(RequiredMotors <= 6)
{
JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
}
if(key== JETIBOX_KEY_UP) updatemotors = updatemotors+1;
if(key== JETIBOX_KEY_DOWN) updatemotors = updatemotors-1;
}
 
 
void Menu_keynumber(uint8_t key)
{
pos1=0;pos2=0;pos3=0;pos4=0;
if(keynumber <= 0 ) keynumber=1;
if(keynumber >= 5 ) keynumber=1;
if(keynumber== 1) pos1=0X3E;if(keynumber== 2) pos2=0X3E;if(keynumber== 3) pos3=0X3E;if(keynumber== 4) pos4=0X3E;
if(key== JETIBOX_KEY_LEFT) keynumber--;
if(key== JETIBOX_KEY_RIGHT) keynumber++;
}
 
 
void Menu_I2C(uint8_t key)
{ //0123456789ABCDEF
 
JetiBox_printfxy(0,0,"I2C%3i%3i%3i%3i",Motor[0].State & MOTOR_STATE_ERROR_MASK,Motor[1].State & MOTOR_STATE_ERROR_MASK, Motor[2].State & MOTOR_STATE_ERROR_MASK, Motor[3].State & MOTOR_STATE_ERROR_MASK);
JetiBox_printfxy(0,1,"%3i %3i %3i %3i",Motor[4].State & MOTOR_STATE_ERROR_MASK,Motor[5].State & MOTOR_STATE_ERROR_MASK, Motor[6].State & MOTOR_STATE_ERROR_MASK, Motor[7].State & MOTOR_STATE_ERROR_MASK);
}
 
 
void Menu_SetPoint(uint8_t key)
{ //0123456789ABCDEF
 
loop1 ++;
if(loop1 >= updatemotors)
{
loop1=0;
Motors0 =Motor[0].SetPoint;
Motors1 =Motor[1].SetPoint;
Motors2 =Motor[2].SetPoint;
Motors3 =Motor[3].SetPoint;
Motors4 =Motor[4].SetPoint;
Motors5 =Motor[5].SetPoint;
Motors6 =Motor[6].SetPoint;
Motors7 =Motor[7].SetPoint;
}
JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motors0, Motors1, Motors2, Motors3);
JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motors4, Motors5, Motors6, Motors7);
if(RequiredMotors <= 4)
{
JetiBox_printfxy(0,1,"M SetPoint ");
}
else
if(RequiredMotors <= 6)
{
JetiBox_printfxy(8,1,"MSetP%3i",updatemotors);
}
/*
JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].SetPoint, Motor[1].SetPoint, Motor[2].SetPoint, Motor[3].SetPoint);
JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].SetPoint, Motor[5].SetPoint, Motor[6].SetPoint, Motor[7].SetPoint);
if(RequiredMotors <= 4)
{
JetiBox_printfxy(0,1,"M SetPoint ");
}
else
if(RequiredMotors <= 6)
{
JetiBox_printfxy(8,1,"MSetP ");
}
*/
if(key== JETIBOX_KEY_UP) updatemotors = updatemotors+1;
if(key== JETIBOX_KEY_DOWN) updatemotors = updatemotors-1;
}
 
void Menu_Integal(uint8_t key)
{ //0123456789ABCDEF
int r=0;
int n=0;
int g=0;
n=SummeNick >> 9;
r=SummeRoll >> 9;
g=Mess_Integral_Gier >> 9;
 
JetiBox_printfxy(0,0,"%3iN %3iR +N",n, r);
JetiBox_printfxy(0,1,"%3iG +R -N -R",g);
}
 
void Menu_Info(uint8_t key)
{ //0123456789ABCDEF
 
JetiBox_printfxy(0,0,"%3i=VSpeed",VarioMeter);
JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas);
}
 
 
 
 
 
void Menu_Serialpoti(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=SP1%c%3i=SP3",pos1,PPM_in[13]+127,pos3,PPM_in[15]+127);
JetiBox_printfxy(0,1,"%c%3i=SP2%c%3i=SP4",pos2,PPM_in[14]+127,pos4,PPM_in[16]+127);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) PPM_in[13] ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) PPM_in[13] --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) PPM_in[14] ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) PPM_in[14] --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) PPM_in[15] ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) PPM_in[15] --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) PPM_in[16] ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) PPM_in[16] --;
}
 
 
void Menu_hoeheconf(uint8_t key)
{
/*/ //0123456789ABCDEF
//CFG2_HEIGHT_LIMIT | CFG2_VARIO_BEEP | CFG_SENSITIVE_RC
 
SENSITIVE_RC on/off |VARIO_BEEP on/off| sw Height= 1 Vario Height = 0;
bit 2 1 0
000 0 rcoff Beepoff h
001 1 rcoff Beepoff v
010 2 rcoff Beepon h
011 3 rcoff Beepon v
100 4 rcon Beepoff h
101 5 rcon Beepoff v
110 6 rcon Beepon h
111 7 rcon Beepon v
 
/*/
 
//JetiBox_printfxy(0,0,"%3i econf",EE_Parameter.ExtraConfig);
//JetiBox_printfxy(0,1,"%3i=beep %3ideckel",(EE_Parameter.ExtraConfig & CFG2_VARIO_BEEP),(EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT));
 
if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) == 1) //EE_Parameter.ExtraConfig == 1 =switched Hightv+ variopiepser
{
JetiBox_printfxy(0,0,"switched Hight v");
}
if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) == 0)
{
JetiBox_printfxy(0,1,"Vario withbeep ^");
}
if(key== JETIBOX_KEY_UP) EE_Parameter.ExtraConfig |= (1 << 0) ;// set bit 0
if(key== JETIBOX_KEY_DOWN)
{
EE_Parameter.ExtraConfig &= ~(1 << 0) ; //delete bit 0
EE_Parameter.ExtraConfig |= (1 << 1) ; //set bit 1 +piep
}
}
 
 
 
void Menu_hoehe1(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=HD %c%3i=HA",pos1,EE_Parameter.Luftdruck_D,pos3,EE_Parameter.Hoehe_ACC_Wirkung);
JetiBox_printfxy(0,1,"%c%3i=HP %c%3i=HM",pos2,EE_Parameter.Hoehe_P,pos4,EE_Parameter.Hoehe_MinGas);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Luftdruck_D ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Luftdruck_D --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Hoehe_P ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Hoehe_P --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Hoehe_ACC_Wirkung ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Hoehe_ACC_Wirkung --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.Hoehe_MinGas ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.Hoehe_MinGas --;
}
 
 
void Menu_hoehe2(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=HV %c%3i=HZ",pos1,EE_Parameter.Hoehe_HoverBand,pos3,EE_Parameter.Hoehe_GPS_Z);
JetiBox_printfxy(0,1,"%c%3i=HG %c%3i=HS",pos2,EE_Parameter.Hoehe_Verstaerkung,pos4,EE_Parameter.MaxHoehe);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Hoehe_HoverBand ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Hoehe_HoverBand --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Hoehe_Verstaerkung ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Hoehe_Verstaerkung --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Hoehe_GPS_Z ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Hoehe_GPS_Z --;
//if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.MaxHoehe ++;
//if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.MaxHoehe --;
}
 
 
void Menu_stick(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=StP%c%3i=SGP",pos1,EE_Parameter.Stick_P,pos3,EE_Parameter.Gier_P);
JetiBox_printfxy(0,1,"%c%3i=StD%c%3i=DrC",pos2,EE_Parameter.Stick_D,pos4,EE_Parameter.Driftkomp);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Stick_P ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Stick_P --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Stick_D ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Stick_D --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Gier_P ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Gier_P --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.Driftkomp ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.Driftkomp --;
}
 
 
void Menu_gyro(uint8_t key)
{
Menu_keynumber(key);
 
 
JetiBox_printfxy(0,0,"%c%3i=GYP%c%3i=GYI",pos1,EE_Parameter.Gyro_P,pos3,EE_Parameter.Gyro_I);
JetiBox_printfxy(0,1,"%c%3i=GYD%c%3i=MaI",pos2,EE_Parameter.Gyro_D,pos4,EE_Parameter.I_Faktor);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Gyro_P ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Gyro_P --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Gyro_D ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Gyro_D --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Gyro_I ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Gyro_I --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.I_Faktor ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.I_Faktor --;
}
 
void Menu_gps(uint8_t key)
{
Menu_keynumber(key);
 
 
JetiBox_printfxy(0,0,"%c%3i=NGG%c%3i=NSC",pos1,EE_Parameter.NaviGpsGain,pos3,EE_Parameter.NaviSpeedCompensation);
JetiBox_printfxy(0,1,"%c%3i=NWC%c%3i=NAL",pos2,EE_Parameter.NaviWindCorrection,pos4,EE_Parameter.NaviAngleLimitation);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.NaviGpsGain ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.NaviGpsGain --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.NaviWindCorrection ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.NaviWindCorrection --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.NaviSpeedCompensation ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.NaviSpeedCompensation --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation --;
}
 
void Menu_gpspid(uint8_t key)
{
Menu_keynumber(key);
 
 
JetiBox_printfxy(0,0,"%c%3i=NP%c%3i=ND",pos1,EE_Parameter.NaviGpsP,pos3,EE_Parameter.NaviGpsD);
JetiBox_printfxy(0,1,"%c%3i=NI",pos2,EE_Parameter.NaviGpsI);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.NaviGpsP ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.NaviGpsP --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.NaviGpsI ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.NaviGpsI --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.NaviGpsD ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.NaviGpsD --;
//if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation ++;
//if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation --;
}
 
 
void Menu_LOOPconf(uint8_t key) // Korrigiert mit &0xF0
{ //0123456789ABCDEF
char loopval;
loopval=EE_Parameter.BitConfig&0x0F;
JetiBox_printfxy(0,0," ");
 
if(EE_Parameter.BitConfig & CFG_LOOP_LINKS)
{
LIBFC_JetiBox_Putchar(0x3C);
LIBFC_JetiBox_Putchar(0x00);
 
}
if(EE_Parameter.BitConfig & CFG_LOOP_OBEN)
{
LIBFC_JetiBox_Putchar(0X5E);
LIBFC_JetiBox_Putchar(0x00);
 
}
if(EE_Parameter.BitConfig & CFG_LOOP_UNTEN)
{
LIBFC_JetiBox_Putchar(0x76);
LIBFC_JetiBox_Putchar(0x00);
 
}
if(EE_Parameter.BitConfig & CFG_LOOP_RECHTS)
{
LIBFC_JetiBox_Putchar(0X3E);
}
JetiBox_printfxy(0,1,"Loopingvalue %2id",loopval);
if((key== JETIBOX_KEY_UP ) & ((loopval) <15 )) loopval ++;
if((key== JETIBOX_KEY_DOWN) & ((loopval) >0 )) loopval --;
EE_Parameter.BitConfig=(EE_Parameter.BitConfig&0xF0)|loopval;
}
 
 
void Menu_loopP(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=LGL%c%3i=LHy",pos1,EE_Parameter.LoopGasLimit,pos3,EE_Parameter.LoopHysterese);
JetiBox_printfxy(0,1,"%c%3i=LTh%c",pos2,EE_Parameter.LoopThreshold,pos4);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.LoopGasLimit ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.LoopGasLimit --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.LoopThreshold ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.LoopThreshold --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.LoopHysterese ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.LoopHysterese --;
//if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation ++;
//if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation --;
}
 
 
void Menu_coup(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=FGP%c%3i=CYC",pos1,EE_Parameter.AchsKopplung1,pos3,EE_Parameter.CouplingYawCorrection);
JetiBox_printfxy(0,1,"%c%3i=FNR%c%3i=UP7",pos2,EE_Parameter.AchsKopplung2,pos4,EE_Parameter.UserParam7);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.AchsKopplung1 ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.AchsKopplung1 --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.AchsKopplung2 ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.AchsKopplung2 --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.CouplingYawCorrection ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.CouplingYawCorrection --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.UserParam7 ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.UserParam7 --;
}
 
void Menu_gyroGandStab(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=GGP%c%3i=GSt",pos1,EE_Parameter.Gyro_Gier_P,pos3,EE_Parameter.Gyro_Stability);
JetiBox_printfxy(0,1,"%c%3i=GGI%c%3i=DSt",pos2,EE_Parameter.Gyro_Gier_I,pos4,EE_Parameter.DynamicStability);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Gyro_Gier_P ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Gyro_Gier_P --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Gyro_Gier_I ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Gyro_Gier_I --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3) & ( EE_Parameter.Gyro_Stability <15 )) EE_Parameter.Gyro_Stability ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3) & ( EE_Parameter.Gyro_Stability >0 )) EE_Parameter.Gyro_Stability --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.DynamicStability ++;
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.DynamicStability --;
}
 
void Menu_camera(uint8_t key)
{
Menu_keynumber(key);
 
JetiBox_printfxy(0,0,"%c%3i=NCT%c%3i=RCT",pos1,EE_Parameter.ServoNickControl,pos3,EE_Parameter.ServoRollControl);
JetiBox_printfxy(0,1,"%c%3i=NCP%c%3i=RCP",pos2,EE_Parameter.ServoNickComp,pos4,EE_Parameter.ServoRollComp);
if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.ServoNickControl ++; // Wert : 0-247 // Stellung des Servos
if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.ServoNickControl --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.ServoNickComp ++; // Wert : 0-247 // Einfluss Gyro/Servo
if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.ServoNickComp --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.ServoRollControl ++; // Wert : 0-247 // Stellung des Servos
if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.ServoRollControl --;
if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.ServoRollComp ++; // Wert : 0-247 // Einfluss Gyro/Servo
if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.ServoRollComp --;
}
 
 
 
 
void Menu_mtest(uint8_t key)
{ //0123456789ABCDEF
//extern void LIBFC_JetiBox_Putchar(char c);
PC_MotortestActive = 240;
JetiBox_printfxy(0,0,"Mtest <+v <+^%3i",Motor[loop3].Current-(CurrentOffset/RequiredMotors)); //13 chars
JetiBox_printfxy(0,1,"Motor=%2i Sp=%2i",loop3+1, MotorTest[loop3]);
 
if((key== JETIBOX_KEY_UP) & (loop2 <100 )) loop2=loop2 +2;//GESCHW
if((key== JETIBOX_KEY_DOWN) & (loop2 >0 )) loop2=loop2 -2;
if((key== JETIBOX_KEY_UPANDL) & (loop3 <15 )) loop3 ++;//motornummer
if((key==JETIBOX_KEY_DownANDL) & (loop3 >0 )) loop3 --;
MotorTest[loop3]=loop2;
}
 
void Menu_mem(uint8_t key)
{
JetiBox_printfxy(0,0,"SETTING=%1i",GetActiveParamSet());
JetiBox_printfxy(0,1, "< + >toSTOREto %1i",settingdest);
// 00123456789ABCDEF
//if(key== JETIBOX_KEY_DOWN )
if(key== JETIBOX_KEY_LANDR && !MotorenEin)
{
ParamSet_WriteToEEProm(settingdest);
Piep(GetActiveParamSet(),120);
JetiBox_printfxy(13,0,"OK!");
}
if((key== JETIBOX_KEY_UP) & (settingdest <5 )) settingdest++;
if((key== JETIBOX_KEY_DOWN) & (settingdest >1 )) settingdest--;
}
 
 
// -----------------------------------------------------------
// the menu topology
// -----------------------------------------------------------
115,18 → 605,43
*/
 
const MENU_ENTRY JetiBox_Menu[] PROGMEM=
{ // l r u d pHandler
{3, 1, 0, 0, &Menu_Status }, // 0
{0, 2, 1, 1, &Menu_Temperature }, // 1
{1, 3, 2, 2, &Menu_Battery }, // 2
{2, 0, 3, 3, &Menu_PosInfo }, // 3
{ // l r u d pHandler links rechts up down
{23, 1, 0, 0, &Menu_Status }, // Seite 1
{ 0, 2, 1, 1, &Menu_Temperature }, // 2
{ 1, 3, 2, 2, &Menu_Battery }, // 3
{ 2, 4, 3, 3, &Menu_PosInfo }, // 4
{ 3, 5, 4, 4, &Menu_Current }, // 5
{ 4, 6, 5, 5, &Menu_SetPoint }, // 6
{ 5, 7, 6, 6, &Menu_I2C }, // 7
{ 6, 8, 7, 7, &Menu_Integal }, // 8
{ 7, 9, 8, 8, &Menu_Info }, // 9
{ 8, 10, 9, 9, &Menu_Serialpoti }, // 10
{ 9, 11, 10, 10, &Menu_hoehe1 }, // 11
{10, 12, 11, 11, &Menu_hoehe2 }, // 12
{11, 13, 12, 12, &Menu_stick }, // 13
{12, 14, 13, 13, &Menu_gyro }, // 14
{13, 15, 14, 14, &Menu_gyroGandStab }, // 15
{14, 16, 15, 15, &Menu_gps }, // 16
{15, 17, 16, 16, &Menu_gpspid }, // 17
{16, 18, 17, 17, &Menu_loopP }, // 18
{17, 19, 18, 18, &Menu_coup }, // 19
{18, 20, 19, 19, &Menu_camera }, // 20
{19, 21, 20, 20, &Menu_LOOPconf }, // 21
{20, 22, 21, 21, &Menu_hoeheconf }, // 22
{21, 0, 22, 22, &Menu_mtest }, // 23
{22, 0, 23, 23, &Menu_mem }, // 23
};
//void Menu_gpspid(uint8_t key)
 
 
// -----------------------------------------------------------
// Update display buffer
// -----------------------------------------------------------
unsigned char JetiBox_Update(unsigned char key)
{
//printf(" %3i = keynumber, pos1 =%3i \n\r ", pos1); ///
 
static uint8_t item = 0, last_item = 0; // the menu item
 
// navigate within the menu by key action
134,18 → 649,44
switch(key)
{
case JETIBOX_KEY_LEFT:
if (item == 0) return (1); // switch back to jeti expander menu
else item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item
///if (item == 0) return (1); // switch back to jeti expander menu, so no back possible
///else
///{
if (keynumber <= 0 || keynumber >=5) //keynumber normaly 0, only in the parameter pages keyn=1...4
{
item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item
}
///}
break;
case JETIBOX_KEY_RIGHT:
if (keynumber <= 0 || keynumber >=5)
{
item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item
}
break;
case JETIBOX_KEY_UP:
case JETIBOX_KEY_UP:
item = pgm_read_byte(&JetiBox_Menu[item].up); //trigger to up menu item
break;
case JETIBOX_KEY_DOWN:
item = pgm_read_byte(&JetiBox_Menu[item].down); //trigger to down menu item
break;
case JETIBOX_KEY_NONE: ///
if (keynumber == 5 )
{
item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item
keynumber=6;
}
if (keynumber == 0) //keynumber normaly 0, only in the parameter pages keyn=1...4
{
item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item
keynumber=-1;
 
}
break;
default:
break;
}
/branches/v0.82a MartinW_Jeti+/led.c
27,6 → 27,18
if(!delay--) // 10ms Intervall
{
delay = 4;
 
 
 
//MartinW: added
if(EE_Parameter.UserParam8 >0) // 2ms Intervall ///
{
delay = 0;
}
//MartinW
 
 
 
if(FC_StatusFlags & (FC_STATUS_LOWBAT | FC_STATUS_EMERGENCY_LANDING) || (VersionInfo.HardwareError[1] & FC_ERROR1_I2C))
{
if(EE_Parameter.WARN_J16_Bitmask)
/branches/v0.82a MartinW_Jeti+/main.c
50,8 → 50,8
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include "main.h"
//MartinW MaxSize is 63488 bytes
 
 
unsigned char PlatinenVersion = 10;
unsigned char SendVersionToNavi = 1;
unsigned char BattLowVoltageWarning = 94;
102,7 → 102,7
}
}
else BattLowVoltageWarning = EE_Parameter.UnterspannungsWarnung;
if(print) printf(" Low warning level: %d.%d",BattLowVoltageWarning/10,BattLowVoltageWarning%10);
if(print) printf("Low warning level: %d.%d",BattLowVoltageWarning/10,BattLowVoltageWarning%10);
}
 
//############################################################################
170,7 → 170,7
timer = SetDelay(500);
while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer
 
printf("\n\rFound BL-Ctrl: ");
printf("\n\rFound BLC: "); ///
timer = SetDelay(4000);
for(i=0; i < MAX_MOTORS; i++)
{
195,12 → 195,12
{
if(!(Motor[i].State & MOTOR_STATE_PRESENT_MASK) && Mixer.Motor[i][0] > 0)
{
printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i+1);
printf("\n\r\n\r! MISSING BL-CTRL: %d !",i+1);///
ServoActive = 2; // just in case the FC would be used as camera-stabilizer
}
Motor[i].State &= ~MOTOR_STATE_ERROR_MASK; // clear error counter
}
printf("\n\r===================================");
printf("\n\r="); //MartinW; removed =
 
if(RequiredMotors < FoundMotors) VersionInfo.HardwareError[1] |= FC_ERROR1_MIXER;
 
229,13 → 229,18
FlugMinuten = 0;
FlugMinutenGesamt = 0;
}
printf("\n\rFlight-time %u min Total:%u min", FlugMinuten, FlugMinutenGesamt);
printf("\n\rFlighttime %u min Total:%u min", FlugMinuten, FlugMinutenGesamt);///
 
printf("\n\rControl: ");
if (EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) printf("HeadingHold");
else printf("Normal (ACC-Mode)");
#ifdef NODISPLAY // MartinW; for no MKT Display main.h
 
#warning : "### no MKTool Display ###"
LcdClear();
#endif
I2CTimeout = 5000;
WinkelOut.Orientation = 1;
LipoDetection(1);
242,7 → 247,7
 
LIBFC_ReceiverInit(EE_Parameter.Receiver);
 
printf("\n\r===================================\n\r");
printf("\n\r=\n\r");/// Martinw; removed =
//SpektrumBinding();
timer = SetDelay(2000);
timerPolling = SetDelay(250);
/branches/v0.82a MartinW_Jeti+/main.h
6,6 → 6,8
//#define SWITCH_LEARNS_CAREFREE
//#define RECEIVER_SPEKTRUM_EXP
 
//#define NODISPLAY // MartinW; with "//" = no MKTool Display
 
// neue Hardware
#define ROT_OFF {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB &=~0x01; else PORTB |= 0x01;}
#define ROT_ON {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB |= 0x01; else PORTB &=~0x01;}
/branches/v0.82a MartinW_Jeti+/makefile
7,6 → 7,7
VERSION_MAJOR = 0
VERSION_MINOR = 82
VERSION_PATCH = 0
NAMEEXT = jeti004
VERSION_SERIAL_MAJOR = 11 # Serial Protocol
VERSION_SERIAL_MINOR = 0 # Serial Protocol
NC_SPI_COMPATIBLE = 16 # Navi-Kompatibilität
42,22 → 43,22
# Target file name (without extension).
 
ifeq ($(VERSION_PATCH), 0)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a_SVN$(REV)_$(NAMEEXT)
endif
ifeq ($(VERSION_PATCH), 1)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b_SVN$(REV)_$(NAMEEXT)
endif
ifeq ($(VERSION_PATCH), 2)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)c_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)c_SVN$(REV)_$(NAMEEXT)
endif
ifeq ($(VERSION_PATCH), 3)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)d_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)d_SVN$(REV)_$(NAMEEXT)
endif
ifeq ($(VERSION_PATCH), 4)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)e_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)e_SVN$(REV)_$(NAMEEXT)
endif
ifeq ($(VERSION_PATCH), 5)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)f_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)f_SVN$(REV)_$(NAMEEXT)
endif
ifeq ($(VERSION_PATCH), 6)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)g_SVN$(REV)
115,7 → 116,7
# List C source files here. (C dependencies are automatically generated.)
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 += mymath.c jetimenu2.c capacity.c debug.c
 
##########################################################################################################
 
/branches/v0.82a MartinW_Jeti+/menu.c
8,6 → 8,11
#include "main.h"
#include "eeprom.h"
 
#ifdef NODISPLAY // only include functions if DEBUG is defined in main.h
 
#warning : "### no MKTool Display ###"
 
 
char DisplayBuff[80] = "Hello World";
unsigned char DispPtr = 0;
 
202,3 → 207,4
}
RemoteKeys = 0;
}
#endif
/branches/v0.82a MartinW_Jeti+/uart.c
77,41 → 77,41
unsigned int AboTimeOut = 0;
unsigned volatile char JetiUpdateModeActive = 0;
 
const unsigned char ANALOG_TEXT[32][16] PROGMEM =
const unsigned char ANALOG_TEXT[32][13] PROGMEM =
{
//1234567890123456
"AngleNick ", //0
"AngleRoll ",
"AccNick ",
"AccRoll ",
"YawGyro ",
"Height Value ", //5
"AccZ ",
"Gas ",
"Compass Value ",
"Voltage [0.1V] ",
"Receiver Level ", //10
"Gyro Compass ",
"Motor 1 ",
"Motor 2 ",
"Motor 3 ",
"Motor 4 ", //15
"16 ",
"17 ",
"18 ",
"19 ",
"Servo ", //20
"Hovergas ",
"Current [0.1A] ",
"Capacity [mAh] ",
"24 ",
"25 ", //25
"26 ",
"27 ",
"I2C-Error ",
"BL Limit ",
"GPS_Nick ", //30
"GPS_Roll "
"AngleNick ", //0
"AngleRoll ",
"AccNick ",
"AccRoll ",
"YawGyro ",
"Height Value ", //5
"AccZ ",
"Gas ",
"Compass Value",
"Voltage[0.1V]",
"ReceiverLevel", //10
"Gyro Compass ",
"Motor 1 ",
"Motor 2 ",
"Motor 3 ",
"Motor 4 ", //15
"Motor 5 ",
"Motor 6 ",
"18 ",
"WoutCalcState",
"Servo ", //20
"Hovergas ",
"Current[0.1A]",
"Capacity[mAh]",
"Motor 7 ",
"Motor 8 ", //25
"Motor 9 ",
"Motor 10 ",
"I2C-Error ",
"BL Limit ",
"GPS_Nick ", //30
"GPS_Roll "
};
 
 
170,7 → 170,12
RxdBuffer[buf_ptr] = '\r';
if(RxdBuffer[2] == 'R')
{
#ifdef NODISPLAY // MartinW main.h
#warning : "### no MKTool Display ###"
LcdClear();
#endif
wdt_enable(WDTO_250MS); // Reset-Commando
ServoActive = 0;
}
570,6 → 575,11
break;
 
case 'h':// x-1 Displayzeilen
#ifdef NODISPLAY // only include functions if DEBUG is defined in main.h
#warning : "### no MKTool Display ###"
 
 
PcZugriff = 255;
if((pRxData[0] & 0x80) == 0x00) // old format
{
591,6 → 601,9
MenuePunkt = pRxData[0];
DebugDisplayAnforderung1 = 1;
break;
#endif
case 'v': // Version-Anforderung und Ausbaustufe
GetVersionAnforderung = 1;
break;
666,6 → 679,9
DebugDataIntervall = 0;
Intervall3D = 0;
}
#ifdef NODISPLAY //main.h
#warning : "### no MKTool Display ###"
 
if(((Display_Interval>0 && CheckDelay(Display_Timer)) || DebugDisplayAnforderung) && UebertragungAbgeschlossen)
{
689,6 → 705,9
SendOutData('L', FC_ADDRESS, 3, &MenuePunkt, sizeof(MenuePunkt), &MaxMenue, sizeof(MaxMenue), DisplayBuff, sizeof(DisplayBuff));
DebugDisplayAnforderung1 = 0;
}
#endif
 
if(GetVersionAnforderung && UebertragungAbgeschlossen)
{
SendOutData('V', FC_ADDRESS, 1, (unsigned char *) &VersionInfo, sizeof(VersionInfo));
731,8 → 750,11
}
if(DebugTextAnforderung != 255) // Texte für die Analogdaten
{
unsigned char label[16]; // local sram buffer
memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 16); // read lable from flash to sra
/// old: unsigned char label[16]; // local sram buffer
unsigned char label[16]=" "; // local sram buffer ///MartinW; for MKTool, needs 32 bytes
 
 
memcpy_P(label, ANALOG_TEXT[DebugTextAnforderung], 13); // read lable from flash to sra
SendOutData('A', FC_ADDRESS, 2, (unsigned char *)&DebugTextAnforderung, sizeof(DebugTextAnforderung),label, 16);
DebugTextAnforderung = 255;
}