|
|
|
@ -867,7 +867,7 @@ HMC5883::collect()
@@ -867,7 +867,7 @@ HMC5883::collect()
|
|
|
|
|
struct { |
|
|
|
|
int16_t x, y, z; |
|
|
|
|
} report; |
|
|
|
|
int ret = -EIO; |
|
|
|
|
int ret; |
|
|
|
|
uint8_t cmd; |
|
|
|
|
uint8_t check_counter; |
|
|
|
|
|
|
|
|
@ -1157,7 +1157,7 @@ int HMC5883::calibrate(struct file *filp, unsigned enable)
@@ -1157,7 +1157,7 @@ int HMC5883::calibrate(struct file *filp, unsigned enable)
|
|
|
|
|
out: |
|
|
|
|
|
|
|
|
|
if (OK != ioctl(filp, MAGIOCSSCALE, (long unsigned int)&mscale_previous)) { |
|
|
|
|
warn("WARNING: failed to set new scale / offsets for mag"); |
|
|
|
|
warn("failed to set new scale / offsets for mag"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* set back to normal mode */ |
|
|
|
@ -1353,6 +1353,9 @@ void usage();
@@ -1353,6 +1353,9 @@ void usage();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Start the driver. |
|
|
|
|
* |
|
|
|
|
* This function call only returns once the driver |
|
|
|
|
* is either successfully up and running or failed to start. |
|
|
|
|
*/ |
|
|
|
|
void |
|
|
|
|
start(int bus, enum Rotation rotation) |
|
|
|
@ -1443,7 +1446,7 @@ test(int bus)
@@ -1443,7 +1446,7 @@ test(int bus)
|
|
|
|
|
int fd = open(path, O_RDONLY); |
|
|
|
|
|
|
|
|
|
if (fd < 0) |
|
|
|
|
err(1, "%s open failed (try 'hmc5883 start' if the driver is not running", path); |
|
|
|
|
err(1, "%s open failed (try 'hmc5883 start')", path); |
|
|
|
|
|
|
|
|
|
/* do a simple demand read */ |
|
|
|
|
sz = read(fd, &report, sizeof(report)); |
|
|
|
|