mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 16:23:34 +08:00
drivers: up_udelay -> px4_usleep
This commit is contained in:
@@ -120,7 +120,7 @@ int BMI088_accel::reset()
|
||||
* Setting it to 5ms.
|
||||
*/
|
||||
|
||||
up_udelay(5000);
|
||||
px4_usleep(5000);
|
||||
|
||||
// Perform a dummy read here to put the accelerometer part of the BMI088 back into SPI mode after the reset
|
||||
// The dummy read basically pulls the chip select line low and then high
|
||||
@@ -134,7 +134,7 @@ int BMI088_accel::reset()
|
||||
* Any communication with the sensor during this time should be avoided
|
||||
* (see section "Power Modes: Acceleromter" in the BMI datasheet) */
|
||||
|
||||
up_udelay(5000);
|
||||
px4_usleep(5000);
|
||||
|
||||
// Set the PWR CONF to be active
|
||||
write_checked_reg(BMI088_ACC_PWR_CONF, BMI088_ACC_PWR_CONF_ACTIVE); // Sets the accelerometer to active mode
|
||||
|
||||
@@ -104,7 +104,8 @@ int BMI088_gyro::reset()
|
||||
|
||||
//Enable Gyroscope in normal mode
|
||||
write_reg(BMI088_GYR_LPM1, BMI088_GYRO_NORMAL);
|
||||
up_udelay(1000);
|
||||
|
||||
px4_usleep(1000);
|
||||
|
||||
uint8_t retries = 10;
|
||||
|
||||
|
||||
@@ -311,7 +311,8 @@ ICM20948_mag::ak09916_setup(void)
|
||||
retries--;
|
||||
PX4_WARN("AK09916: bad id %d retries %d", id, retries);
|
||||
_parent->modify_reg(ICMREG_20948_USER_CTRL, 0, BIT_I2C_MST_RST);
|
||||
up_udelay(100);
|
||||
|
||||
px4_usleep(100) ;
|
||||
} while (retries > 0);
|
||||
|
||||
if (retries == 0) {
|
||||
|
||||
Reference in New Issue
Block a user