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 |