Skip to content

Code need to be refactored #7

Description

@UncleRus

The issue

The component code needs a complete refactoring.

  1. Currently, the code cannot be considered thread-safe because the mutex is only acquired/released during individual register reads/writes, whereas there are functions that perform multiple register writes.
  2. In most places where a register value is written and the same value is stored in the descriptor, the descriptor is updated FIRST, and only then the register write is performed without checking the result. This could potentially lead to a situation where the value in the descriptor differs from the actual register value.

Which SDK are you using?

esp-idf

Which version of SDK are you using?

latest

Which build target have you used?

  • esp32
  • esp32s2
  • esp32s3
  • esp32c2
  • esp32c5
  • esp32c6
  • esp32c61
  • esp32h2
  • esp32p4
  • esp8266
  • other

Component causing the issue

bmi160

Anything in the logs that might be useful for us?

Additional information or context

No response

Confirmation

  • This report is not a question nor a request for drivers.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions