Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 929 → Rev 930

/trunk/waypoints.c
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");
/trunk/waypoints.h
26,7 → 26,7
u8 WP_EventChannelValue; // Will be transferred to the FC and can be used as Poti value there
u8 AltitudeRate; // rate to change the setpoint in steps of 0.1m/s
u8 Speed; // rate to change the Position(0 = max) in steps of 0.1m/s
u8 CamAngle; // Camera servo angle in degree (255 -> POI-Automatic)
s8 CamAngle; // Camera servo angle in degree (121 -> POI-Automatic since V2.20)
u8 Name[4]; // Name of that point (ASCII)
u8 AutoPhotoDistance; // in [m]
u8 reserve[1]; // reserve