Rev 463 | Rev 470 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 463 | Rev 466 | ||
---|---|---|---|
Line 108... | Line 108... | ||
108 | u8 UART1_DisplayLine = 0; |
108 | u8 UART1_DisplayLine = 0; |
109 | u8 UART1_ConfirmFrame = 0; |
109 | u8 UART1_ConfirmFrame = 0; |
110 | u8 UART1_Request_FTP = FALSE; |
110 | u8 UART1_Request_FTP = FALSE; |
111 | u8 LastTransmittedFCStatusFlags2 = 0; |
111 | u8 LastTransmittedFCStatusFlags2 = 0; |
112 | u8 UART1_ExternalControlConfirmFrame = FALSE; |
112 | u8 UART1_ExternalControlConfirmFrame = FALSE; |
- | 113 | u8 Send_NMEA_RMC = FALSE; |
|
Line 113... | Line 114... | ||
113 | 114 | ||
Line 114... | Line 115... | ||
114 | UART_TypeDef *DebugUART = UART1; |
115 | UART_TypeDef *DebugUART = UART1; |
115 | 116 | ||
Line 679... | Line 680... | ||
679 | } |
680 | } |
Line 680... | Line 681... | ||
680 | 681 | ||
681 | //$GPGGA,HHMMSS.ss,BBBB.BBBB,b,LLLLL.LLLL,l,Q,NN,D.D,H.H,h,G.G,g,A.A,RRRR*PP |
682 | //$GPGGA,HHMMSS.ss,BBBB.BBBB,b,LLLLL.LLLL,l,Q,NN,D.D,H.H,h,G.G,g,A.A,RRRR*PP |
682 | //$GPGGA,191410,4735.5634,N,00739.3538,E,1,04,4.4,351.5,M,48.0,M,,*45 |
683 | //$GPGGA,191410,4735.5634,N,00739.3538,E,1,04,4.4,351.5,M,48.0,M,,*45 |
- | 684 | //$GPGGA,092120.20,,,,,0,00,99.99,,,,,,*6C |
|
683 | //$GPGGA,092120.20,,,,,0,00,99.99,,,,,,*6C |
685 | //http://www.kowoma.de/gps/zusatzerklaerungen/NMEA.htm |
684 | void CreateNmeaGGA(void) |
686 | void CreateNmeaGGA(void) |
685 | { |
687 | { |
686 | unsigned char array[100], i = 0, crc = 0, x; |
688 | unsigned char array[200], i = 0, crc = 0, x; |
687 | long tmp1, tmp2; |
689 | long tmp1, tmp2; |
688 | i += sprintf(array, "$GPGGA,"); |
690 | i += sprintf(array, "$GPGGA,"); |
689 | // +++++++++++++++++++++++++++++++++++++++++++ |
691 | // +++++++++++++++++++++++++++++++++++++++++++ |
690 | if(SystemTime.Valid) |
692 | if(SystemTime.Valid) |
Line 745... | Line 747... | ||
745 | } |
747 | } |
746 | i += sprintf(&array[i], "%02x%c%c",crc,0x0d,0x0a); |
748 | i += sprintf(&array[i], "%02x%c%c",crc,0x0d,0x0a); |
747 | AddSerialData(&UART1_tx_buffer,array,i); |
749 | AddSerialData(&UART1_tx_buffer,array,i); |
Line 748... | Line 750... | ||
748 | 750 | ||
- | 751 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 752 | } |
|
- | 753 | ||
- | 754 | //$GPRMC,162614.123,A,5230.5900,N,01322.3900,E,10.0,90.0,131006,1.2,E,A*13 |
|
- | 755 | //$GPRMC,HHMMSS.sss,A,BBBB.BBBB,b,LLLLL.LLLL,l,GG.G,RR.R,DDMMYY,M.M,m,F*PP |
|
- | 756 | ||
- | 757 | void CreateNmeaRMC(void) |
|
- | 758 | { |
|
- | 759 | unsigned char array[200], i = 0, crc = 0, x; |
|
- | 760 | int tmp_int; |
|
- | 761 | long tmp1, tmp2; |
|
- | 762 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 763 | i += sprintf(array, "$GPRMC,"); |
|
- | 764 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 765 | if(SystemTime.Valid) |
|
- | 766 | { |
|
- | 767 | i += sprintf(&array[i], "%02d%02d%02d.%03d,",SystemTime.Hour,SystemTime.Min,SystemTime.Sec,SystemTime.mSec); |
|
- | 768 | } |
|
- | 769 | else |
|
- | 770 | { |
|
- | 771 | i += sprintf(&array[i], ","); |
|
- | 772 | } |
|
- | 773 | if(GPSData.Flags & FLAG_GPSFIXOK) |
|
- | 774 | { |
|
- | 775 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 776 | tmp1 = abs(GPSData.Position.Latitude)/10000000L; |
|
- | 777 | i += sprintf(&array[i],"A,%02d",tmp1); // Status: A = Okay V = Warnung |
|
- | 778 | ||
- | 779 | tmp1 = abs(GPSData.Position.Latitude)%10000000L; |
|
- | 780 | tmp1 *= 6; // in Minuten |
|
- | 781 | tmp2 = tmp1 / 1000000L; |
|
- | 782 | i += sprintf(&array[i],"%02d",tmp2); |
|
- | 783 | tmp2 = tmp1 % 1000000L; |
|
- | 784 | tmp2 /= 10; // eine Stelle zu viel |
|
- | 785 | i += sprintf(&array[i],".%05d,",tmp2); |
|
- | 786 | if(GPSData.Position.Latitude >= 0) i += sprintf(&array[i],"N,"); |
|
- | 787 | else i += sprintf(&array[i],"S,"); |
|
- | 788 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 789 | tmp1 = abs(GPSData.Position.Longitude)/10000000L; |
|
- | 790 | i += sprintf(&array[i],"%03d",tmp1); |
|
- | 791 | ||
- | 792 | tmp1 = abs(GPSData.Position.Longitude)%10000000L; |
|
- | 793 | tmp1 *= 6; // in Minuten |
|
- | 794 | tmp2 = tmp1 / 1000000L; |
|
- | 795 | i += sprintf(&array[i],"%02d",tmp2); |
|
- | 796 | tmp2 = tmp1 % 1000000L; |
|
- | 797 | tmp2 /= 10; // eine Stelle zu viel |
|
- | 798 | i += sprintf(&array[i],".%05d,",tmp2); |
|
- | 799 | if(GPSData.Position.Longitude >= 0) i += sprintf(&array[i],"E,"); |
|
- | 800 | else i += sprintf(&array[i],"W,"); |
|
- | 801 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 802 | tmp_int = GPSData.Speed_Ground; // in cm/sek |
|
- | 803 | tmp_int *= 90; |
|
- | 804 | tmp_int /= 463; |
|
- | 805 | i += sprintf(&array[i],"%02d.%d,",tmp_int/10,tmp_int%10); // in Knoten |
|
- | 806 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 807 | i += sprintf(&array[i],"%03d.%d,",GyroCompassCorrected/10,GyroCompassCorrected%10); |
|
- | 808 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 809 | if(SystemTime.Valid) |
|
- | 810 | { |
|
- | 811 | i += sprintf(&array[i], "%02d%02d%02d,",SystemTime.Day,SystemTime.Month,SystemTime.Year); |
|
- | 812 | } |
|
- | 813 | else |
|
- | 814 | { |
|
- | 815 | i += sprintf(&array[i], ","); |
|
- | 816 | } |
|
- | 817 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 818 | i += sprintf(&array[i],"%d.%1d,", abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
|
- | 819 | if(GeoMagDec < 0) i += sprintf(&array[i], "W,"); else i += sprintf(&array[i], "E,"); |
|
- | 820 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 821 | if(GPSData.Flags & FLAG_DIFFSOLN) i += sprintf(&array[i], "D,"); |
|
- | 822 | else i += sprintf(&array[i], "A,"); |
|
- | 823 | } |
|
- | 824 | else // kein Satfix |
|
- | 825 | { |
|
- | 826 | i += sprintf(&array[i], "V,,,,,,,,,,N*"); |
|
- | 827 | } |
|
- | 828 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 829 | // CRC |
|
- | 830 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 831 | for(x=1; x<i-1; x++) |
|
- | 832 | { |
|
- | 833 | crc ^= array[x]; |
|
- | 834 | } |
|
- | 835 | i += sprintf(&array[i], "%02x%c%c",crc,0x0d,0x0a); |
|
- | 836 | // +++++++++++++++++++++++++++++++++++++++++++ |
|
- | 837 | AddSerialData(&UART1_tx_buffer,array,i); |
|
749 | // +++++++++++++++++++++++++++++++++++++++++++ |
838 | // +++++++++++++++++++++++++++++++++++++++++++ |
Line 750... | Line 839... | ||
750 | /* |
839 | /* |
Line 926... | Line 1015... | ||
926 | UART1_Request_MotorData = FALSE; |
1015 | UART1_Request_MotorData = FALSE; |
927 | } |
1016 | } |
928 | else if((((NMEA_Interval > 0) && CheckDelay(NMEA_Timer))) && (UART1_tx_buffer.Locked == FALSE)) |
1017 | else if((((NMEA_Interval > 0) && CheckDelay(NMEA_Timer))) && (UART1_tx_buffer.Locked == FALSE)) |
929 | { |
1018 | { |
930 | CreateNmeaGGA(); |
1019 | CreateNmeaGGA(); |
- | 1020 | Send_NMEA_RMC = TRUE; // das muss noch da hinter |
|
931 | NMEA_Timer = SetDelay(NMEA_Interval); |
1021 | NMEA_Timer = SetDelay(NMEA_Interval); |
932 | } |
1022 | } |
- | 1023 | else if(Send_NMEA_RMC == TRUE && (UART1_tx_buffer.Locked == FALSE)) |
|
- | 1024 | { |
|
- | 1025 | CreateNmeaRMC(); |
|
- | 1026 | Send_NMEA_RMC = FALSE; |
|
- | 1027 | } |
|
Line 933... | Line 1028... | ||
933 | 1028 | ||
934 | /* |
1029 | /* |
935 | else if(UART1_ConfirmFrame && (UART1_tx_buffer.Locked == FALSE)) |
1030 | else if(UART1_ConfirmFrame && (UART1_tx_buffer.Locked == FALSE)) |
936 | { |
1031 | { |