Rev 275 | Rev 280 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 275 | Rev 277 | ||
---|---|---|---|
Line 404... | Line 404... | ||
404 | pWaypoint = (Waypoint_t*)SerialMsg.pData; |
404 | pWaypoint = (Waypoint_t*)SerialMsg.pData; |
405 | BeepTime = 300; |
405 | BeepTime = 300; |
406 | if(pWaypoint->Position.Status == NEWDATA) |
406 | if(pWaypoint->Position.Status == NEWDATA) |
407 | { |
407 | { |
408 | WPList_Clear(); // empty WPList |
408 | WPList_Clear(); // empty WPList |
- | 409 | pWaypoint->Index = 1; // must be one after empty list |
|
409 | WPList_Append(pWaypoint); |
410 | WPList_Append(pWaypoint); |
410 | GPS_pWaypoint = WPList_Begin(); |
411 | GPS_pWaypoint = WPList_Begin(); |
411 | } |
412 | } |
412 | break; |
413 | break; |
Line 450... | Line 451... | ||
450 | GPS_pWaypoint = WPList_Begin(); |
451 | GPS_pWaypoint = WPList_Begin(); |
451 | UART1_Request_NewWaypoint = TRUE; // return new WP number |
452 | UART1_Request_NewWaypoint = TRUE; // return new WP number |
452 | } |
453 | } |
453 | else |
454 | else |
454 | { // app current WP to the list |
455 | { // app current WP to the list |
455 | if (pWaypoint->Index == (WPList_GetCount() + 1)) |
456 | if(WPList_Append(pWaypoint)) |
456 | { |
457 | { |
457 | WPList_Append(pWaypoint); |
- | |
458 | BeepTime = 500; |
458 | BeepTime = 500; |
459 | UART1_Request_NewWaypoint = TRUE; // return new WP number |
459 | UART1_Request_NewWaypoint = TRUE; // return new WP number |
460 | } |
460 | } |
461 | } |
461 | } |
462 | } |
462 | } |