Rev 494 | Rev 496 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 494 | Rev 495 | ||
---|---|---|---|
Line 175... | Line 175... | ||
175 | "GPS_Nick ", |
175 | "GPS_Nick ", |
176 | "GPS_Roll ", //30 |
176 | "GPS_Roll ", //30 |
177 | "Used_Sats " |
177 | "Used_Sats " |
178 | }; |
178 | }; |
Line -... | Line 179... | ||
- | 179 | ||
- | 180 | typedef struct |
|
- | 181 | { |
|
- | 182 | u8 Index; |
|
- | 183 | u8 Status; |
|
- | 184 | } __attribute__((packed)) WPL_Answer_t; |
|
- | 185 | WPL_Answer_t WPL_Answer; |
|
179 | 186 | ||
180 | DebugOut_t DebugOut; |
187 | DebugOut_t DebugOut; |
181 | ExternControl_t ExternControl; |
188 | ExternControl_t ExternControl; |
182 | UART_VersionInfo_t UART_VersionInfo; |
189 | UART_VersionInfo_t UART_VersionInfo; |
183 | NaviData_t NaviData; |
190 | NaviData_t NaviData; |
Line 516... | Line 523... | ||
516 | case 'x':// Read Waypoint from List |
523 | case 'x':// Read Waypoint from List |
517 | UART1_Request_ReadPoint = SerialMsg.pData[0]; |
524 | UART1_Request_ReadPoint = SerialMsg.pData[0]; |
518 | break; |
525 | break; |
Line 519... | Line 526... | ||
519 | 526 | ||
- | 527 | case 'i':// Store WP List to file |
|
- | 528 | ||
- | 529 | memcpy((u8*)&WPL_Store, SerialMsg.pData, sizeof(WPL_Store)); |
|
- | 530 | WPL_Store.Name[11] = 0; // make sure the string is terminated |
|
- | 531 | ||
- | 532 | WPL_Answer.Index = WPL_Store.Index; // echo Index |
|
- | 533 | WPL_Answer.Status = WPL_ERROR; // set bad state by default |
|
- | 534 | ||
520 | case 'i':// Store WP List to file |
535 | if(WPL_Store.Index != 0) // valid index |
521 | { |
- | |
522 | memcpy((u8*)&WPL_Store, SerialMsg.pData, sizeof(WPL_Store)); |
- | |
523 | WPL_Store.Name[11] = 0; // make sure the string is terminated |
- | |
524 | WPL_Store.reserved[0] = 0; |
536 | { |
525 | if(WPL_Store.Index != 0) |
537 | if(WPL_Store.Type == WPL_STORE_TYPE_REL) |
526 | { |
- | |
527 | if(WPL_Store.Type == WPL_STORE_TYPE_REL) |
- | |
528 | { |
538 | { |
529 | if(PointList_Move(1, &(GPSData.Position))) |
539 | if(PointList_Move(1, &(NaviData.HomePosition))) |
530 | { |
540 | { |
531 | WPL_Store.reserved[0] = PointList_SaveToFile(WPL_Store.Index, WPL_Store.Name); |
- | |
532 | } |
541 | WPL_Answer.Status = PointList_SaveToFile(&WPL_Store); |
533 | } |
- | |
534 | else |
- | |
535 | { |
- | |
536 | WPL_Store.reserved[0] = PointList_SaveToFile(WPL_Store.Index, WPL_Store.Name); |
- | |
537 | } |
542 | } |
- | 543 | } |
|
- | 544 | else |
|
538 | } |
545 | { |
- | 546 | WPL_Answer.Status = PointList_SaveToFile(&WPL_Store); |
|
539 | UART1_Request_WPLStore = TRUE; |
547 | } |
- | 548 | } |
|
- | 549 | UART1_Request_WPLStore = TRUE; |
|
540 | } |
550 | |
Line 541... | Line 551... | ||
541 | break; |
551 | break; |
542 | 552 | ||
Line 1040... | Line 1050... | ||
1040 | UART1_MotorData_Timer = SetDelay(UART1_MotorData_Interval); |
1050 | UART1_MotorData_Timer = SetDelay(UART1_MotorData_Interval); |
1041 | UART1_Request_MotorData = FALSE; |
1051 | UART1_Request_MotorData = FALSE; |
1042 | } |
1052 | } |
1043 | else if(UART1_Request_WPLStore) |
1053 | else if(UART1_Request_WPLStore) |
1044 | { |
1054 | { |
- | 1055 | /* |
|
- | 1056 | s8 txt[50]; |
|
- | 1057 | sprintf(txt, "\r\nWPL Overwride = %d, Type = %d, Index = %d, Status = %d\r\n", WPL_Store.OverwriteFile, WPL_Store.Type, WPL_Answer.Index, WPL_Answer.Status); |
|
- | 1058 | UART1_PutString(txt); |
|
- | 1059 | */ |
|
1045 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'I', NC_ADDRESS, 2,(u8 *)&(WPL_Store.Index), 1, (u8 *)&(WPL_Store.reserved[0]), 1 ); |
1060 | MKProtocol_CreateSerialFrame(&UART1_tx_buffer, 'I', NC_ADDRESS, 1,(u8 *)&(WPL_Answer), sizeof(WPL_Answer_t)); |
1046 | UART1_Request_WPLStore = FALSE; |
1061 | UART1_Request_WPLStore = FALSE; |
1047 | } |
1062 | } |
1048 | else if((((NMEA_Interval > 0) && CheckDelay(NMEA_Timer))) && (UART1_tx_buffer.Locked == FALSE)) |
1063 | else if((((NMEA_Interval > 0) && CheckDelay(NMEA_Timer))) && (UART1_tx_buffer.Locked == FALSE)) |
1049 | { |
1064 | { |
1050 | CreateNmeaGGA(); |
1065 | CreateNmeaGGA(); |