Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 95 → Rev 96

/trunk/GPS.c
163,9 → 163,24
if(StopNavigation) GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_FREE;
else
{
if (Parameter.NaviGpsModeControl < 50) GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_FREE;
else if(Parameter.NaviGpsModeControl < 180) GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_AID;
else GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_WAYPOINT;
if(Parameter.NaviGpsModeControl < 50)
{
GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_FREE;
NCFlags &= ~(NC_FLAG_PH | NC_FLAG_CH);
NCFlags |= NC_FLAG_FREE;
}
else if(Parameter.NaviGpsModeControl < 180)
{
GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_AID;
NCFlags &= ~(NC_FLAG_FREE | NC_FLAG_CH);
NCFlags |= NC_FLAG_PH;
}
else
{
GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_WAYPOINT;
NCFlags &= ~(NC_FLAG_FREE | NC_FLAG_PH);
NCFlags |= NC_FLAG_CH;
}
}
GPS_Parameter.Gain = (float)Parameter.NaviGpsGain;
GPS_Parameter.P = (float)Parameter.NaviGpsP;
429,8 → 444,7
{
// the GPS control is deactived
case GPS_FLIGHT_MODE_FREE:
NCFlags &= ~(NC_FLAG_PH | NC_FLAG_CH);
NCFlags |= NC_FLAG_FREE;
 
GPS_Parameter.PID_Limit = 0; // disables PID output
// update hold position
GPS_CopyPosition(&(GPSData.Position), &GPS_HoldPosition);
441,8 → 455,7
 
// the GPS supports the position hold, if the pilot takes no action
case GPS_FLIGHT_MODE_AID:
NCFlags &= ~(NC_FLAG_FREE | NC_FLAG_CH);
NCFlags |= NC_FLAG_PH;
 
// reset WPList to begin
GPS_pWaypoint = WPList_Begin();
 
463,8 → 476,6
// the GPS control is directed to a target position
// given by a waypoint or by the home position
case GPS_FLIGHT_MODE_WAYPOINT:
NCFlags &= ~(NC_FLAG_FREE | NC_FLAG_PH);
NCFlags |= NC_FLAG_CH;
 
if(GPS_IsManuallyControlled()) // the human pilot takes the action
{
/trunk/uart1.c
547,7 → 547,7
switch(rxd_buffer[2])
{
case 'z': // connection checker
Echo = *((u16*)&pRxData[0]); // copy echo pattern
memcpy(&Echo, (u8*)pRxData, sizeof(Echo)); // copy echo pattern
SerialLinkOkay = 250; // reset SerialTimeout
Request_Echo = TRUE;
break;