| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- /*
- * FreeRTOS Kernel V10.4.6
- * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * SPDX-License-Identifier: MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * https://www.FreeRTOS.org
- * https://github.com/FreeRTOS
- *
- */
- #ifndef INC_TASK_H
- #define INC_TASK_H
- #ifndef INC_FREERTOS_H
- #error "include FreeRTOS.h must appear in source files before include task.h"
- #endif
- /* *INDENT-OFF* */
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* *INDENT-ON* */
- /*-----------------------------------------------------------
- * MACROS AND DEFINITIONS
- *----------------------------------------------------------*/
- /*
- * If tskKERNEL_VERSION_NUMBER ends with + it represents the version in development
- * after the numbered release.
- *
- * The tskKERNEL_VERSION_MAJOR, tskKERNEL_VERSION_MINOR, tskKERNEL_VERSION_BUILD
- * values will reflect the last released version number.
- */
- #define tskKERNEL_VERSION_NUMBER "V10.4.6"
- #define tskKERNEL_VERSION_MAJOR 10
- #define tskKERNEL_VERSION_MINOR 4
- #define tskKERNEL_VERSION_BUILD 6
- /**
- * task. h
- *
- * Macro to mark the start of a critical code region. Preemptive context
- * switches cannot occur when in a critical region.
- *
- * NOTE: This may alter the stack (depending on the portable implementation)
- * so must be used with care!
- *
- * \defgroup taskENTER_CRITICAL taskENTER_CRITICAL
- * \ingroup SchedulerControl
- */
- #define taskENTER_CRITICAL() portENTER_CRITICAL()
- #define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
- /**
- * task. h
- *
- * Macro to mark the end of a critical code region. Preemptive context
- * switches cannot occur when in a critical region.
- *
- * NOTE: This may alter the stack (depending on the portable implementation)
- * so must be used with care!
- *
- * \defgroup taskEXIT_CRITICAL taskEXIT_CRITICAL
- * \ingroup SchedulerControl
- */
- #define taskEXIT_CRITICAL() portEXIT_CRITICAL()
- #define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
- /**
- * task. h
- *
- * Macro to disable all maskable interrupts.
- *
- * \defgroup taskDISABLE_INTERRUPTS taskDISABLE_INTERRUPTS
- * \ingroup SchedulerControl
- */
- #define taskDISABLE_INTERRUPTS() portDISABLE_INTERRUPTS()
- /**
- * task. h
- *
- * Macro to enable microcontroller interrupts.
- *
- * \defgroup taskENABLE_INTERRUPTS taskENABLE_INTERRUPTS
- * \ingroup SchedulerControl
- */
- #define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()
- /*-----------------------------------------------------------
- * SCHEDULER CONTROL
- *----------------------------------------------------------*/
- /**
- * task. h
- * @code{c}
- * void vTaskSuspendAll( void );
- * @endcode
- *
- * Suspends the scheduler without disabling interrupts. Context switches will
- * not occur while the scheduler is suspended.
- *
- * After calling vTaskSuspendAll () the calling task will continue to execute
- * without risk of being swapped out until a call to xTaskResumeAll () has been
- * made.
- *
- * API functions that have the potential to cause a context switch (for example,
- * xTaskDelayUntil(), xQueueSend(), etc.) must not be called while the scheduler
- * is suspended.
- *
- * Example usage:
- * @code{c}
- * void vTask1( void * pvParameters )
- * {
- * for( ;; )
- * {
- * // Task code goes here.
- *
- * // ...
- *
- * // At some point the task wants to perform a long operation during
- * // which it does not want to get swapped out. It cannot use
- * // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
- * // operation may cause interrupts to be missed - including the
- * // ticks.
- *
- * // Prevent the real time kernel swapping out the task.
- * vTaskSuspendAll ();
- *
- * // Perform the operation here. There is no need to use critical
- * // sections as we have all the microcontroller processing time.
- * // During this time interrupts will still operate and the kernel
- * // tick count will be maintained.
- *
- * // ...
- *
- * // The operation is complete. Restart the kernel.
- * xTaskResumeAll ();
- * }
- * }
- * @endcode
- * \defgroup vTaskSuspendAll vTaskSuspendAll
- * \ingroup SchedulerControl
- */
- void vTaskSuspendAll( void );
- /**
- * task. h
- * @code{c}
- * BaseType_t xTaskResumeAll( void );
- * @endcode
- *
- * Resumes scheduler activity after it was suspended by a call to
- * vTaskSuspendAll().
- *
- * xTaskResumeAll() only resumes the scheduler. It does not unsuspend tasks
- * that were previously suspended by a call to vTaskSuspend().
- *
- * @return If resuming the scheduler caused a context switch then pdTRUE is
- * returned, otherwise pdFALSE is returned.
- *
- * Example usage:
- * @code{c}
- * void vTask1( void * pvParameters )
- * {
- * for( ;; )
- * {
- * // Task code goes here.
- *
- * // ...
- *
- * // At some point the task wants to perform a long operation during
- * // which it does not want to get swapped out. It cannot use
- * // taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
- * // operation may cause interrupts to be missed - including the
- * // ticks.
- *
- * // Prevent the real time kernel swapping out the task.
- * vTaskSuspendAll ();
- *
- * // Perform the operation here. There is no need to use critical
- * // sections as we have all the microcontroller processing time.
- * // During this time interrupts will still operate and the real
- * // time kernel tick count will be maintained.
- *
- * // ...
- *
- * // The operation is complete. Restart the kernel. We want to force
- * // a context switch - but there is no point if resuming the scheduler
- * // caused a context switch already.
- * if( !xTaskResumeAll () )
- * {
- * taskYIELD ();
- * }
- * }
- * }
- * @endcode
- * \defgroup xTaskResumeAll xTaskResumeAll
- * \ingroup SchedulerControl
- */
- BaseType_t xTaskResumeAll( void );
- /* *INDENT-OFF* */
- #ifdef __cplusplus
- }
- #endif
- /* *INDENT-ON* */
- #endif /* INC_TASK_H */
|