lancaster-university / codal-circuit-playground

MIT License
4 stars 6 forks source link

Wait us updates #8

Closed jamesadevine closed 5 years ago

jamesadevine commented 5 years ago

The generic wait_ms, offered by the codal system timer, is not tight enough to perform small waits accurately. For instance, the sync call in the timer takes 4us alone to read the counter value and update the timestamp. This commit introduces an instruction based wait, using the clock speed of the CPU.

jamesadevine commented 5 years ago

@mmoskal see https://github.com/lancaster-university/codal-core/pull/86

jamesadevine commented 5 years ago

Another question is if we want to handle uint64_t? I imagine that has a variable decrement/increment operation depending on the size of the number, resulting in uneven cycle counts.