v01d commented on pull request #1705:
URL: https://github.com/apache/incubator-nuttx/pull/1705#issuecomment-687650849
Is the oneshot supposed to keep counting after it fires? I understand that
oneshot fires once but at least stm32_oneshot.c stops counting. So implementing
up_timer_gettime() as arch_alarm.c does:
<pre>
int up_timer_gettime(FAR struct timespec *ts)
{
int ret = -EAGAIN;
if (g_oneshot_lower != NULL)
{
ret = ONESHOT_CURRENT(g_oneshot_lower, ts);
}
return ret;
}
</pre>
would only work if the timer continues to run AND it handles wrap-around by
adding one period on overflow and returns this monotonic value on
ONESHOT_CURRENT(). Neither of those two conditions are met in stm32_oneshot.c.
So is stm32_oneshot.c wrong or is that not how oneshot should work?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]