Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2592 → Rev 2593

/trunk/uart.c
216,7 → 216,7
if(RxdBuffer[2] == 'R' && !MotorenEin)
{
LcdClear();
wdt_enable(WDTO_250MS); // Reset-Commando
wdt_enable(WDTO_15MS); // Reset-Commando
ServoActive = 0;
}
}
637,7 → 637,8
{
memcpy((unsigned char *)&ExternalControl, (unsigned char *)pRxData, sizeof(ExternalControl));
ConfirmFrame = ExternalControl.Frame;
ExternalControlTimeout = 100; // 2 seconds timeout
if(Parameter_ExternalControl < 128 || (!ExternalControl.Config & EC_VALID)) ExternalControl.Config = 0;
else ExternalControlTimeout = 100; // 2 seconds timeout
}
break;
case 'c': // Poll the 3D-Data
845,6 → 846,7
GetPPMChannelAnforderung = 0;
}
#ifndef REDUNDANT_FC_SLAVE
/*
if((CheckDelay(Kompass_Timer)) && UebertragungAbgeschlossen)
{
if(!NaviDataOkay) // no external compass needed
859,6 → 861,50
if(JustMK3MagConnected) Kompass_Timer = SetDelay(99);
else Kompass_Timer = SetDelay(999);
}
*/
 
/*
#define EC_VALID 0x01 // only valid if this is 1
#define EC_GAS_ADD 0x02 // if 1 -> use the GAS Value not as MAX
#define EC_USE_SWITCH 0x20 // if 1 -> use the Switches for further control
#define EC_IGNORE_RC_STICK 0x40 // direct control (do nor add to RC-Stick)
#define EC_IGNORE_RC 0x80 // if 1 -> for Flying without RC-Control
 
// defines for ExternalControl.Switches -> control GPS Modes etc. if(Config & EC_USE_SWITCH)
#define EC2_PH 0x01 // GPS-Mode: PH
#define EC2_CH 0x02 // GPS-Mode: CH
#define EC2_CAREFREE 0x10 //
#define EC2_ALTITUDE 0x20 //
#define EC2_AUTOSTART 0x40 //
#define EC2_AUTOLAND 0x80 //
 
if((CheckDelay(Kompass_Timer)) && UebertragungAbgeschlossen)
{
static struct str_ExternControl Test;
 
Test.Nick = ChannelNick;
Test.Roll = ChannelRoll;
Test.Gier = ChannelYaw;
Test.Gas = ChannelGas;
Test.Frame++;
 
if(PPM_in[16] > 64) Test.Config = EC_GAS_ADD | EC_USE_SWITCH | EC_VALID;
else Test.Config = 0;
 
if(PPM_in[13] > 64) Test.Config |= EC_IGNORE_RC | EC_IGNORE_RC_STICK;
 
Test.Switches = 0;
if(PPM_in[5] > 64) Test.Switches |= EC2_ALTITUDE;
if(PPM_in[6] > 64) Test.Switches |= EC2_CH;
else if(PPM_in[6] > -64) Test.Switches |= EC2_PH;
if(PPM_in[8] > 64) Test.Switches |= EC2_CAREFREE;
if(PPM_in[10] > 64) Test.Switches |= EC2_AUTOSTART;
if(PPM_in[10] < -64) Test.Switches |= EC2_AUTOLAND;
 
SendOutData('b', FC_ADDRESS, 1, (unsigned char *) &Test,sizeof(Test));
Kompass_Timer = SetDelay(50);
}
*/
#endif
 
#ifdef REDUNDANT_FC_SLAVE