-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rtems timer can not be disabled #9
Comments
@jphickey is this non-compliance with the API documentation still true? |
Yes, it appears that it is still an issue. This is certainly a lesser-used API "feature" and as far as I can tell there is no unit test to check for compliance with this. Also, the API document says that the interval is optional, but also I cannot see any test that checks this "one-shot" behavior either. For CFE, the use case is always to set it using and interval and then forget it. There are two possible resolutions:
|
Should requesting a timer for 0 ticks really be a cancel? Could OS_UsecsToTicks() return a 0 if Usecs is below the RTEMS CONFIGURE_MICROSECONDS_PER_TICK? Just asking to make sure this isn't potentially covering up a problem with a timer request below the clock tick quantum. |
No I do not think that setting a But mainly because a timer can be canceled by way of Going forward I would recommend that the documentation be changed to indicate that timers should be canceled with |
Opened the two new issues above to address this issue, closing this thread. |
I think Rtems OS_timerset() not satisfy it's description in API document
osal/src/os/rtems/ostimer.c
Line 368 in 75beb86
In POSIX API, Call OS_timerSet() with "start_msec = 0" causes timer stop but Rtems just ignore that parameter
I hope to change OSAL rtems api code to
if ( start_time > 0 ) {
OS_UsecsToTicks(start_time, &timeout);
status = rtems_timer_fire_after(OS_timer_table[timer_id].host_timerid,
timeout,
OS_TimerSignalHandler, (void *)timer_id );
if ( status != RTEMS_SUCCESSFUL )
{
return ( OS_TIMER_ERR_INTERNAL);
}
} else {
status = rtems_timer_cancel(OS_timer_table[timer_id].host_timerid);
if ( status != RTEMS_SUCCESSFUL )
{
return ( OS_TIMER_ERR_INTERNAL);
}
}
The text was updated successfully, but these errors were encountered: