nordic-auko / nRF5-ble-timesync-demo

nRF52 clock synchronization demo code
55 stars 50 forks source link

NRF_EGU3 #15

Closed wiesener closed 2 years ago

wiesener commented 3 years ago

hi,

I do have a question regarding the new features you added. I am using a much simpler version of your sync example Where I just want to send the current timer from a master to slaves without adjusting the timer value but storing the distance from the current timer to the master timer. Therefore I skiped the entire EGU stuff because I think I do not need it. But now in your new version I see, that you are using it for the realing handling. Could you explain it a bit more how this mechanism is supposed to work?

Kind regards, C.W

nordic-auko commented 3 years ago

Hello, there are two uses for the EGU in this codebase: 1) Report events out to the application via callback at a lower priority than the RADIO IRQhandler 2) Update static variables after a time adjustment procedure (only done by receiver). Most important variable is the difference between the transmitter and receiver counter value. (The difference between transmitter and receiver timer values isn't kept in a variable on the other hand)

The EGU is useful because it has a dedicated IRQHandler, which you can assign a priority, and this IRQHandler can be triggered from software or by hardware via PPI.

Btw, I would strongly recommend trying the https://github.com/nordic-auko/nRF5-ble-timesync-demo/tree/counter_revamp branch. This addresses a number of bugs currently in the master branch. I have been testing this branch for a while and will merge it to master soon.

nordic-auko commented 2 years ago

Closing after inactivity