Hi Gideon, On 6/5/19 12:46 PM, <gid.meng> wrote: > Dear List, > > In an effort to port RIOT to SmartFusion2 (goto BACKGROUND at the bottom > for interest), we've hit a small stumbling block. The dedicated hardware > timer is extremely basic and does not have any CCP (capture/compare) > channels. It's is a simple down counter with an overflow interrupt.
Can the start or reload value be set, and the current counter value be read? If yes, this sounds much like the Cortex-M systick timer. It should be possible to emulate a one-CCP counting timer. When no callback is set, now() is "MAX_VALUE - current_value", and the overflow interrupt is ignored. If a callback is set, the timer gets (re-)set with the timeout as start value, and the callback is executed on overflow, where the start value then gets reset to MAX_VALUE. Also, the time when the callback gets configured is stored somewhere and then incorporated into now(). This will be difficult to implement without losing a tick here and there, but might be acceptable. Kaspar _______________________________________________ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel