mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
h3lis331dl: Fix sensor init
Signed-off-by: Alexandru Palalau <alexandru.palalau@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
1a80400fa9
commit
3ed0e14487
@ -57,16 +57,20 @@ H3LIS331DL::~H3LIS331DL()
|
||||
|
||||
bool H3LIS331DL::init(DR_BITS_T odr, PM_BITS_T pm, FS_BITS_T fs)
|
||||
{
|
||||
if (!setDataRate(odr))
|
||||
if (!setDataRate(odr)) {
|
||||
return false;
|
||||
if (!setPowerMode(pm))
|
||||
}
|
||||
if (!setPowerMode(pm)) {
|
||||
return false;
|
||||
if (!setFullScale(fs))
|
||||
}
|
||||
if (!setFullScale(fs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// now enable X, Y, and Z axes
|
||||
if (enableAxis(REG1_XEN | REG1_YEN | REG1_ZEN))
|
||||
if (!enableAxis(REG1_XEN | REG1_YEN | REG1_ZEN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user