Subversion Repositories NaviCtrl

Rev

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

Rev 533 Rev 540
Line 612... Line 612...
612
                   {
612
                   {
613
                                if(PointList_ReadFromFile(&WPL_Store) == WPL_OK)
613
                                if(PointList_ReadFromFile(&WPL_Store) == WPL_OK)
614
                                {
614
                                {
615
                                        if(FromFC_LoadWP_List & 0x80)// -> load relative
615
                                        if(FromFC_LoadWP_List & 0x80)// -> load relative
616
                                        {
616
                                        {
-
 
617
                                         u32 angle;
-
 
618
                                         angle = (360 + GyroCompassCorrected/10 + Parameter.OrientationAngle * 15) % 360;
617
                                                if(NCFlags & NC_FLAG_FREE || NaviData.TargetPositionDeviation.Distance > 7*10)
619
                                                if(NCFlags & NC_FLAG_FREE || NaviData.TargetPositionDeviation.Distance > 7*10)
618
                                        {  // take actual position
620
                                        {  // take actual position
619
                                                if(!PointList_Move(1,&(GPSData.Position),NaviData.CompassHeading))      PointList_Clear();      // try to move wp-list so that 1st entry matches the current position 
621
                                                if(!PointList_Move(1,&(GPSData.Position),angle)) PointList_Clear();     // try to move wp-list so that 1st entry matches the current position 
620
                                                }
622
                                                }
621
                                        else
623
                                        else
622
                                                {  // take last target position
624
                                                {  // take last target position
623
                                                if(!PointList_Move(1, &(NaviData.TargetPosition),NaviData.CompassHeading))      PointList_Clear();      // try to move wp-list so that 1st entry matches the current position 
625
                                                if(!PointList_Move(1, &(NaviData.TargetPosition),angle)) PointList_Clear();     // try to move wp-list so that 1st entry matches the current position 
624
                                                }
626
                                                }
625
                                        }
627
                                        }
626
                                        if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
628
                                        if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
627
                                        GPS_pWaypoint = PointList_WPBegin(); // updates POI index
629
                                        GPS_pWaypoint = PointList_WPBegin(); // updates POI index
628
                                        SpeakWaypointRached = 1;        // Speak once when the last Point is reached
630
                                        SpeakWaypointRached = 1;        // Speak once when the last Point is reached