Skip to content

Conversation

@PaulZC
Copy link
Contributor

@PaulZC PaulZC commented Sep 12, 2022

setAccelStatustoInt1 calls ism330dhcx_pin_int1_route_set which, in turn, writes to multiple registers (seven in total).

The ism330dhcx_pin_int1_route_t struct wasn't being initialized causing setAccelStatustoInt1 to write mostly garbage into the registers...

This PR changes all four functions to read-modify-write, to ensure the ism330dhcx_pin_int1_route_t is 'clean' and that only the desired routing bit is changed. It also allows the routing bit to be cleared again, by setting enable parameter to false.

@PaulZC PaulZC requested a review from edspark September 12, 2022 00:33
@edspark
Copy link
Collaborator

edspark commented Sep 15, 2022

This looks great. I tested out the second example and found that the setPinMode did not work as intended and so I included it in this pull request since this one essentially fixes the interrupt functions overall.

@edspark edspark merged commit 1707188 into main Sep 15, 2022
@PaulZC PaulZC deleted the set_status_to_int branch September 15, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants