Skip to content

Bug in setMode() function #3

@tealbrains

Description

@tealbrains

Subject of the issue

The mode seems to be locked to HR because of the if statement in setMode():

  if (mode > LIS2DH12_HR_12bit)
    mode = LIS2DH12_HR_12bit; //Default to 12 bit

see the enum:


typedef enum {
  LIS2DH12_HR_12bit   = 0,
  LIS2DH12_NM_10bit   = 1,
  LIS2DH12_LP_8bit    = 2,
} lis2dh12_op_md_t;

Proposed fix:

  if (mode > LIS2DH12_LP_8bit)
    mode = LIS2DH12_HR_12bit; //Default to 12 bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions