Subversion Repositories NaviCtrl

Rev

Rev 785 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 785 Rev 786
Line 274... Line 274...
274
}
274
}
Line 275... Line 275...
275
 
275
 
276
// returns the pointer to the first waypoint within the list
276
// returns the pointer to the first waypoint within the list
277
Point_t* PointList_WPBegin(u32 start)
277
Point_t* PointList_WPBegin(u32 start)
278
{
278
{
279
        u8 i;
279
        u8 i, wp_nr = 0;
Line 280... Line 280...
280
        WPIndex = 0; // set list position invalid
280
        WPIndex = 0; // set list position invalid
Line 281... Line 281...
281
 
281
 
282
        if(WPActive == FALSE) return(NULL);
282
        if(WPActive == FALSE) return(NULL);
283
 
283
 
284
        POIIndex = 0; // set invalid POI
284
        POIIndex = 0; // set invalid POI
285
        if(PointCount > start)
285
        if(PointCount > start)
286
        {
286
        {
287
                // search for first wp in list
287
                // search for first wp in list
288
                for(i = start; i <MAX_LIST_LEN; i++)
288
                for(i = 0; i <MAX_LIST_LEN; i++)
289
                {
289
                {
-
 
290
                        if(((PointList[i].Type == POINT_TYPE_WP)||(PointList[i].Type == POINT_TYPE_LAND)) && (PointList[i].Position.Status != INVALID))  // jump over POIs and FS-Positions
290
                        if(((PointList[i].Type == POINT_TYPE_WP)||(PointList[i].Type == POINT_TYPE_LAND)) && (PointList[i].Position.Status != INVALID))  // jump over POIs and FS-Positions
291
                        {
291
                        {
292
                                WPIndex = i + 1;
292
                                WPIndex = i + 1;
-
 
293
                                break;
-
 
294
                        }
-
 
295
/*
-
 
296
                        else
-
 
297
                        if((PointList[i].Type == POINT_TYPE_FS) && (PointList[i].Position.Status != INVALID))
-
 
298
                        {
-
 
299
                                GPSPos_Copy(&(PointList[i].Position), &GPS_FailsafePosition);
293
                                wp_nr++;                 // count the number of scipped WPs to make sure that the Index in the NaviData is correct
300
                        }
294
                                if(i >= start) break;
301
*/
295
                        }
302
                }
296
                }
303
                if(WPIndex) // found a WP in the list
297
                if(WPIndex) // found a WP in the list
304
                {
298
                {
305
                        NaviData.WaypointIndex = 1;
299
                        NaviData.WaypointIndex = wp_nr;
306
                        NewWaypointsReceived = 1; // activates the Waypoint list as soon as CH is started
300
                        NewWaypointsReceived = 1; // activates the Waypoint list as soon as CH is started
307
                        // update index to POI
301
                        // update index to POI