Rev 160 | Rev 163 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 160 | Rev 162 | ||
---|---|---|---|
Line 412... | Line 412... | ||
412 | break; |
412 | break; |
413 | } |
413 | } |
414 | break; |
414 | break; |
Line 415... | Line 415... | ||
415 | 415 | ||
- | 416 | case 'w':// Append Waypoint to List |
|
- | 417 | { |
|
- | 418 | static u8 oldIndex = 0x00; |
|
416 | case 'w':// Append Waypoint to List |
419 | |
417 | pWaypoint = (Waypoint_t*)SerialMsg.pData; |
420 | pWaypoint = (Waypoint_t*)SerialMsg.pData; |
418 | if(pWaypoint->Position.Status == INVALID) |
421 | if(pWaypoint->Position.Status == INVALID) |
419 | { // clear WP List |
422 | { // clear WP List |
- | 423 | WPList_Clear(); |
|
420 | WPList_Clear(); |
424 | oldIndex = 0x00; |
421 | GPS_pWaypoint = WPList_Begin(); |
425 | GPS_pWaypoint = WPList_Begin(); |
- | 426 | //UART1_PutString("\r\nClear WP List\r\n"); |
|
422 | //UART1_PutString("\r\nClear WP List\r\n"); |
427 | UART1_Request_NewWaypoint = TRUE; |
423 | } |
428 | } |
424 | else if (pWaypoint->Position.Status == NEWDATA) |
429 | else if (pWaypoint->Position.Status == NEWDATA) |
- | 430 | { // app current WP to the list |
|
- | 431 | if (pWaypoint->Index == oldIndex + 1) |
|
425 | { // app current WP to the list |
432 | { |
426 | WPList_Append(pWaypoint); |
433 | WPList_Append(pWaypoint); |
427 | BeepTime = 500; |
434 | BeepTime = 500; |
428 | //UART1_PutString("\r\nAdd WP to List\r\n"); |
- | |
429 | } |
435 | oldIndex = pWaypoint->Index; |
- | 436 | UART1_Request_NewWaypoint = TRUE; |
|
- | 437 | } |
|
- | 438 | ||
- | 439 | sprintf(text, "\r\nAdd WP: Index= %d, oldIndex = %d\r\n", pWaypoint->Index, oldIndex); |
|
- | 440 | UART1_PutString(text); |
|
- | 441 | } |
|
430 | UART1_Request_NewWaypoint = TRUE; |
442 | } |
Line 431... | Line 443... | ||
431 | break; |
443 | break; |
432 | 444 | ||
433 | case 'x':// Read Waypoint from List |
445 | case 'x':// Read Waypoint from List |