Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 784 → Rev 785

/trunk/menu.c
145,6 → 145,7
// LCD_printfxy(0,3,"(c) HiSystems GmbH");
}
if(FC.StatusFlags3 & FC_STATUS3_BOAT) LCD_printfxy(16,2,"BOAT");
//if(NC_To_FC_Flags & NC_TO_FC_SWITCHOFF_IF_LANDED) LCD_printfxy(16,2,"Off");
break;
case 1:
if(IamMaster == SLAVE) LCD_printfxy(0,0,"++ Master - NC ++")
/trunk/uart1.c
534,7 → 534,6
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
// GPS_pWaypoint = PointList_WPBegin(); // updates POI index
if(pPoint->Index) start = pPoint->Index-1;
 
if(CurrentlyFlyingWaypoints)
{
GPS_pWaypoint = PointList_WPBegin(start);
/trunk/waypoints.c
145,6 → 145,8
// nothing to do
break;
 
case POINT_TYPE_LAND:
FsPointCnt++; // break fehlt absichtlich
case POINT_TYPE_WP:
WPCount++;
PointCount++;
161,7 → 163,7
}
break;
case POINT_TYPE_WP: // was a waypoint
case POINT_TYPE_LAND: // was a landing point
switch(pPoint->Type)
{
case POINT_TYPE_INVALID:
170,7 → 172,34
break;
 
default:
case POINT_TYPE_LAND:
break;
case POINT_TYPE_WP:
FsPointCnt--;
break;
case POINT_TYPE_FS:
FsPointCnt++;
WPCount--;
break;
case POINT_TYPE_POI:
POICount++;
WPCount--;
break;
}
break;
case POINT_TYPE_WP:
switch(pPoint->Type)
{
case POINT_TYPE_INVALID:
WPCount--;
PointCount--;
break;
 
default:
case POINT_TYPE_LAND:
FsPointCnt++;
break;
case POINT_TYPE_WP:
//nothing to do
break;
case POINT_TYPE_FS:
192,6 → 221,8
PointCount--;
break;
 
case POINT_TYPE_LAND:
FsPointCnt++; // break fehlt absichtlich
case POINT_TYPE_WP:
WPCount++;
POICount--;
215,6 → 246,8
PointCount--;
break;
 
case POINT_TYPE_LAND:
FsPointCnt++;
case POINT_TYPE_WP:
WPCount++;
FsPointCnt--;
241,7 → 274,7
}
 
// returns the pointer to the first waypoint within the list
Point_t* PointList_WPBegin(void)
Point_t* PointList_WPBegin(u32 start)
{
u8 i;
WPIndex = 0; // set list position invalid
249,12 → 282,12
if(WPActive == FALSE) return(NULL);
 
POIIndex = 0; // set invalid POI
if(PointCount > 0)
if(PointCount > start)
{
// search for first wp in list
for(i = 0; i <MAX_LIST_LEN; i++)
for(i = start; i <MAX_LIST_LEN; i++)
{
if((PointList[i].Type == POINT_TYPE_WP) && (PointList[i].Position.Status != INVALID)) // jump over POIs and FS-Positions
if(((PointList[i].Type == POINT_TYPE_WP)||(PointList[i].Type == POINT_TYPE_LAND)) && (PointList[i].Position.Status != INVALID)) // jump over POIs and FS-Positions
{
WPIndex = i + 1;
break;
314,7 → 347,7
// search backward!
for(i = 1; i <= MAX_LIST_LEN; i++)
{
if((PointList[MAX_LIST_LEN - i].Type == POINT_TYPE_WP) && (PointList[MAX_LIST_LEN - i].Position.Status != INVALID))
if(((PointList[MAX_LIST_LEN - i].Type == POINT_TYPE_WP) || (PointList[MAX_LIST_LEN - i].Type == POINT_TYPE_LAND)) && (PointList[MAX_LIST_LEN - i].Position.Status != INVALID))
{
WPIndex = MAX_LIST_LEN - i + 1;
break;
360,7 → 393,7
u8 i;
for(i = WPIndex; i < MAX_LIST_LEN; i++) // start search for next at next list entry
{
if((PointList[i].Type == POINT_TYPE_WP) && (PointList[i].Position.Status != INVALID)) // jump over POIs and FS-Positions
if(((PointList[i].Type == POINT_TYPE_WP) || (PointList[i].Type == POINT_TYPE_LAND)) && (PointList[i].Position.Status != INVALID)) // jump over POIs and FS-Positions
{
wp_found = i+1;
break;
395,7 → 428,7
if(set)
{
WPActive = TRUE;
PointList_WPBegin(); // updates POI index
PointList_WPBegin(0); // updates POI index
}
else
{
661,6 → 694,8
switch(PointList[IsPointSection-1].Type)
{
case POINT_TYPE_LAND:
FsPointCnt++; // break fehlt absichtlich
case POINT_TYPE_WP:
// this works only if altitude key is set before point type key in WPL file !!
PointList[IsPointSection-1].Position.Altitude /= 10; // dm only for WPs
864,7 → 899,7
else // es ist gearde ein Wegpunktflug aktiv -> updaten
{
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
GPS_pWaypoint = PointList_WPBegin(); // updates POI index
GPS_pWaypoint = PointList_WPBegin(0); // updates POI index
}
 
return(retval);
/trunk/waypoints.h
7,6 → 7,7
#define POINT_TYPE_WP 0
#define POINT_TYPE_POI 1
#define POINT_TYPE_FS 2
#define POINT_TYPE_LAND 3
 
// the waypoints list
#define MAX_LIST_LEN 101
55,7 → 56,7
// set a point in the list at index, returns its index on success, else 0
u8 PointList_SetAt(Point_t* pPoint);
// goto the first WP in the list and return pointer to it
Point_t* PointList_WPBegin(void);
Point_t* PointList_WPBegin(u32);
// goto the last WP in the list and return pointer to it
Point_t* PointList_WPEnd(void);
// goto next WP in the list and return pointer to it
86,4 → 87,9
extern Point_t PointList[MAX_LIST_LEN];
extern u8 FsPointCnt;
 
extern u8 PointCount;
extern u8 POICount;
extern u8 WPCount;
 
 
#endif // _WAYPOINTS_H