Fix some naming convention violations in the last commit.
This commit is contained in:
parent
cd2ced4d9a
commit
11a1b2598e
@ -122,8 +122,8 @@ static int lsm303agr_register(FAR const char *devpath,
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static double accelerofactor = 0;
|
||||
static double magnetofactor = 0;
|
||||
static double g_accelerofactor = 0;
|
||||
static double g_magnetofactor = 0;
|
||||
|
||||
static const struct file_operations g_fops =
|
||||
{
|
||||
@ -443,7 +443,7 @@ static int lsm303agr_sensor_start(FAR struct lsm303agr_dev_s *priv)
|
||||
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CTRL_REG1_A, 0x77);
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CTRL_REG4_A, 0xB0);
|
||||
accelerofactor = 11.72;
|
||||
g_accelerofactor = 11.72;
|
||||
|
||||
/* Gyro config registers Turn on the gyro: FS=2000dps, ODR=833Hz Not using
|
||||
* modifyreg with empty value!!!! Then read value first!!!
|
||||
@ -451,7 +451,7 @@ static int lsm303agr_sensor_start(FAR struct lsm303agr_dev_s *priv)
|
||||
*/
|
||||
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CFG_REG_A_M, 0x8C);
|
||||
magnetofactor = 1.5;
|
||||
g_magnetofactor = 1.5;
|
||||
|
||||
return OK;
|
||||
}
|
||||
@ -570,7 +570,7 @@ static int lsm303agr_selftest(FAR struct lsm303agr_dev_s *priv, uint32_t mode)
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CTRL_REG3_A, 0x00);
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CTRL_REG4_A, 0x81);
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CTRL_REG1_A, 0x57);
|
||||
accelerofactor = 1;
|
||||
g_accelerofactor = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -578,7 +578,7 @@ static int lsm303agr_selftest(FAR struct lsm303agr_dev_s *priv, uint32_t mode)
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CFG_REG_A_M, 0x8C);
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CFG_REG_B_M, 0x02);
|
||||
lsm303agr_writereg8(priv, LSM303AGR_CFG_REG_C_M, 0x10);
|
||||
magnetofactor = 1;
|
||||
g_magnetofactor = 1;
|
||||
}
|
||||
|
||||
nxsig_usleep(100000); /* 100ms */
|
||||
@ -949,9 +949,9 @@ static int lsm303agr_sensor_read(FAR struct lsm303agr_dev_s *priv,
|
||||
y_valg = (int16_t) (((hiyg) << 8) | loyg);
|
||||
z_valg = (int16_t) (((hizg) << 8) | lozg);
|
||||
|
||||
sninfo("Data 16-bit M_X--->: %d mguass\n", (short)(x_valg * magnetofactor));
|
||||
sninfo("Data 16-bit M_Y--->: %d mguass\n", (short)(y_valg * magnetofactor));
|
||||
sninfo("Data 16-bit M_Z--->: %d mguass\n", (short)(z_valg * magnetofactor));
|
||||
sninfo("Data 16-bit M_X--->: %d mguass\n", (short)(x_valg * g_magnetofactor));
|
||||
sninfo("Data 16-bit M_Y--->: %d mguass\n", (short)(y_valg * g_magnetofactor));
|
||||
sninfo("Data 16-bit M_Z--->: %d mguass\n", (short)(z_valg * g_magnetofactor));
|
||||
|
||||
sensor_data->m_x_data = x_valg;
|
||||
sensor_data->m_y_data = y_valg;
|
||||
|
@ -121,8 +121,8 @@ static int lsm6dsl_register(FAR const char *devpath,
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static double accelerofactor = 0;
|
||||
static double gyrofactor = 0;
|
||||
static double g_accelerofactor = 0;
|
||||
static double g_gyrofactor = 0;
|
||||
|
||||
static const struct file_operations g_fops =
|
||||
{
|
||||
@ -434,14 +434,14 @@ static int lsm6dsl_sensor_start(FAR struct lsm6dsl_dev_s *priv)
|
||||
/* Accelerometer config registers Turn on the accelerometer: 833Hz, +- 16g */
|
||||
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL1_XL, 0x74);
|
||||
accelerofactor = 0.488;
|
||||
g_accelerofactor = 0.488;
|
||||
|
||||
/* Gyro config registers Turn on the gyro: FS=2000dps, ODR=833Hz Not using
|
||||
* modifyreg with empty value!!!! Then read value first!!!
|
||||
*/
|
||||
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL2_G, 0x7C);
|
||||
gyrofactor = 70;
|
||||
g_gyrofactor = 70;
|
||||
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL6_C, 0x00);
|
||||
|
||||
@ -581,7 +581,7 @@ static int lsm6dsl_selftest(FAR struct lsm6dsl_dev_s *priv, uint32_t mode)
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL1_XL, 0x38);
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL2_G, 0x00);
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL3_C, 0x44);
|
||||
accelerofactor = (0.122 / 1000);
|
||||
g_accelerofactor = (0.122 / 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -592,7 +592,7 @@ static int lsm6dsl_selftest(FAR struct lsm6dsl_dev_s *priv, uint32_t mode)
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL1_XL, 0x00);
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL2_G, 0x5C);
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL3_C, 0x44);
|
||||
gyrofactor = (70 / 1000); /* 2000dps */
|
||||
g_gyrofactor = (70 / 1000); /* 2000dps */
|
||||
}
|
||||
|
||||
lsm6dsl_writereg8(priv, LSM6DSL_CTRL4_C, 0x00);
|
||||
@ -987,14 +987,14 @@ static int lsm6dsl_sensor_read(FAR struct lsm6dsl_dev_s *priv,
|
||||
|
||||
temp_val = (tempi / 256) + 25;
|
||||
|
||||
sninfo("Data 16-bit XL_X--->: %d mg\n", (short)(xf_val * accelerofactor));
|
||||
sninfo("Data 16-bit XL_Y--->: %d mg\n", (short)(yf_val * accelerofactor));
|
||||
sninfo("Data 16-bit XL_Z--->: %d mg\n", (short)(zf_val * accelerofactor));
|
||||
sninfo("Data 16-bit XL_X--->: %d mg\n", (short)(xf_val * g_accelerofactor));
|
||||
sninfo("Data 16-bit XL_Y--->: %d mg\n", (short)(yf_val * g_accelerofactor));
|
||||
sninfo("Data 16-bit XL_Z--->: %d mg\n", (short)(zf_val * g_accelerofactor));
|
||||
sninfo("Data 16-bit TEMP--->: %d Celsius\n", temp_val);
|
||||
|
||||
sensor_data->x_data = xf_val * accelerofactor;
|
||||
sensor_data->y_data = yf_val * accelerofactor;
|
||||
sensor_data->z_data = zf_val * accelerofactor;
|
||||
sensor_data->x_data = xf_val * g_accelerofactor;
|
||||
sensor_data->y_data = yf_val * g_accelerofactor;
|
||||
sensor_data->z_data = zf_val * g_accelerofactor;
|
||||
sensor_data->temperature = temp_val;
|
||||
sensor_data->timestamp = ts;
|
||||
|
||||
@ -1002,13 +1002,13 @@ static int lsm6dsl_sensor_read(FAR struct lsm6dsl_dev_s *priv,
|
||||
y_valg = (int16_t) (((hiyg) << 8) | loyg);
|
||||
z_valg = (int16_t) (((hizg) << 8) | lozg);
|
||||
|
||||
sninfo("Data 16-bit G_X--->: %d mdps\n", (short)(x_valg * gyrofactor));
|
||||
sninfo("Data 16-bit G_Y--->: %d mdps\n", (short)(y_valg * gyrofactor));
|
||||
sninfo("Data 16-bit G_Z--->: %d mdps\n", (short)(z_valg * gyrofactor));
|
||||
sninfo("Data 16-bit G_X--->: %d mdps\n", (short)(x_valg * g_gyrofactor));
|
||||
sninfo("Data 16-bit G_Y--->: %d mdps\n", (short)(y_valg * g_gyrofactor));
|
||||
sninfo("Data 16-bit G_Z--->: %d mdps\n", (short)(z_valg * g_gyrofactor));
|
||||
|
||||
sensor_data->g_x_data = x_valg * gyrofactor;
|
||||
sensor_data->g_y_data = y_valg * gyrofactor;
|
||||
sensor_data->g_z_data = z_valg * gyrofactor;
|
||||
sensor_data->g_x_data = x_valg * g_gyrofactor;
|
||||
sensor_data->g_y_data = y_valg * g_gyrofactor;
|
||||
sensor_data->g_z_data = z_valg * g_gyrofactor;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user