522,8 → 522,8 |
|
|
#define LINE_MAX 70 |
#define WP_FILE_VERSION_COMPATIBLE 3 |
#define WP_FILE_VERSION_COMPATIBLE2 4 |
#define WP_FILE_VERSION_COMPATIBLE_OLD 3 |
#define WP_FILE_VERSION_COMPATIBLE 4 |
|
u8 PointList_Save(u8 * filename, u8* listname, u8 overwride) |
{ |
614,7 → 614,7 |
// write speed in 0.1 m/s |
sprintf(wpline, "Speed=%d\r\n", PointList[i].Speed); |
fputs_(wpline, fp); |
// write cam angle in degree (255 -> POI-Automatic) |
// write cam angle in degree (121 -> POI-Automatic) |
sprintf(wpline, "CAM-Nick=%d\r\n", PointList[i].CamAngle); |
fputs_(wpline, fp); |
// write point type |
657,6 → 657,7 |
u8 IsGeneralSection = 0; |
u8 IsPointSection = 0; |
u8 WPNumber = 0; |
u8 fileversion = 0; |
|
// clear point list first |
PointList_Clear(); |
763,7 → 764,9 |
} |
else if(strcmp(name, "CAM-NICK") == 0) |
{ |
PointList[IsPointSection-1].CamAngle = (u8)atoi(value); |
s8 tmp = (s8)atoi(value); |
if(fileversion == WP_FILE_VERSION_COMPATIBLE_OLD) if(tmp == -1) tmp = 121; // 121 is auto since version 4 -> in older versions auto was -1 |
PointList[IsPointSection-1].CamAngle = tmp; |
} |
else if(strcmp(name, "TYPE") == 0) |
{ |
824,7 → 827,8 |
} |
else if (strcmp(name, "FILEVERSION") == 0) |
{ |
if(((u8)atoi(value) != WP_FILE_VERSION_COMPATIBLE) && ((u8)atoi(value) != WP_FILE_VERSION_COMPATIBLE2)) |
fileversion = (u8)atoi(value); |
if((fileversion != WP_FILE_VERSION_COMPATIBLE) && (fileversion != WP_FILE_VERSION_COMPATIBLE_OLD)) |
{ |
PointList_Clear(); |
UART1_PutString("Bad file version!\r\n"); |