Browse Source

Copter: minor casting fixup for wp_distance

mission-4.1.18
Randy Mackay 12 years ago
parent
commit
6f5050a8b9
  1. 6
      ArduCopter/commands_logic.pde
  2. 2
      libraries/AP_InertialSensor/AP_InertialSensor.cpp

6
ArduCopter/commands_logic.pde

@ -391,7 +391,7 @@ static bool verify_nav_wp() @@ -391,7 +391,7 @@ static bool verify_nav_wp()
}
// Did we pass the WP? // Distance checking
if((wp_distance <= (unsigned long)max((g.waypoint_radius * 100),0)) || check_missed_wp()) {
if((wp_distance <= (uint32_t)max((g.waypoint_radius * 100),0)) || check_missed_wp()) {
wp_verify_byte |= NAV_LOCATION;
if(loiter_time == 0) {
loiter_time = millis();
@ -424,7 +424,7 @@ static bool verify_nav_wp() @@ -424,7 +424,7 @@ static bool verify_nav_wp()
static bool verify_loiter_unlimited()
{
if(nav_mode == NAV_WP && wp_distance <= (unsigned long)max((g.waypoint_radius * 100),0)) {
if(nav_mode == NAV_WP && wp_distance <= (uint32_t)max((g.waypoint_radius * 100),0)) {
// switch to position hold
set_nav_mode(NAV_LOITER);
}
@ -620,7 +620,7 @@ static void do_yaw() @@ -620,7 +620,7 @@ static void do_yaw()
static bool verify_wait_delay()
{
//cliSerial->print("vwd");
if ((unsigned)(millis() - condition_start) > (unsigned)condition_value) {
if (millis() - condition_start > (uint32_t)max(condition_value,0)) {
//cliSerial->println("y");
condition_value = 0;
return true;

2
libraries/AP_InertialSensor/AP_InertialSensor.cpp

@ -354,7 +354,7 @@ bool AP_InertialSensor::calibrate_accel(void (*flash_leds_cb)(bool on), @@ -354,7 +354,7 @@ bool AP_InertialSensor::calibrate_accel(void (*flash_leds_cb)(bool on),
break;
}
interact->printf_P(
PSTR("USER: Place APM %S and press any key.\n"), msg);
PSTR("Place APM %S and press any key.\n"), msg);
// wait for user input
interact->blocking_read();

Loading…
Cancel
Save