Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 295 → Rev 296

/trunk/uart1.c
406,7 → 406,8
{
//PointList_Clear(); // flush the list
pPoint->Index = 1; // must be one after empty list
PointList_SetAt(pPoint); //
PointList_SetAt(pPoint);
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
GPS_pWaypoint = PointList_WPBegin(); // updates POI index
BeepTime = 50;
}
454,6 → 455,7
else
{ // update WP in list at index
UART1_Request_WritePoint = PointList_SetAt(pPoint);
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
if(UART1_Request_WritePoint == pPoint->Index)
{
BeepTime = 500;
/trunk/waypoints.c
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
{