Documentation fixes about timeouts, improved checks in chVTSetI().

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@812 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2009-03-07 11:47:38 +00:00
parent 719cf5fa8d
commit d785c8a7e5
5 changed files with 35 additions and 13 deletions

View File

@ -162,7 +162,10 @@ msg_t chCondWaitS(CondVar *cp) {
* acquires the mutex again. This is done atomically.
*
* @param cp pointer to the @p CondVar structure
* @param time the number of ticks before the operation fails
* @param time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @return The wakep mode.
* @retval RDY_OK if the condvar was signaled using chCondSignal().
* @retval RDY_RESET if the condvar was signaled using chCondBroadcast().
@ -186,7 +189,10 @@ msg_t chCondWaitTimeout(CondVar *cp, systime_t time) {
* acquires the mutex again. This is done atomically.
*
* @param cp pointer to the @p CondVar structure
* @param time the number of ticks before the operation fails
* @param time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @return The wakep mode.
* @retval RDY_OK if the condvar was signaled using chCondSignal().
* @retval RDY_RESET if the condvar was signaled using chCondBroadcast().

View File

@ -288,7 +288,10 @@ eventmask_t chEvtWaitAll(eventmask_t ewmask) {
*
* @param ewmask mask of the events that the function should wait for,
* @p ALL_EVENTS enables all the events
* @param time the number of ticks before the operation timouts
* @param time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @return The mask of the lowest id served and cleared event.
* @retval 0 if the specified timeout expired.
* @note One and only one event is served in the function, the one with the
@ -322,7 +325,10 @@ eventmask_t chEvtWaitOneTimeout(eventmask_t ewmask, systime_t time) {
*
* @param ewmask mask of the events that the function should wait for,
* @p ALL_EVENTS enables all the events
* @param time the number of ticks before the operation timouts
* @param time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @return The mask of the served and cleared events.
* @retval 0 if the specified timeout expired.
*/
@ -349,7 +355,10 @@ eventmask_t chEvtWaitAnyTimeout(eventmask_t ewmask, systime_t time) {
* become pending then the events are cleared and returned.
*
* @param ewmask mask of the event ids that the function should wait for
* @param time the number of ticks before the operation timouts
* @param time the number of ticks before the operation timeouts
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @return The mask of the served and cleared events.
* @retval 0 if the specified timeout expired.
*/

View File

@ -122,10 +122,10 @@ static void wakeup(void *p) {
* to sleep is awakened after the specified time has elapsed.
*
* @param newstate the new thread state
* @param time the number of ticks before the operation timeouts. The
* following special values are allowed:
* - @p TIME_ZERO immediate timeout.
* - @p TIME_INFINITE no timeout.
* @param time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @return The wakeup message.
* @retval RDY_TIMEOUT if a timeout occurs.
* @note The function must be called in the system mutex zone.
@ -133,8 +133,10 @@ static void wakeup(void *p) {
*/
msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
if (TIME_ZERO == time)
if (TIME_ZERO == time) {
chSchRescheduleS();
return RDY_OK;
}
if (TIME_INFINITE != time) {
VirtualTimer vt;

View File

@ -132,7 +132,10 @@ msg_t chSemWaitS(Semaphore *sp) {
* @brief Performs a wait operation on a semaphore with timeout specification.
*
* @param sp pointer to a @p Semaphore structure
* @param time the number of ticks before the operation fails
* @param time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_ZERO immediate timeout.
* - @a TIME_INFINITE no timeout.
* @retval RDY_OK if the semaphore was signaled or not taken.
* @retval RDY_RESET if the semaphore was reset using @p chSemReset().
* @retval RDY_TIMEOUT if the semaphore was not signaled or reset within the

View File

@ -44,7 +44,8 @@ void vt_init(void) {
* @brief Enables a virtual timer.
*
* @param vtp the @p VirtualTimer structure pointer
* @param time the number of time ticks, the value zero is not allowed
* @param time the number of time ticks, the values @p TIME_ZERO and
* @p TIME_INFINITE are not allowed
* @param vtfunc the timer callback function. After invoking the callback
* the timer is disabled and the structure can be disposed or
* reused.
@ -55,7 +56,8 @@ void vt_init(void) {
void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) {
VirtualTimer *p;
chDbgCheck((vtp != NULL) && (time != 0) && (vtfunc != NULL), "chVTSetI");
chDbgCheck((vtp != NULL) && (time != TIME_ZERO) &&
(time != TIME_INFINITE) && (vtfunc != NULL), "chVTSetI");
vtp->vt_par = par;
vtp->vt_func = vtfunc;