Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 161 → Rev 162

/trunk/uart1.c
414,20 → 414,32
break;
 
case 'w':// Append Waypoint to List
{
static u8 oldIndex = 0x00;
pWaypoint = (Waypoint_t*)SerialMsg.pData;
if(pWaypoint->Position.Status == INVALID)
{ // clear WP List
WPList_Clear();
oldIndex = 0x00;
GPS_pWaypoint = WPList_Begin();
//UART1_PutString("\r\nClear WP List\r\n");
UART1_Request_NewWaypoint = TRUE;
}
else if (pWaypoint->Position.Status == NEWDATA)
{ // app current WP to the list
WPList_Append(pWaypoint);
BeepTime = 500;
//UART1_PutString("\r\nAdd WP to List\r\n");
if (pWaypoint->Index == oldIndex + 1)
{
WPList_Append(pWaypoint);
BeepTime = 500;
oldIndex = pWaypoint->Index;
UART1_Request_NewWaypoint = TRUE;
}
sprintf(text, "\r\nAdd WP: Index= %d, oldIndex = %d\r\n", pWaypoint->Index, oldIndex);
UART1_PutString(text);
}
UART1_Request_NewWaypoint = TRUE;
}
break;
 
case 'x':// Read Waypoint from List
/trunk/waypoints.h
10,7 → 10,8
u8 ToleranceRadius; // in meters, if the MK is within that range around the target, then the next target is triggered
u8 HoldTime; // in seconds, if the was once in the tolerance area around a WP, this time defines the delay before the next WP is triggered
u8 Event_Flag; // future implementation
u8 reserve[12]; // reserve
u8 Index; // to indentify different waypoints, workaround for bad communications PC <-> NC
u8 reserve[11]; // reserve
} __attribute__((packed)) Waypoint_t;
 
u8 WPList_Init(void);