Subversion Repositories NaviCtrl

Compare Revisions

Ignore whitespace Rev 518 → Rev 519

/trunk/main.c
614,6 → 614,9
}
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
GPS_pWaypoint = PointList_WPBegin(); // updates POI index
SpeakWaypointRached = 1; // Speak once when the last Point is reached
SpeakNextWaypoint = 1; // Speak once as soon as the Points are active
NCFlags &= ~NC_FLAG_TARGET_REACHED;
BeepTime = 150;
}
}
636,6 → 639,9
{
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
GPS_pWaypoint = PointList_WPBegin(); // updates POI index
SpeakWaypointRached = 1; // Speak once when the last Point is reached
SpeakNextWaypoint = 1; // Speak once as soon as the Points are active
NCFlags &= ~NC_FLAG_TARGET_REACHED;
BeepTime = 150;
}
}
/trunk/main.h
14,7 → 14,7
 
#define VERSION_MAJOR 2
#define VERSION_MINOR 5
#define VERSION_PATCH 3
#define VERSION_PATCH 4
// 0 = A
// 1 = B
// 2 = C
36,7 → 36,7
// 18 = S
 
#ifndef FOLLOW_ME
#define FC_SPI_COMPATIBLE 64 // <------------------
#define FC_SPI_COMPATIBLE 65 // <------------------
#else
#define FC_SPI_COMPATIBLE 0xFF
#endif
179,6 → 179,7
u8 FromFC_LandingSpeed;
u8 FromFC_LowVoltageHomeActive;
u8 AutoPhotoAltitudes; // Distance between Photo releases (Altitudes)
u8 SingleWpSpeed;
} __attribute__((packed)) Param_t;
 
typedef struct
219,5 → 220,7
extern u16 SD_ComingHomeSpeed;
extern u16 SD_DPH_Speed;
extern u32 MaxRadius_in_m;
extern u8 SpeakWaypointRached; // Speak once as soon as the Points are active
extern u8 SpeakNextWaypoint; // Speak once when reached
 
#endif // _MAIN_H
/trunk/spi_slave.h
57,6 → 57,10
#define CHK_POTI(b,a) { if(a < 248) b = a; else b = FC.Poti[255 - a]; }
#define CHK_POTI_MM(b,a,min,max) {CHK_POTI(b,a); LIMIT_MIN_MAX(b, min, max); }
 
// devides only the Poti-value
#define CHK_POTI_DIV(b,a,div) { if(a < 248) b = a; else b = FC.Poti[255 - a] / div; }
#define CHK_POTI_MM_DIV(b,a,min,max,div) {CHK_POTI_DIV(b,a,div); LIMIT_MIN_MAX(b, min, max); }
 
extern s32 Kalman_K;
extern s32 Kalman_Kompass ;
extern s32 Kalman_MaxDrift;
/trunk/uart1.c
160,9 → 160,9
"I2C Error ",
"I2C Okay ", //15
"16 dist (cm) ",
"17 ",
"18 ",
"19 ", // SD-Card-time
"17 alt dist ",
"18 time ",
"19 climb ", // SD-Card-time
"EarthMagnet [%] ", //20
"Ground Speed ", // "Z_Speed ",
"N_Speed ",
502,9 → 502,11
}
else UART1_Request_WritePoint = PointList_SetAt(pPoint);
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
SpeakWaypointRached = 1; // Speak once when the last Point is reached
if(UART1_Request_WritePoint == pPoint->Index)
{
BeepTime = 500;
if(UART1_Request_WritePoint == 1) SpeakNextWaypoint = 1; // Speak once as soon as the Points are active
}
}
}
/trunk/uart1.h
157,7 → 157,7
extern u8 text[]; // globally used text buffer
extern u8 UART1_Request_SendFollowMe;
extern u8 LastTransmittedFCStatusFlags2;
 
extern u8 UART1_Request_ReadPoint;
extern WPL_Store_t WPL_Store;
 
