mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 06:31:37 +08:00
delete MAGIOCSELFTEST
This commit is contained in:
committed by
Lorenz Meier
parent
daee7a4e4e
commit
bb9c38a480
@@ -286,22 +286,6 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
LIS3MDL::check_calibration()
|
||||
{
|
||||
bool offset_valid = (check_offset() == OK);
|
||||
bool scale_valid = (check_scale() == OK);
|
||||
|
||||
if (_calibrated != (offset_valid && scale_valid)) {
|
||||
PX4_WARN("mag cal status changed %s%s", (scale_valid) ? "" : "scale invalid ",
|
||||
(offset_valid) ? "" : "offset invalid");
|
||||
_calibrated = (offset_valid && scale_valid);
|
||||
}
|
||||
|
||||
/* return 0 if calibrated, 1 else */
|
||||
return !_calibrated;
|
||||
}
|
||||
|
||||
int
|
||||
LIS3MDL::check_offset()
|
||||
{
|
||||
@@ -613,8 +597,6 @@ LIS3MDL::ioctl(struct file *file_pointer, int cmd, unsigned long arg)
|
||||
case MAGIOCSSCALE:
|
||||
/* set new scale factors */
|
||||
memcpy(&_scale, (struct mag_calibration_s *)arg, sizeof(_scale));
|
||||
/* check calibration, but not actually return an error */
|
||||
(void)check_calibration();
|
||||
return 0;
|
||||
|
||||
case MAGIOCGSCALE:
|
||||
@@ -622,17 +604,12 @@ LIS3MDL::ioctl(struct file *file_pointer, int cmd, unsigned long arg)
|
||||
memcpy((struct mag_calibration_s *)arg, &_scale, sizeof(_scale));
|
||||
return 0;
|
||||
|
||||
|
||||
case MAGIOCCALIBRATE:
|
||||
return calibrate(file_pointer, arg);
|
||||
|
||||
case MAGIOCEXSTRAP:
|
||||
return set_excitement(arg);
|
||||
|
||||
case MAGIOCSELFTEST:
|
||||
return check_calibration();
|
||||
|
||||
|
||||
case MAGIOCGEXTERNAL:
|
||||
DEVICE_DEBUG("MAGIOCGEXTERNAL in main driver");
|
||||
return _interface->ioctl(cmd, dummy);
|
||||
|
||||
Reference in New Issue
Block a user