Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1731 → Rev 1739

/branches/MartinW_Jeti+/fc.c
57,6 → 57,8
#include "mymath.h"
#include "isqrt.h"
 
signed char jetivalue1=0,jetivalue2=0,jetivalue3=0,jetivalue4=0;
 
unsigned char h,m,s;
unsigned int BaroExpandActive = 0;
int MesswertNick,MesswertRoll,MesswertGier,MesswertGierBias, RohMesswertNick,RohMesswertRoll;
184,6 → 186,15
DebugOut.Analog[13] = Motor[1].SetPoint;
DebugOut.Analog[14] = Motor[2].SetPoint;
DebugOut.Analog[15] = Motor[3].SetPoint;
 
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;
DebugOut.Analog[20] = ServoNickValue;
DebugOut.Analog[22] = Capacity.ActualCurrent;
DebugOut.Analog[23] = Capacity.UsedCapacity;
/branches/MartinW_Jeti+/fc.h
43,6 → 43,7
#define Poti7 Poti[6]
#define Poti8 Poti[7]
 
extern signed char jetivalue1,jetivalue2,jetivalue3,jetivalue4;
extern volatile unsigned char FCFlags;
extern unsigned char Sekunde,Minute;
extern unsigned int BaroExpandActive;
97,6 → 98,7
extern unsigned char Parameter_Servo3,Parameter_Servo4,Parameter_Servo5;
extern char VarioCharacter;
extern int HoverGas;
extern int StickGas;
 
extern unsigned char Parameter_Luftdruck_D;
extern unsigned char Parameter_MaxHoehe;
/branches/MartinW_Jeti+/jetimenu.c
59,7 → 59,9
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);
//1
JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity);
//1
}
 
 
92,7 → 94,87
}
}
 
//1
void Menu_Current(uint8_t key)
{ //0123456789ABCDEF
JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].Current-12, Motor[1].Current-12, Motor[2].Current-12, Motor[3].Current-12);
JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Current-12, Motor[5].Current-12, Motor[6].Current-12, Motor[7].Current-12);
if(RequiredMotors <= 4)
{
JetiBox_printfxy(0,1,"Currents ");
}
else
if(RequiredMotors <= 6)
{
JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
}
 
}
//1
//1
void Menu_SetPoint(uint8_t key)
{ //0123456789ABCDEF
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 ");
}
 
}
 
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);
//1
 
}
 
void Menu_Info(uint8_t key)
{ //0123456789ABCDEF
 
JetiBox_printfxy(0,0,"%3i=Hovergas",HoverGas);
JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas);
}
 
void Menu_spoti1(uint8_t key)
{ //0123456789ABCDEF
 
JetiBox_printfxy(0,0,">%3i=Serialpot1",PPM_in[13]);
JetiBox_printfxy(0,1," %3i=Serialpot2",PPM_in[14]);
if(key== JETIBOX_KEY_UP) PPM_in[13] = PPM_in[13]+1;
if(key== JETIBOX_KEY_DOWN) PPM_in[13] = PPM_in[13]-1;
}
 
void Menu_spoti2(uint8_t key)
{ //0123456789ABCDEF
 
JetiBox_printfxy(0,0," %3i=Serialpot1",PPM_in[13]);
JetiBox_printfxy(0,1,">%3i=SPo %3i",PPM_in[14],key);
if(key== JETIBOX_KEY_UP) PPM_in[14] = PPM_in[14]+5;
if(key== JETIBOX_KEY_DOWN) PPM_in[14] = PPM_in[14]-5;
}
 
//#define JETIBOX_KEY_UP 0x2F
//#define JETIBOX_KEY_DOWN 0x4F
//1
 
 
 
// -----------------------------------------------------------
// the menu topology
// -----------------------------------------------------------
115,11 → 197,22
*/
 
const MENU_ENTRY JetiBox_Menu[] PROGMEM=
{ // l r u d pHandler
{3, 1, 0, 0, &Menu_Status }, // 0
{ // l r u d pHandler links rechts up down
{9, 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
{2, 4, 3, 3, &Menu_PosInfo }, // 3
//1
{3, 5, 4, 4, &Menu_Current }, // 4 ///
{4, 6, 5, 5, &Menu_SetPoint }, // 5 ///
{5, 7, 6, 6, &Menu_Integal }, // 6 ///
{6, 8, 7, 7, &Menu_Info }, // 7 ///
{7, 9, 8, 8, &Menu_spoti1 }, // 8 ///
{8, 0, 9, 9, &Menu_spoti2 }, // 9 ///
 
//1
};
 
// -----------------------------------------------------------
141,9 → 234,15
item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item
break;
case JETIBOX_KEY_UP:
jetivalue1=jetivalue1+5;
item = pgm_read_byte(&JetiBox_Menu[item].up); //trigger to up menu item
break;
case JETIBOX_KEY_DOWN:
jetivalue1=jetivalue1-5;
item = pgm_read_byte(&JetiBox_Menu[item].down); //trigger to down menu item
break;
default:
/branches/MartinW_Jeti+/makefile
1,7 → 1,7
#--------------------------------------------------------------------
# MCU name
#MCU = atmega1284p
MCU = atmega644p
MCU = atmega1284p
#MCU = atmega644p
F_CPU = 20000000
#-------------------------------------------------------------------
VERSION_MAJOR = 0
/branches/MartinW_Jeti+/uart.c
98,18 → 98,18
"Motor 2 ",
"Motor 3 ",
"Motor 4 ", //15
"16 ",
"17 ",
"Motor 5 ",
"Motor 6 ",
"18 ",
"19 ",
"WoutCalcState ",
"Servo ", //20
"Hovergas ",
"Current [0.1A] ",
"Capacity [mAh] ",
"24 ",
"25 ", //25
"26 ",
"27 ",
"Motor 7 ",
"Motor 8 ", //25
"Motor 9 ",
"Motor 10 ",
"I2C-Error ",
"BL Limit ",
"GPS_Nick ", //30