mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 05:43:35 +08:00
POSIX: Added sleep command
The baro was not fully initialized when the sensors module tried to open it. Added a sleep command and a sleep 2 to rc.S so the baro is initialized by the time the sensors module tried to read it. Fixed other noisy errors Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -774,7 +774,7 @@ ACCELSIM::mag_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
unsigned period = 1000000 / arg;
|
||||
|
||||
/* check against maximum sane rate (1ms) */
|
||||
if (period < 1000)
|
||||
if (period < 10000)
|
||||
return -EINVAL;
|
||||
|
||||
/* update interval for next measurement */
|
||||
@@ -961,11 +961,10 @@ ACCELSIM::start()
|
||||
//PX4_INFO("ACCELSIM::start accel %u", _call_accel_interval);
|
||||
hrt_call_every(&_accel_call, 1000, _call_accel_interval, (hrt_callout)&ACCELSIM::measure_trampoline, this);
|
||||
|
||||
|
||||
// There is a race here where SENSORIOCSPOLLRATE on the accel starts polling of mag but mag period is set to 0
|
||||
// There is a race here where SENSORIOCSPOLLRATE on the accel starts polling of mag but _call_mag_interval is 0
|
||||
if (_call_mag_interval == 0) {
|
||||
PX4_ERR("_call_mag_interval uninitilized - would have set period delay of 0");
|
||||
_call_mag_interval = 1000;
|
||||
//PX4_INFO("_call_mag_interval uninitilized - would have set period delay of 0");
|
||||
_call_mag_interval = 10000; // Max 100Hz
|
||||
}
|
||||
|
||||
//PX4_INFO("ACCELSIM::start mag %u", _call_mag_interval);
|
||||
|
||||
@@ -466,6 +466,9 @@ GYROSIM::GYROSIM(const char *path_accel, const char *path_gyro, enum Rotation ro
|
||||
// disable debug() calls
|
||||
_debug_enabled = false;
|
||||
|
||||
// Don't publish until initialized
|
||||
_pub_blocked = true;
|
||||
|
||||
_device_id.devid_s.devtype = DRV_ACC_DEVTYPE_GYROSIM;
|
||||
|
||||
/* Prime _gyro with parents devid. */
|
||||
@@ -588,6 +591,9 @@ GYROSIM::init()
|
||||
if (_accel_topic == nullptr) {
|
||||
PX4_WARN("ADVERT FAIL");
|
||||
}
|
||||
else {
|
||||
_pub_blocked = false;
|
||||
}
|
||||
|
||||
|
||||
/* advertise sensor topic, measure manually to initialize valid report */
|
||||
|
||||
Reference in New Issue
Block a user