mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 09:03:34 +08:00
sensors:Use inttypes
This commit is contained in:
committed by
Julian Oes
parent
274c55a4ae
commit
d73f842151
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2016 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2016, 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -106,7 +106,8 @@ void VotedSensorsUpdate::parametersUpdate()
|
||||
} else {
|
||||
// change relative priority to incorporate any sensor faults
|
||||
int priority_change = _accel.priority_configured[uorb_index] - accel_priority_old;
|
||||
_accel.priority[uorb_index] = math::constrain(_accel.priority[uorb_index] + priority_change, 1, 100);
|
||||
_accel.priority[uorb_index] = math::constrain(_accel.priority[uorb_index] + priority_change, static_cast<int32_t>(1),
|
||||
static_cast<int32_t>(100));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,7 +129,8 @@ void VotedSensorsUpdate::parametersUpdate()
|
||||
} else {
|
||||
// change relative priority to incorporate any sensor faults
|
||||
int priority_change = _gyro.priority_configured[uorb_index] - gyro_priority_old;
|
||||
_gyro.priority[uorb_index] = math::constrain(_gyro.priority[uorb_index] + priority_change, 1, 100);
|
||||
_gyro.priority[uorb_index] = math::constrain(_gyro.priority[uorb_index] + priority_change, static_cast<int32_t>(1),
|
||||
static_cast<int32_t>(100));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,11 +357,11 @@ void VotedSensorsUpdate::initSensorClass(SensorData &sensor_data, uint8_t sensor
|
||||
|
||||
void VotedSensorsUpdate::printStatus()
|
||||
{
|
||||
PX4_INFO("selected gyro: %d (%d)", _selection.gyro_device_id, _gyro.last_best_vote);
|
||||
PX4_INFO("selected gyro: %" PRIu32 " (%" PRIu8 ")", _selection.gyro_device_id, _gyro.last_best_vote);
|
||||
_gyro.voter.print();
|
||||
|
||||
PX4_INFO_RAW("\n");
|
||||
PX4_INFO("selected accel: %d (%d)", _selection.accel_device_id, _accel.last_best_vote);
|
||||
PX4_INFO("selected accel: %" PRIu32 " (%" PRIu8 ")", _selection.accel_device_id, _accel.last_best_vote);
|
||||
_accel.voter.print();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user