mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 13:58:53 +08:00
Fix whitespace
This commit is contained in:
@@ -193,7 +193,7 @@ build_gps_response(uint8_t *buffer, size_t *size)
|
|||||||
bool updated;
|
bool updated;
|
||||||
orb_check(home_sub, &updated);
|
orb_check(home_sub, &updated);
|
||||||
if (updated) {
|
if (updated) {
|
||||||
/* get a local copy of the home position data */
|
/* get a local copy of the home position data */
|
||||||
struct home_position_s home;
|
struct home_position_s home;
|
||||||
memset(&home, 0, sizeof(home));
|
memset(&home, 0, sizeof(home));
|
||||||
orb_copy(ORB_ID(home_position), home_sub, &home);
|
orb_copy(ORB_ID(home_position), home_sub, &home);
|
||||||
@@ -205,7 +205,7 @@ build_gps_response(uint8_t *buffer, size_t *size)
|
|||||||
|
|
||||||
/* Distance from home */
|
/* Distance from home */
|
||||||
if (home_position_set) {
|
if (home_position_set) {
|
||||||
uint16_t dist = (uint16_t)get_distance_to_next_waypoint(home_lat, home_lon, lat, lon);
|
uint16_t dist = (uint16_t)get_distance_to_next_waypoint(home_lat, home_lon, lat, lon);
|
||||||
|
|
||||||
msg.distance_L = (uint8_t)dist & 0xff;
|
msg.distance_L = (uint8_t)dist & 0xff;
|
||||||
msg.distance_H = (uint8_t)(dist >> 8) & 0xff;
|
msg.distance_H = (uint8_t)(dist >> 8) & 0xff;
|
||||||
@@ -213,7 +213,7 @@ build_gps_response(uint8_t *buffer, size_t *size)
|
|||||||
/* Direction back to home */
|
/* Direction back to home */
|
||||||
uint16_t bearing = (uint16_t)(get_bearing_to_next_waypoint(home_lat, home_lon, lat, lon) * M_RAD_TO_DEG_F);
|
uint16_t bearing = (uint16_t)(get_bearing_to_next_waypoint(home_lat, home_lon, lat, lon) * M_RAD_TO_DEG_F);
|
||||||
msg.home_direction = (uint8_t)bearing >> 1;
|
msg.home_direction = (uint8_t)bearing >> 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.stop = STOP_BYTE;
|
msg.stop = STOP_BYTE;
|
||||||
@@ -223,11 +223,11 @@ build_gps_response(uint8_t *buffer, size_t *size)
|
|||||||
void
|
void
|
||||||
convert_to_degrees_minutes_seconds(double val, int *deg, int *min, int *sec)
|
convert_to_degrees_minutes_seconds(double val, int *deg, int *min, int *sec)
|
||||||
{
|
{
|
||||||
*deg = (int)val;
|
*deg = (int)val;
|
||||||
|
|
||||||
double delta = val - *deg;
|
double delta = val - *deg;
|
||||||
const double min_d = delta * 60.0d;
|
const double min_d = delta * 60.0d;
|
||||||
*min = (int)min_d;
|
*min = (int)min_d;
|
||||||
delta = min_d - *min;
|
delta = min_d - *min;
|
||||||
*sec = (int)(delta * 10000.0d);
|
*sec = (int)(delta * 10000.0d);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user