MoveWaypoint() moved from nav to common_nav

This commit is contained in:
Pascal Brisset
2008-02-05 02:40:34 +00:00
parent 9da71e3709
commit d8ae991b72
2 changed files with 11 additions and 10 deletions
+11
View File
@@ -3,6 +3,7 @@
#include "std.h"
extern float max_dist_from_home;
extern float dist2_to_home;
extern float dist2_to_wp;
extern bool_t too_far_from_home;
@@ -17,6 +18,16 @@ struct point {
#define WaypointY(_wp) (waypoints[_wp].y)
#define WaypointAlt(_wp) (waypoints[_wp].a)
#define MoveWaypoint(_id, _ux, _uy, _a) { \
if (_id < nb_waypoint) { \
waypoints[_id].x = _ux - nav_utm_east0; \
waypoints[_id].y = _uy - nav_utm_north0; \
BoundAbs(waypoints[_id].x, max_dist_from_home); \
BoundAbs(waypoints[_id].y, max_dist_from_home); \
waypoints[_id].a = _a; \
} \
}
extern const uint8_t nb_waypoint;
extern struct point waypoints[];
/** size == nb_waypoint, waypoint 0 is a dummy waypoint */
-10
View File
@@ -66,16 +66,6 @@ extern uint8_t horizontal_mode;
#define HORIZONTAL_MODE_ROUTE 1
#define HORIZONTAL_MODE_CIRCLE 2
#define MoveWaypoint(_id, _ux, _uy, _a) { \
if (_id < nb_waypoint) { \
waypoints[_id].x = _ux - nav_utm_east0; \
waypoints[_id].y = _uy - nav_utm_north0; \
Bound(waypoints[_id].x, -MAX_DIST_FROM_HOME, MAX_DIST_FROM_HOME); \
Bound(waypoints[_id].y, -MAX_DIST_FROM_HOME, MAX_DIST_FROM_HOME); \
waypoints[_id].a = _a; \
} \
}
extern void nav_eight_init( void );
extern void nav_eight(uint8_t, uint8_t, float);
#define Eight(a, b, c) nav_eight((a), (b), (c))