I'd try using the atomic functions. Writing the value from the ISR and reading it, presumably from the loop thread. can result in unexpected values. See this post:
Since the P2 and M-SoM use nearly identical RTL872x processors, I'd try that first.
I'd try using the atomic functions. Writing the value from the ISR and reading it, presumably from the loop thread. can result in unexpected values. See this post:
Since the P2 and M-SoM use nearly identical RTL872x processors, I'd try that first.