Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 96 → Rev 95

/trunk/GPS.c
163,24 → 163,9
if(StopNavigation) GPS_Parameter.FlightMode = GPS_FLIGHT_MODE_FREE;
else
{
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;
}
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;
}
GPS_Parameter.Gain = (float)Parameter.NaviGpsGain;
GPS_Parameter.P = (float)Parameter.NaviGpsP;
444,7 → 429,8
{
// 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);
455,7 → 441,8
 
// 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();
 
476,6 → 463,8
// 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
memcpy(&Echo, (u8*)pRxData, sizeof(Echo)); // copy echo pattern
Echo = *((u16*)&pRxData[0]); // copy echo pattern
SerialLinkOkay = 250; // reset SerialTimeout
Request_Echo = TRUE;
break;