In Zephyr Operating System, I have to write an application, which will update a variable (can be treated as a counter) every 30ms. Basically I have 2 options
- A timer which expires every 30ms and update the variable in the ISR
- A delayed work which updates the variable at 30ms
Both seems to work well but, I would like to know which of them would be more accurate? Or the recommended
I am developing on couple of chipsets, eg nRF52840 and NXP frdm-k64f I am also aware that the delayed work allows me to protect the variable using a Muxtex which cannot be done in ISR