Subversion Repositories NaviCtrl

Rev

Rev 225 | Rev 231 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 225 Rev 227
Line 435... Line 435...
435
                                }
435
                                }
436
                                break;
436
                                break;
Line 437... Line 437...
437
 
437
 
438
                        case 'w'://  Append Waypoint to List
438
                        case 'w'://  Append Waypoint to List
439
                                {
-
 
440
                                        static u8 nextIndex = 0x01;
-
 
441
 
439
                                {
442
                                        pWaypoint = (Waypoint_t*)SerialMsg.pData;
440
                                        pWaypoint = (Waypoint_t*)SerialMsg.pData;
443
                                        sprintf(text, "\r\nI=%d, S=%d,T=%d\r\n",pWaypoint->Index, pWaypoint->Position.Status, pWaypoint->Type);
441
                                        //sprintf(text, "\r\nI=%d, S=%d,T=%d\r\n",pWaypoint->Index, pWaypoint->Position.Status, pWaypoint->Type);
Line 444... Line 442...
444
                                        UART1_PutString(text);
442
                                        //UART1_PutString(text);
445
 
443
 
446
                                        if(pWaypoint->Position.Status == INVALID)
444
                                        if((pWaypoint->Position.Status == INVALID) && (pWaypoint->Index == 0))
447
                                        {
445
                                        {
448
                                                WPList_Clear();
-
 
449
                                                GPS_pWaypoint = WPList_Begin();
446
                                                WPList_Clear();
450
                                                nextIndex = 0x01;
447
                                                GPS_pWaypoint = WPList_Begin();
451
                                                UART1_Request_NewWaypoint = TRUE; // return new WP number       
448
                                                UART1_Request_NewWaypoint = TRUE; // return new WP number       
452
                                        }
449
                                        }
453
                                        else if(pWaypoint->Position.Status == NEWDATA)
450
                                        else
454
                                        {  // app current WP to the list
451
                                        {  // app current WP to the list
455
                                                if (pWaypoint->Index == nextIndex)
452
                                                if (pWaypoint->Index == (WPList_GetCount() + 1))
456
                                                {
453
                                                {
457
                                                        WPList_Append(pWaypoint);
-
 
458
                                                        BeepTime = 500;
454
                                                        WPList_Append(pWaypoint);
459
                                                        nextIndex = pWaypoint->Index+1;
455
                                                        BeepTime = 500;
460
                                                        UART1_Request_NewWaypoint = TRUE; // return new WP number
456
                                                        UART1_Request_NewWaypoint = TRUE; // return new WP number
461
                                                }
457
                                                }
462
                                        }
458
                                        }