Skip to content

Commit

Permalink
fixed pin_notification_set/get for magnetometer
Browse files Browse the repository at this point in the history
  • Loading branch information
albezanc committed Apr 21, 2021
1 parent 6d91170 commit 307244c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lsm9ds1_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2949,7 +2949,7 @@ int32_t lsm9ds1_pin_notification_set(stmdev_ctx_t *ctx_mag,

if (ret == 0)
{
int_cfg_m.iel = (uint8_t)val;
int_cfg_m.iel = (uint8_t)(~val);
ret = lsm9ds1_write_reg(ctx_mag, LSM9DS1_INT_CFG_M,
(uint8_t *)&int_cfg_m, 1);
}
Expand Down Expand Up @@ -2990,7 +2990,7 @@ int32_t lsm9ds1_pin_notification_get(stmdev_ctx_t *ctx_mag,
(uint8_t *)&int_cfg_m, 1);
}

switch (int_cfg_m.iel & int_gen_cfg_g.lir_g & ctrl_reg4.lir_xl1)
switch (~int_cfg_m.iel & int_gen_cfg_g.lir_g & ctrl_reg4.lir_xl1)
{
case LSM9DS1_INT_LATCHED:
*val = LSM9DS1_INT_LATCHED;
Expand Down

0 comments on commit 307244c

Please sign in to comment.