driver/sensor: lis2mdl: remove sensitivity
LIS2MDL sensor has a fixed sensitivity equal to 1500 uGauss/LSB. So, use a constant value directly. Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
parent
44f373e806
commit
82b9172718
2 changed files with 1 additions and 5 deletions
|
@ -94,7 +94,7 @@ static void lis2mdl_channel_get_mag(struct device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = ofs_start; i <= ofs_stop; i++) {
|
for (i = ofs_start; i <= ofs_stop; i++) {
|
||||||
cval = lis2mdl->mag[i] * lis2mdl->mag_fs_sensitivity;
|
cval = lis2mdl->mag[i] * 1500;
|
||||||
pval->val1 = cval / 1000000;
|
pval->val1 = cval / 1000000;
|
||||||
pval->val2 = cval % 1000000;
|
pval->val2 = cval % 1000000;
|
||||||
pval++;
|
pval++;
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
#include <sys/util.h>
|
#include <sys/util.h>
|
||||||
#include "lis2mdl_reg.h"
|
#include "lis2mdl_reg.h"
|
||||||
|
|
||||||
/* Sensor sensitivity in uGa/LSB */
|
|
||||||
#define LIS2MDL_SENSITIVITY 1500
|
|
||||||
struct lis2mdl_config {
|
struct lis2mdl_config {
|
||||||
char *master_dev_name;
|
char *master_dev_name;
|
||||||
int (*bus_init)(struct device *dev);
|
int (*bus_init)(struct device *dev);
|
||||||
|
@ -44,8 +42,6 @@ struct lis2mdl_data {
|
||||||
s16_t mag[3];
|
s16_t mag[3];
|
||||||
s32_t temp_sample;
|
s32_t temp_sample;
|
||||||
|
|
||||||
/* save sensitivity */
|
|
||||||
u16_t mag_fs_sensitivity;
|
|
||||||
lis2mdl_ctx_t *ctx;
|
lis2mdl_ctx_t *ctx;
|
||||||
|
|
||||||
#ifdef DT_ST_LIS2MDL_BUS_I2C
|
#ifdef DT_ST_LIS2MDL_BUS_I2C
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue