STMicroelectronics / STMems_Standard_C_drivers

Platform-independent drivers for STMicroelectronics MEMS motion and environmental sensors, based on standard C programming language.
BSD 3-Clause "New" or "Revised" License
729 stars 518 forks source link

l3gd20h: self test function #153

Closed danli0210 closed 1 month ago

danli0210 commented 2 years ago

Device part numbers

l3gd20h

Type of bug

examples/l3gd20h_self_test.c

Describe the bug

The variable "st_result" is not initialized. In addition, the function "l3gd20h_self_test" only sets the variable "st_result" to be ST_FAIL if the test condition is violated. It turns out that the function "l3gd20h_self_test" always outputs "Self Test - FAIL".

Additional context

Add any other context about the problem here. (ie: hardware description, compiler used, etc...)

avisconti commented 1 month ago

Fixed by d732cd3