Rev 280 | Rev 286 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 280 | Rev 283 | ||
---|---|---|---|
Line 66... | Line 66... | ||
66 | Point_t PointList[MAX_LIST_LEN]; |
66 | Point_t PointList[MAX_LIST_LEN]; |
67 | u8 WPIndex = 0; // list index of GPS point representig the current WP, can be maximal WPCount |
67 | u8 WPIndex = 0; // list index of GPS point representig the current WP, can be maximal WPCount |
68 | u8 POIIndex = 0; // list index of GPS Point representing the current POI, can be maximal WPCount |
68 | u8 POIIndex = 0; // list index of GPS Point representing the current POI, can be maximal WPCount |
69 | u8 WPCount = 0; // number of waypoints |
69 | u8 WPCount = 0; // number of waypoints |
70 | u8 PointCount = 0; // number of wp in the list can be maximal equal to MAX_LIST_LEN |
70 | u8 PointCount = 0; // number of wp in the list can be maximal equal to MAX_LIST_LEN |
- | 71 | u8 POICount = 0; |
|
Line 71... | Line 72... | ||
71 | 72 | ||
Line 72... | Line 73... | ||
72 | u8 WPActive = TRUE; |
73 | u8 WPActive = TRUE; |
73 | 74 | ||
Line 80... | Line 81... | ||
80 | { |
81 | { |
81 | u8 i; |
82 | u8 i; |
82 | WPIndex = 0; // real list position are 1 ,2, 3 ... |
83 | WPIndex = 0; // real list position are 1 ,2, 3 ... |
83 | POIIndex = 0; // real list position are 1 ,2, 3 ... |
84 | POIIndex = 0; // real list position are 1 ,2, 3 ... |
84 | WPCount = 0; // no waypoints |
85 | WPCount = 0; // no waypoints |
- | 86 | POICount = 0; |
|
85 | PointCount = 0; // no contents |
87 | PointCount = 0; // no contents |
86 | WPActive = TRUE; |
88 | WPActive = TRUE; |
87 | NaviData.WaypointNumber = WPCount; |
89 | NaviData.WaypointNumber = WPCount; |
88 | NaviData.WaypointIndex = 0; |
90 | NaviData.WaypointIndex = 0; |
Line 111... | Line 113... | ||
111 | { |
113 | { |
112 | if((PointCount < MAX_LIST_LEN) && (pPoint->Index == (PointCount + 1)) ) // there is still some space in the list and index points to next |
114 | if((PointCount < MAX_LIST_LEN) && (pPoint->Index == (PointCount + 1)) ) // there is still some space in the list and index points to next |
113 | { |
115 | { |
114 | memcpy(&PointList[PointCount], pPoint, sizeof(Point_t)); // copy data to list entry // increment list length |
116 | memcpy(&PointList[PointCount], pPoint, sizeof(Point_t)); // copy data to list entry // increment list length |
115 | if(PointList[PointCount].Type == POINT_TYPE_WP) WPCount++; |
117 | if(PointList[PointCount].Type == POINT_TYPE_WP) WPCount++; |
- | 118 | if(PointList[PointCount].Type == POINT_TYPE_POI) POICount++; |
|
116 | NaviData.WaypointNumber = WPCount; |
119 | NaviData.WaypointNumber = WPCount; |
117 | PointCount++; |
120 | PointCount++; |
118 | if(PointCount == 1) // only for the first entry |
121 | if(PointCount == 1) // only for the first entry |
119 | { |
122 | { |
120 | // update POI index |
123 | // update POI index |
Line 125... | Line 128... | ||
125 | else POIIndex = 0; |
128 | else POIIndex = 0; |
126 | break; |
129 | break; |
Line 127... | Line 130... | ||
127 | 130 | ||
128 | case POINT_TYPE_POI: |
131 | case POINT_TYPE_POI: |
- | 132 | POIIndex = 1; |
|
129 | POIIndex = 1; |
133 | POICount = 1; |
Line 130... | Line 134... | ||
130 | break; |
134 | break; |
131 | 135 | ||
132 | default: |
136 | default: |
Line 142... | Line 146... | ||
142 | // returns the pointer to the first waypoint within the list |
146 | // returns the pointer to the first waypoint within the list |
143 | Point_t* PointList_WPBegin(void) |
147 | Point_t* PointList_WPBegin(void) |
144 | { |
148 | { |
145 | u8 i; |
149 | u8 i; |
146 | WPIndex = 0; // set list position invalid |
150 | WPIndex = 0; // set list position invalid |
147 | POIIndex = 0; // set invalid POI |
- | |
148 | - | ||
149 | if(WPActive == FALSE) return(NULL); |
151 | if(WPActive == FALSE) return(NULL); |
150 | - | ||
- | 152 | POIIndex = 0; // set invalid POI |
|
151 | if(PointCount > 0) |
153 | if(PointCount > 0) |
152 | { |
154 | { |
153 | // search for first wp in list |
155 | // search for first wp in list |
154 | for(i = 0; i <PointCount; i++) |
156 | for(i = 0; i <PointCount; i++) |
155 | { |
157 | { |
Line 195... | Line 197... | ||
195 | { |
197 | { |
Line 196... | Line 198... | ||
196 | 198 | ||
197 | u8 i; |
199 | u8 i; |
198 | WPIndex = 0; // set list position invalid |
200 | WPIndex = 0; // set list position invalid |
- | 201 | POIIndex = 0; // set invalid |
|
199 | POIIndex = 0; // set invalid |
202 | |
Line 200... | Line 203... | ||
200 | if(WPActive == FALSE) return(NULL); |
203 | if(WPActive == FALSE) return(NULL); |
201 | 204 | ||
202 | if(PointCount > 0) |
205 | if(PointCount > 0) |