Description
In lis2dux12_freq_to_odr_val
, the code cycles through the array of possible ODR frequencies and breaking when the value is less than or equal to current value in the array.
This will break too soon or incorrectly when the user tries to configure the frequency to 6Hz, 12.5Hz and 25Hz (Normal mode) as the 3rd element in the array is 25Hz (ULP).
Suggest checking if the PM state is LIS2DUX12_OPER_MODE_LOW_POWER
before selecting the (ULP) frequencies. This should protect against the issue of configuring 25Hz ULP for 6, 12.5 and 25Hz (Normal mode).