mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
AP_Mount: use millis/micros/panic functions
This commit is contained in:
parent
513f4fe986
commit
0b2184b818
@ -75,7 +75,7 @@ void AP_Mount_SToRM32::update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// resend target angles at least once per second
|
// resend target angles at least once per second
|
||||||
if (resend_now || ((hal.scheduler->millis() - _last_send) > AP_MOUNT_STORM32_RESEND_MS)) {
|
if (resend_now || ((AP_HAL::millis() - _last_send) > AP_MOUNT_STORM32_RESEND_MS)) {
|
||||||
send_do_mount_control(ToDeg(_angle_ef_target_rad.y), ToDeg(_angle_ef_target_rad.x), ToDeg(_angle_ef_target_rad.z), MAV_MOUNT_MODE_MAVLINK_TARGETING);
|
send_do_mount_control(ToDeg(_angle_ef_target_rad.y), ToDeg(_angle_ef_target_rad.x), ToDeg(_angle_ef_target_rad.z), MAV_MOUNT_MODE_MAVLINK_TARGETING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ void AP_Mount_SToRM32::find_gimbal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return if search time has has passed
|
// return if search time has has passed
|
||||||
if (hal.scheduler->millis() > AP_MOUNT_STORM32_SEARCH_MS) {
|
if (AP_HAL::millis() > AP_MOUNT_STORM32_SEARCH_MS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,5 +154,5 @@ void AP_Mount_SToRM32::send_do_mount_control(float pitch_deg, float roll_deg, fl
|
|||||||
mount_mode);
|
mount_mode);
|
||||||
|
|
||||||
// store time of send
|
// store time of send
|
||||||
_last_send = hal.scheduler->millis();
|
_last_send = AP_HAL::millis();
|
||||||
}
|
}
|
||||||
|
@ -90,9 +90,9 @@ void AP_Mount_SToRM32_serial::update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// resend target angles at least once per second
|
// resend target angles at least once per second
|
||||||
resend_now = resend_now || ((hal.scheduler->millis() - _last_send) > AP_MOUNT_STORM32_SERIAL_RESEND_MS);
|
resend_now = resend_now || ((AP_HAL::millis() - _last_send) > AP_MOUNT_STORM32_SERIAL_RESEND_MS);
|
||||||
|
|
||||||
if ((hal.scheduler->millis() - _last_send) > AP_MOUNT_STORM32_SERIAL_RESEND_MS*2) {
|
if ((AP_HAL::millis() - _last_send) > AP_MOUNT_STORM32_SERIAL_RESEND_MS*2) {
|
||||||
_reply_type = ReplyType_UNKNOWN;
|
_reply_type = ReplyType_UNKNOWN;
|
||||||
}
|
}
|
||||||
if (can_send(resend_now)) {
|
if (can_send(resend_now)) {
|
||||||
@ -189,7 +189,7 @@ void AP_Mount_SToRM32_serial::send_target_angles(float pitch_deg, float roll_deg
|
|||||||
}
|
}
|
||||||
|
|
||||||
// store time of send
|
// store time of send
|
||||||
_last_send = hal.scheduler->millis();
|
_last_send = AP_HAL::millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AP_Mount_SToRM32_serial::get_angles() {
|
void AP_Mount_SToRM32_serial::get_angles() {
|
||||||
|
@ -30,7 +30,7 @@ void AP_Mount_Servo::update()
|
|||||||
static bool mount_open = 0; // 0 is closed
|
static bool mount_open = 0; // 0 is closed
|
||||||
|
|
||||||
// check servo map every three seconds to allow users to modify parameters
|
// check servo map every three seconds to allow users to modify parameters
|
||||||
uint32_t now = hal.scheduler->millis();
|
uint32_t now = AP_HAL::millis();
|
||||||
if (now - _last_check_servo_map_ms > 3000) {
|
if (now - _last_check_servo_map_ms > 3000) {
|
||||||
check_servo_map();
|
check_servo_map();
|
||||||
_last_check_servo_map_ms = now;
|
_last_check_servo_map_ms = now;
|
||||||
|
Loading…
Reference in New Issue
Block a user