extern u32 NMEA_Interval;// in ms
/trunk/waypoints.c
96,7 → 96,6
WPActive = FALSE;
NaviData.WaypointNumber = WPCount;
NaviData.WaypointIndex = 0;
for(i = 0; i < MAX_LIST_LEN; i++)
{
PointList[i].Position.Status = INVALID;
481,7 → 480,7
return(retval);
}
 
u8 PointList_Load(u8 * filename, u8* listname, u8 listnamelen)
u8 PointList_Load(u8 * filename, u8* listname, u8 listnamelen, u8 use_preset_speed)
{
File_t *fp;
s8 wpline[LINE_MAX];
594,7 → 593,8
}
else if(strcmp(name, "SPEED") == 0)
{
PointList[IsPointSection-1].Speed = (u8)atoi(value);
if(use_preset_speed) PointList[IsPointSection-1].Speed = use_preset_speed;
else PointList[IsPointSection-1].Speed = (u8)atoi(value);
}
else if(strcmp(name, "CAM-NICK") == 0)
{
717,7 → 717,7
{
sprintf(filename, "/WPL/list_%03d.wpl", pWPL_Store->Index);
}
return PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name));
return PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name),0);
}
 
// save actual point list to SD card
757,19 → 757,30
// clear current point list
PointList_Clear();
// prepare WP at current position
 
if(NCFlags & NC_FLAG_FREE || NaviData.TargetPositionDeviation.Distance > 7*10)
{ // take actual position
GPSPos_Copy(&GPSData.Position, &(WP.Position));
}
else
{ // take last target position
GPSPos_Copy(&NaviData.TargetPosition, &(WP.Position));
}
 
GPSPos_Copy(&GPSData.Position, &(WP.Position));
// set heading
WP.Heading = CompassSetpointCorrected/10;
if(WP.Heading == 0) WP.Heading = 360;
WP.ToleranceRadius = 15;
WP.HoldTime = 5;
WP.ToleranceRadius = 120; // 12m
WP.HoldTime = 2;
WP.Index = 1;
WP.Type = POINT_TYPE_WP;
WP.WP_EventChannelValue = 0;
if(FC.StatusFlags & FC_STATUS_FLY)
if(FC.StatusFlags & FC_STATUS_FLY && (FromFC_VarioCharacter != ' ')) // only in flight and if the Altitude control is enabled
{
WP.AltitudeRate = 15;
WP.Position.Altitude = NaviData.Altimeter / 2;
WP.AltitudeRate = 255; // Auto
// WP.Position.Altitude = NaviData.Altimeter / 2;
WP.Position.Altitude = NaviData.SetpointAltitude / 2;
}
else
{
776,7 → 787,7
WP.AltitudeRate = 0;
WP.Position.Altitude = 0;
}
WP.Speed = SD_ComingHomeSpeed;
WP.Speed = 50; // beim Laden wird der Wert nochmal neu gesetzt
WP.CamAngle = 0;
WP.Name[0] = 'P';
WP.Name[1] = 0;
789,17 → 800,25
retval = PointList_Save(filename, pWPL_Store->Name, 1);
 
// clear current point list
PointList_Clear();
if((NC_GPS_ModeCharacter != 'w') && (NC_GPS_ModeCharacter != 'W')) PointList_Clear();
else
{
if(FC.StatusFlags & FC_STATUS_FLY) PointList_WPActive(TRUE);
GPS_pWaypoint = PointList_WPBegin(); // updates POI index
}
 
return(retval);
}
// load target gps posititon and heading from file
u8 PointList_LoadSinglePoint(WPL_Store_t * pWPL_Store)
{
u8 filename[30];
u8 filename[30], result = 0;
sprintf(filename, "/POINT/POINT%03d.wpl", pWPL_Store->Index);
pWPL_Store->Name[0] = 0; // clear current list name
return PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name));
result = PointList_Load(filename, pWPL_Store->Name, sizeof(pWPL_Store->Name),Parameter.SingleWpSpeed);
if(result) UART1_Request_ReadPoint = 1; // Sends Point 1 to the PC
return(result);
}