From 76177aa280494bb36d7a0bcbda1078d4db717020 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Mon, 9 Dec 2019 11:25:19 +0100 Subject: Official ARM version: v4.5 --- .../html/group___c_m_s_i_s___r_t_o_s___wait.html | 254 +++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html (limited to 'Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html') diff --git a/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html new file mode 100644 index 0000000..c0eafec --- /dev/null +++ b/Documentation/RTOS/html/group___c_m_s_i_s___r_t_o_s___wait.html @@ -0,0 +1,254 @@ + + + + + +Generic Wait Functions +CMSIS-RTOS: Generic Wait Functions + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-RTOS +  Version 1.02 +
+
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
+
+
+ +
+
    + +
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
Generic Wait Functions
+
+
+ +

Wait for a time period or unspecified events. +More...

+ + + + + +

+Macros

#define osFeature_Wait   1
 osWait function: 1=available, 0=not available
 
+ + + + + + + +

+Functions

osStatus osDelay (uint32_t millisec)
 Wait for Timeout (Time Delay).
 
osEvent osWait (uint32_t millisec)
 Wait for Signal, Message, Mail, or Timeout.
 
+

Description

+

The Generic Wait function group provides means for a time delay and allow to wait for unspecified events.

+

Macro Definition Documentation

+ +
+
+ + + + +
#define osFeature_Wait   1
+
+

A CMSIS-RTOS implementation may support the generic wait function osWait.

+ + +
+
+

Function Documentation

+ +
+
+ + + + + + + + +
osStatus osDelay (uint32_t millisec)
+
+
Parameters
+ + +
[in]millisectime delay value
+
+
+
Returns
status code that indicates the execution status of the function.
+

Wait for a specified time period in millisec.

+

The millisec value specifies the number of timer ticks and is therefore an upper bound. The exact time delay depends on the actual time elapsed since the last timer tick.

+

For a value of 1, the system waits until the next timer tick occurs. That means that the actual time delay may be up to one timer tick less.

+

Status and Error Codes
+

+
    +
  • osEventTimeout: the time delay is executed.
  • +
  • osErrorISR: osDelay cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osStatus status; // capture the return status
+
uint32_t delayTime; // delay time in milliseconds
+
+
delayTime = 1000; // delay 1 second
+
:
+
status = osDelay (delayTime); // suspend thread execution
+
// handle error code
+
:
+
}
+
+
+
+ +
+
+ + + + + + + + +
osEvent osWait (uint32_t millisec)
+
+
Parameters
+ + +
[in]millisecTimout Value or 0 in case of no time-out
+
+
+
Returns
event that contains signal, message, or mail information or error code.
+
Note
MUST REMAIN UNCHANGED: osWait shall be consistent in every CMSIS-RTOS.
+

Wait for any event of the type Signal, Message, Mail for a specified time period in millisec. While the system waits, the thread that is calling this function is put into the state WAITING. When millisec is set to osWaitForever, the function will wait for an infinite time until an event occurs.

+

The osWait function puts a thread into the state WAITING and waits for any of the following events:

+
    +
  • A signal sent to that thread explicitly
  • +
  • A message from a message object that is registered to that thread
  • +
  • A mail from a mail object that is registered to that thread
  • +
+
Note
This function is optional and may not be provided by all CMSIS-RTOS implementations.
+

Status and Error Codes
+

+
    +
  • osEventSignal: a signal event occurred and is returned.
  • +
  • osEventMessage: a message event occurred and is returned.
  • +
  • osEventMail: a mail event occurred and is returned.
  • +
  • osEventTimeout: the time delay is executed.
  • +
  • osErrorISR: osDelay cannot be called from interrupt service routines.
  • +
+
Note
Cannot be called from Interrupt Service Routines.
+

Code Example

+
#include "cmsis_os.h"
+
+
void Thread_1 (void const *arg) { // Thread function
+
osEvent Event; // capture the event
+
uint32_t waitTime; // wait time in milliseconds
+
+
:
+
waitTime = osWaitForever; // special "wait" value
+
Event = osWait (waitTime); // wait forever and until an event occurred
+
switch (Event.status) {
+
case osEventSignal: // Signal arrived
+
: // Event.value.signals contains the signal flags
+
break;
+
+
case osEventMessage: // Message arrived
+
: // Event.value.p contains the message pointer
+
: // Event.def.message_id contains the message Id
+
break;
+
+
case osEventMail: // Mail arrived
+
: // Event.value.p contains the mail pointer
+
: // Event.def.mail_id contains the mail Id
+
break;
+
+
case osEventTimeout: // Timeout occurred
+
break;
+
+
default: // Error occurred
+
break;
+
}
+
:
+
}
+
+
+
+
+
+ + + + -- cgit