Rev 513 | Rev 515 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 513 | Rev 514 | ||
---|---|---|---|
Line 639... | Line 639... | ||
639 | { |
639 | { |
640 | return(WPL_NO_WAYPOINTS); // we are done here |
640 | return(WPL_NO_WAYPOINTS); // we are done here |
641 | } |
641 | } |
642 | else if(WPNumber > MAX_LIST_LEN) // number o points larger than ram list |
642 | else if(WPNumber > MAX_LIST_LEN) // number o points larger than ram list |
643 | { |
643 | { |
644 | UART1_PutString("To much points!"); |
644 | UART1_PutString("To many points!"); |
645 | return(WPL_ERROR); |
645 | return(WPL_ERROR); |
646 | } |
646 | } |
647 | } |
647 | } |
648 | else if (strcmp(name, "FILEVERSION") == 0) |
648 | else if (strcmp(name, "FILEVERSION") == 0) |
649 | { |
649 | { |
Line 744... | Line 744... | ||
744 | { |
744 | { |
745 | u8 retval = WPL_ERROR; |
745 | u8 retval = WPL_ERROR; |
746 | u8 filename[30]; |
746 | u8 filename[30]; |
747 | Point_t WP; |
747 | Point_t WP; |
Line -... | Line 748... | ||
- | 748 | ||
748 | 749 | UART1_PutString("\n\r write single point\n\r"); |
|
- | 750 | if(GPSData.Position.Status == INVALID) |
|
- | 751 | { |
|
- | 752 | UART1_PutString("ERROR: No GPS - Fix\n\r"); |
|
- | 753 | return(retval); |
|
Line 749... | Line 754... | ||
749 | if(GPSData.Position.Status != INVALID) return(retval); |
754 | } |
750 | 755 | ||
751 | // clear current point list |
756 | // clear current point list |
752 | PointList_Clear(); |
757 | PointList_Clear(); |
753 | // prepare WP at current position |
758 | // prepare WP at current position |
754 | GPSPos_Copy(&GPSData.Position, &(WP.Position)); |
759 | GPSPos_Copy(&GPSData.Position, &(WP.Position)); |
755 | // set heading |
760 | // set heading |
756 | WP.Heading = CompassSetpointCorrected/10; |
761 | WP.Heading = CompassSetpointCorrected/10; |
757 | if(WP.Heading == 0) WP.Heading = 360; |
762 | if(WP.Heading == 0) WP.Heading = 360; |
758 | WP.ToleranceRadius = 0; |
763 | WP.ToleranceRadius = 15; |
759 | WP.HoldTime = 0; |
764 | WP.HoldTime = 5; |
760 | WP.Index = 1; |
765 | WP.Index = 1; |
- | 766 | WP.Type = POINT_TYPE_WP; |
|
- | 767 | WP.WP_EventChannelValue = 0; |
|
761 | WP.Type = POINT_TYPE_WP; |
768 | if(FC.StatusFlags & FC_STATUS_FLY && (NaviData.Altimeter) > 8 * 20) |
- | 769 | { |
|
- | 770 | WP.AltitudeRate = 30; |
|
- | 771 | WP.Position.Altitude = NaviData.Altimeter / 2; |
|
- | 772 | } |
|
762 | WP.WP_EventChannelValue = 0; |
773 | else |
- | 774 | { |
|
- | 775 | WP.AltitudeRate = 0; |
|
- | 776 | WP.Position.Altitude = 0; |
|
763 | WP.AltitudeRate = 0; |
777 | } |
764 | WP.Speed = 0; |
778 | WP.Speed = SD_ComingHomeSpeed; |
765 | WP.CamAngle = 0; |
779 | WP.CamAngle = 0; |
766 | WP.Name[0] = 'P'; |
780 | WP.Name[0] = 'P'; |
767 | WP.Name[1] = 0; |
781 | WP.Name[1] = 0; |
768 | // add this point to wp list |
782 | // add this point to wp list |
769 | PointList_SetAt(&WP); |
783 | PointList_SetAt(&WP); |
- | 784 | ||
770 | 785 | sprintf(filename, "/POINT/POINT%03d.wpl", pWPL_Store->Index); |
|
771 | sprintf(filename, "/WPL/point_%03d.wpl", pWPL_Store->Index); |
786 | UART1_PutString(filename); |
- | 787 | sprintf(pWPL_Store->Name, "POINT%03d ", pWPL_Store->Index); |
|
- | 788 | retval = PointList_Save(filename, pWPL_Store->Name, 1); |
|
- | 789 | ||
772 | sprintf(pWPL_Store->Name, "POINT%03d", pWPL_Store->Index); |
790 | // clear current point list |
773 | retval = PointList_Save(filename, pWPL_Store->Name, 1); |
791 | PointList_Clear(); |
774 | return(retval); |
792 | return(retval); |
775 | } |
793 | } |
776 | // load target gps posititon and heading from file |
794 | // load target gps posititon and heading from file |
777 | u8 PointList_LoadSinglePoint(WPL_Store_t * pWPL_Store) |
795 | u8 PointList_LoadSinglePoint(WPL_Store_t * pWPL_Store) |
Line 778... | Line 796... | ||
778 | { |
796 | { |
779 | u8 filename[30]; |
797 | u8 filename[30]; |
780 | 798 | ||
781 | sprintf(filename, "/WPL/point_%03d.wpl", pWPL_Store->Index); |
799 | sprintf(filename, "/POINT/POINT%03d.wpl", pWPL_Store->Index); |