Browse Source

HMC5883 driver: stack size adjustments of start handler and start return review / comments

sbg
Lorenz Meier 11 years ago
parent
commit
f89573a6ed
  1. 9
      src/drivers/hmc5883/hmc5883.cpp
  2. 5
      src/drivers/hmc5883/module.mk

9
src/drivers/hmc5883/hmc5883.cpp

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

5
src/drivers/hmc5883/module.mk

@ -37,7 +37,6 @@
MODULE_COMMAND = hmc5883 MODULE_COMMAND = hmc5883
# XXX seems excessive, check if 2048 is sufficient
MODULE_STACKSIZE = 4096
SRCS = hmc5883.cpp SRCS = hmc5883.cpp
MODULE_STACKSIZE = 1200

Loading…
Cancel
Save