Lines Matching full:the

8  * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44 /* Used to hide the implementation of the co-routine control block. The
45 * control block structure however has to be included in the header due to
46 * the macro implementation of the co-routine functionality. */
49 /* Defines the prototype to which co-routine functions must conform. */
56 … ListItem_t xGenericListItem; /**< List item used to place the CRCB in ready and blocked queues. */
57 ListItem_t xEventListItem; /**< List item used to place the CRCB in event lists. */
58 …UBaseType_t uxPriority; /**< The priority of the co-routine in relation to other co-routines.…
59 …/**< Used to distinguish between co-routines when multiple co-routines use the same co-routine fun…
60 uint16_t uxState; /**< Used internally by the co-routine implementation. */
73 * Create a new co-routine and add it to the list of co-routines that are
76 * @param pxCoRoutineCode Pointer to the co-routine function. Co-routine
77 * functions require special syntax - see the co-routine section of the WEB
80 * @param uxPriority The priority with respect to other co-routines at which
81 * the co-routine will run.
84 * execute the same function. See the example below and the co-routine section
85 * of the WEB documentation for further information.
87 * @return pdPASS if the co-routine was successfully created and added to a ready
107 * // the uxIndex parameter is used to tell the co-routine which
124 * // Create two co-routines at priority 0. The first is given index 0
125 * // so (from the code above) toggles LED 5 every 200 ticks. The second
149 * vCoRoutineSchedule() executes the highest priority co-routine that is able
150 * to run. The co-routine will execute until it either blocks, yields or is
155 * vCoRoutineSchedule should be called from the idle task (in an idle task
161 * // The rest of the idle task will execute between co-routine calls.
167 * // Alternatively, if you do not require any other part of the idle task to
168 * // execute, the idle task hook can call vCoRoutineSchedule() within an
189 * This macro MUST always be called at the start of a co-routine function.
224 * This macro MUST always be called at the end of a co-routine function.
252 * These macros are intended for internal use by the co-routine implementation
253 * only. The macros should not be used directly by application writers.
270 * crDELAY can only be called from the co-routine function itself - not
271 * from within a function called by the co-routine function. This is because
274 * @param xHandle The handle of the co-routine to delay. This is the xHandle
275 * parameter of the co-routine function.
277 * @param xTickToDelay The number of ticks that the co-routine should delay
278 * for. The actual amount of time this equates to is defined by
279 * configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant portTICK_PERIOD_MS
330 * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
331 * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
336 * crQUEUE_SEND can only be called from the co-routine function itself - not
337 * from within a function called by the co-routine function. This is because
340 * See the co-routine section of the WEB documentation for information on
344 * @param xHandle The handle of the calling co-routine. This is the xHandle
345 * parameter of the co-routine function.
347 * @param pxQueue The handle of the queue on which the data will be posted.
348 * The handle is obtained as the return value when the queue is created using
349 * the xQueueCreate() API function.
351 * @param pvItemToQueue A pointer to the data being posted onto the queue.
352 * The number of bytes of each queued item is specified when the queue is
353 * created. This number of bytes is copied from pvItemToQueue into the queue
356 * @param xTickToDelay The number of ticks that the co-routine should block
357 * to wait for space to become available on the queue, should space not be
358 * available immediately. The actual amount of time this equates to is defined
359 * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant
363 * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
364 * data was successfully posted onto the queue, otherwise it will be set to an
382 * // This assumes the queue has already been created.
387 * // The message was not posted!
390 * // Increment the number to be posted onto the queue.
431 * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
432 * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
437 * crQUEUE_RECEIVE can only be called from the co-routine function itself - not
438 * from within a function called by the co-routine function. This is because
441 * See the co-routine section of the WEB documentation for information on
445 * @param xHandle The handle of the calling co-routine. This is the xHandle
446 * parameter of the co-routine function.
448 * @param pxQueue The handle of the queue from which the data will be received.
449 * The handle is obtained as the return value when the queue is created using
450 * the xQueueCreate() API function.
452 * @param pvBuffer The buffer into which the received item is to be copied.
453 * The number of bytes of each queued item is specified when the queue is
456 * @param xTickToDelay The number of ticks that the co-routine should block
457 * to wait for data to become available from the queue, should data not be
458 * available immediately. The actual amount of time this equates to is defined
459 * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant
460 * portTICK_PERIOD_MS can be used to convert ticks to milliseconds (see the
463 * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
464 * data was successfully retrieved from the queue, otherwise it will be set to
469 * // A co-routine receives the number of an LED to flash from a queue. It
470 * // blocks on the queue until the number is received.
482 * // Wait for data to become available on the queue.
487 * // We received the LED to flash - flash it!
523 * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
524 * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
535 * See the co-routine section of the WEB documentation for information on
539 * @param xQueue The handle to the queue on which the item is to be posted.
541 * @param pvItemToQueue A pointer to the item that is to be placed on the
542 * queue. The size of the items the queue will hold was defined when the
544 * into the queue storage area.
547 * the same queue multiple times from a single interrupt. The first call
549 * the value returned from the previous call.
551 * @return pdTRUE if a co-routine was woken by posting onto the queue. This is
552 * used by the ISR to determine if a context switch may be required following
553 * the ISR.
568 * // Wait for data to become available on the queue. This assumes the
575 * // Process the character here.
590 * // We loop around reading characters until there are none left in the UART.
593 * // Obtain the character from the UART.
596 * // Post the character onto a queue. xCRWokenByPost will be pdFALSE
597 * // the first time around the loop. If the post causes a co-routine
600 * // blocked on the queue only one is woken by this ISR no matter how
601 * // many characters are posted to the queue.
623 * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
624 * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
634 * posted to the queue).
636 * See the co-routine section of the WEB documentation for information on
640 * @param xQueue The handle to the queue on which the item is to be posted.
642 * @param pvBuffer A pointer to a buffer into which the received item will be
643 * placed. The size of the items the queue will hold was defined when the
644 * queue was created, so this many bytes will be copied from the queue into
648 * available on the queue. If crQUEUE_RECEIVE_FROM_ISR causes such a
652 * @return pdTRUE an item was successfully received from the queue, otherwise
658 * // period. The character is incremented each time.
671 * // Send the next character to the queue.
676 * // The character was successfully posted to the queue.
680 * // Could not post the character to the queue.
683 * // Enable the UART Tx interrupt to cause an interrupt in this
684 * // hypothetical UART. The interrupt will obtain the character
685 * // from the queue and send it.
688 * // Increment to the next character then block for a fixed period.
689 * // cCharToTx will maintain its value across the delay as it is
711 * // Are there any characters in the queue waiting to be sent?
713 * // is woken by the post - ensuring that only a single co-routine is
729 * This function is intended for internal use by the co-routine macros only.
730 * The macro nature of the co-routine implementation requires that the
731 * prototype appears here. The function should not be used by application
734 * Removes the current co-routine from its ready list and places it in the
741 * This function is intended for internal use by the queue implementation only.
742 * The function should not be used by application writers.
744 * Removes the highest priority co-routine from the event list and places it in
745 * the pending ready list.