70,7 → 70,7 |
u8 PointCount = 0; // number of wp in the list can be maximal equal to MAX_LIST_LEN |
u8 POICount = 0; |
|
u8 WPActive = TRUE; |
u8 WPActive = FALSE; |
|
u8 PointList_Init(void) |
{ |
85,7 → 85,7 |
WPCount = 0; // no waypoints |
POICount = 0; |
PointCount = 0; // no contents |
WPActive = TRUE; |
WPActive = FALSE; |
NaviData.WaypointNumber = WPCount; |
NaviData.WaypointIndex = 0; |
|
119,10 → 119,9 |
u8 PointList_SetAt(Point_t* pPoint) |
{ |
// if index is in range |
if((pPoint->Index > 0) && (pPoint->Index < MAX_LIST_LEN)) |
if((pPoint->Index > 0) && (pPoint->Index <= MAX_LIST_LEN)) |
{ |
// check list entry before update |
if(PointList[pPoint->Index-1].Type) |
switch(PointList[pPoint->Index-1].Type) |
{ |
case POINT_TYPE_INVALID: // was invalid |
189,7 → 188,7 |
NaviData.WaypointNumber = WPCount; |
return pPoint->Index; |
} |
else return 0; |
else return(0); |
} |
|
// returns the pointer to the first waypoint within the list |
217,8 → 216,7 |
NaviData.WaypointIndex = 1; |
// update index to POI |
if(PointList[WPIndex-1].Heading < 0) POIIndex = (u8)(-PointList[WPIndex-1].Heading); |
else POIIndex = 0; |
return(&(PointList[WPIndex-1])); // if list is not empty return pointer to first waypoint in the list |
else POIIndex = 0; |
} |
else // some points in the list but no WP found |
{ |