summaryrefslogtreecommitdiff
path: root/FreeRTOS/Source/tasks.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Enhanced priority dis-inheritance functionality in the case where a task ↵rtel2017-01-161-28/+153
| | | | | | | | | that caused another task to inherit its priority times out before obtain a mutex. Added test code to GenQTest to test the new priority dis-inheritance functionality. Allow the default names given to the Idle and Timer tasks to be overwridden by definitions in FreeRTOSConfig.h. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2478 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update TaskNotify.c to test the condition where a direct to task ↵rtel2016-11-251-10/+33
| | | | | | | | | | | | | notification is sent to a suspended task. Introduce configSTACK_DEPTH_TYPE so the application writer change the type used to specify a stack size from uint16_t to whatever they like. Defaults to uint16_t if not defined. Introduce configINITIAL_TICK_COUNT to allow users to start the tick count at something other than 0. Used for testing, but overflows can be better tested by setting configUSE_16_BIT_TICKS to 1. Split xQueueGenericReceive() into xQueueReceive(), xQueuePeek() and xQueueSemaphoreTake() as the first step in refactoring xQueueGenericReceive(). Add Cortex-M3 port layer for Code Composer Studio - previously there was only a Cortex-M4F port. Introduce configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING() to allow applications to prevent portSUPPRESS_TICKS_AND_SLEEP() being called. Previously the portPRE_SLEEP_PROCESSING() macro could only be used to abort entry into sleep time after clocks had been re-programmed for the distant wake time. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2473 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Add support for statically allocated memory protected tasks - previously ↵rtel2016-09-201-6/+52
| | | | | | only dynamically allocated tasks could be memory protected. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2471 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Correct the definition of StaticTask_t and add additional configASSERT() ↵rtel2016-09-141-1/+42
| | | | | | statements to catch future errors. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2470 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Introduce configRECORD_STACK_HIGH_ADDRESS, which when set will result in ↵rtel2016-09-041-9/+44
| | | | | | | | | both limits of the stack being saved in the TCB to allow enhanced debug capabilities. Introduce configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H, which allows a user provided header file to be included at the bottom of the tasks.c source file, which can add user functions and access file scope data. Replace global on/off switches used for lint errors with save/restore switches. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2469 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Clean up lint errors.rtel2016-08-161-17/+17
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2468 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Changes to core code and port layer:rtel2016-08-161-19/+8
| | | | | | | | | | | | | | + Add configASSERT() into ARM Cortex-M ports to check the number of priority bit settings. + Clear the 'control' register before starting ARM Cortex-M4F ports in case the FPU is used before the scheduler is started. This just saves a few bytes on the main stack as it prevents space being left for a later save of FPU registers. + Added xSemaphoreGetMutexHolderFromISR(). + Corrected use of portNVIC_PENDSVSET to portNVIC_PENDSVSET_BIT in MPU ports. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2467 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Improvements to the Cortex-M ports:rtel2016-06-271-1/+4
| | | | | | | - Clear the SysTick current value register before starting the SysTick (only required if something uses SysTick before starting the scheduler). - Ensure atomic operations are thread safe by executing clrex in the context switch. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2465 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Prepare for V9.0.0 release:rtel2016-05-201-1/+1
| | | | | | + Change version number from V9.0.0rc2 to V9.0.0. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2462 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Recreated MicroBlaze example using Vivado 2016.1 - the Microblaze project is ↵rtel2016-05-101-1/+1
| | | | | | still a work in progress - not yet fully functional. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2457 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Updates to support FreeRTOS MPU in FreeRTOS V9.0.0 - including a GCC project ↵rtel2016-04-181-20/+139
| | | | | | that runs in the Keil simulator to allow development and testing. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2444 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* xTaskGetTaskHandle() changed to xTaskGetHandle().rtel2016-04-151-26/+26
| | | | | | | | | Tidy up CEC1302 demo. Ensure bit 0 of the task address is clear when setting up stack of initial Cortex-M3/4/7 stacks (for strict compliance, although not practically necessary). vTaskGetTaskInfo() changed to vTaskGetInfo() - with a macro added for backward compatibility. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2443 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Remove compiler warning by ensure prvInitialiseMutex() is not included if ↵rtel2016-03-311-17/+25
| | | | | | | | configUSE_MUTEXES is 0. Reduce the number of xTaskCreateStatic() parameters by having the function return the task handle, rather than pass the task handle out using a parameter. This is also consistent with other objectCreate() functions. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2437 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version number to 9.0.0rc2.rtel2016-03-301-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2435 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Make the pcObjectGetName() API function naming consistent - so rename ↵rtel2016-03-291-13/+9
| | | | | | pcTaskGetTaskName() to pcTaskGetName(), rename pcTimerGetTimerName() to pcTimerGetName() and add a #defines in FreeRTOS.h to make the changes backward compatible. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2433 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Create minor optimisations (just an asm instruction or two) by using consts ↵rtel2016-03-291-107/+113
| | | | | | | | in a few places where previously a volatile variable that didn't change was used. Add the simple xTimerGetPeriod() and xTimerGetExpiryTime() functions. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2432 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Notes: rtel2016-03-221-569/+532
| | | | | | | | | | | | | | | | | | + The MPU port is not supported in this revision number. + The documentation for the static allocation functions in the header files has not yet been updated for this revision. Kernel updates: + Simplify the static allocation of objects implementation. + Introduce configSUPPORT_DYNAMIC_ALLOCATION in addition to the existing configSUPPORT_STATIC_ALLOCATION so FreeRTOS can be built without providing a heap at all. Demo application updates: + Update the demos to take into account the new configSUPPORT_DYNAMIC_ALLOCATION constant. + Add an MSVC demo that only uses static allocation, and does not include a FreeRTOS heap. + Update the MSVC project to use both configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION. + Update the MingW project to use only configSUPPORT_DYNAMIC_ALLOCATION. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2428 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version number ready for version 9 release candidate 1.rtel2016-02-181-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2418 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Prepare for a FreeRTOS V9 release candidate:rtel2016-02-181-41/+41
| | | | | | | | | - Remove the standard demo files that used the [long since deprecated] alternative API. - Add standard demo task that tests the new xTaskAbortDelay() function. - Update the Win32 Visual Studio project to use Visual Studio 2015 Community Edition. - Rename the xGenericListItem TCB member to xStateListItem as it better describes the member's purpose. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2417 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Core kernel code changes:rtel2016-02-141-15/+122
| | | | | | | + Added xTaskAbortDelay() function, which causes a task to exit the Blocked state even before the timeout has expired or the event the task is waiting for has occurred. + For efficiency and code size reasons on some architectures, replace many instances of "== pdTRUE" with "!= pdFALSE". git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2416 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* FreeRTOS source:rtel2016-02-101-340/+167
| | | | | | | | | - Major refactor to consolidate the multiple places where a task is removed from a ready list and placed in a delay list into a single function, reducing code size, and enabling the easy addition of up-coming functionality. - Replace the enum used for task notification states with a uint8_t to reduce the TCB struct size with some compilers, and allow additional members to be added without increasing its size. - Rearrange FreeRTOS.h so all INCLUDE_ defaults are grouped together. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2415 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Added a build configuration for the Wonder Gecko starter kit to the existing ↵rtel2016-01-311-1/+1
| | | | | | | | Giant Gecko Simplicity Studio project. Fix some lint warnings that were generated by some of the new core functionality. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2411 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Add vTaskGetTaskInfo() function that allows a TaskStatus_t structure to be ↵rtel2016-01-281-80/+263
| | | | | | | | | | | | | returned for an individual task (previously information could only be obtained for all the tasks at once). Add a member to the TaskStatus_t structure that is used to return the base address of the stack used by the task being queried. Add xTaskGetTaskHandle() that allows the handle of a task to be looked up from the task's text name. Continue to document the macros that allow RTOS objects to be created using statically allocated memory. Introduced vApplicationDaemonTaskStartupHook(), which allows initialisation that that needs to be executed after the scheduler has been started to be executed from the RTOS daemon task. Call prvResetNextTaskUnblockTime() in xTaskResumeAll() if a task is moved from the pending ready list - this can prevent an unnecessary wake from sleep mode if a task is unblocked by an interrupt while in a low power tickless state. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2410 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Ensure the code builds when configSUPPORT_STATIC_ALLOCATION is 0.rtel2016-01-221-7/+7
| | | | | | Continue to document the new static allocation functions. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2408 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Provide the ability to create event groups and software timers using pre ↵rtel2016-01-211-5/+5
| | | | | | | | statically allocated memory - now all RTOS objects can be created using statically allocated memory. Rename StaticTCB_t to StaticTask_t. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2407 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Rename DummyTCB_t to StaticTCB_t.rtel2016-01-181-14/+17
| | | | | | | | | | Move structures used for static allocation of tasks and queues into FreeRTOS.h from their individual API header files. Add SAME70 Xplained Atmel Studio project. Update SAMV71 Atmel Studio project to use Studio 7. Revert some changes to GenQTest.c standard demo task which only function correctly when a queue registry was used. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2404 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel changes:rtel2016-01-121-3/+10
| | | | | | | | | | | Minor change to xQueueGenericReceive() to catch the extreme case of data being placed into a queue between a task timing out and leaving the xQueueGenericReceive() function. Added xSemaphoreGetCount() macro. Demo app changes: Updated countsem.c to test the new xSemaphoreGetCount() macro. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2401 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Changes to the FreeRTOS code:rtel2015-12-201-68/+129
| | | | | | | | | | | | + Introduced xTaskCreateStatic() to allow tasks to be created without any dynamic memory allocation. + When a task notification is used to unblock a task from an ISR, but the xHigherPriorityTaskWoken parameter is not used, then pend a context switch to occur during the next tick interrupt. Demo application changes: + Updated TaskNotify.c to test the case where a task is unblocked by an ISR, but does not use its xHigherPriorityTaskWoken parameter. + Updated the Win32 MSVC project to test statically allocated tasks being created and deleted. + Introduced StaticAllocation.c standard demo task. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2397 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* FreeRTOS source:rtel2015-12-081-18/+29
| | | | | | | | | | | | + Previously, if a task was deleted, the memory allocated to the task by the RTOS was freed in the Idle task. Now if a task deletes another task the memory is freed immediately. The idle task is however still responsible for freeing the memory when a task deletes itself. + Added pcQueueGetQueueName() function to return the name of a queue from its handle, assuming the queue is registers. Demo application: + Update GenQTest to exercise the new pcQueueGetQueueName() function. + Delete workspaces from old Eclipse examples, leaving just the projects. + Rework comments in the MSVC simply blinky demo. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2396 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel changes:rtel2015-11-201-5/+44
| | | | | | | | | | | | | + Support tickless idle when configUSE_PREEMPTION is 0 (previously tickless idle was only supported when the pre-emptive scheduler was being used). + If a stack was statically allocated, then don't try freeing it if the TCB cannot be allocated. + Remove use of INCLUDE_xEventGroupsSetBitsFromISR() pre-processor macro, as it was not tested anyway. Demo app changes: + Updated SAM4L Atmel Studio project to use Atmel Studio 7. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2393 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version number ready for the V8.2.3 release.rtel2015-10-161-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2390 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Preparing for maintenance release:rtel2015-10-161-6/+36
| | | | | | | | | | | | | Kernel source changes: - Added xTaskNotifyStateClear() API function. - Added the GCC Cortex-R port (existed for a while) into the main download. - Improved the IAR RL78 port's handling of different memory model combinations. - Removed some compiler warnings in heap_5.c. Demo app changes: - Added example use of xTaskNotifyStateClear() to the TaskNotify standard demo tasks. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2389 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* FreeRTOS source:rtel2015-09-231-1/+0
| | | | | | | | | | | | + Added Renesas RXv2 port for IAR. Demo apps: + Demo/Rename the CORTEX_R4F_T_GCC_IAR_ARM directory to just Rename the CORTEX_R4F_T_GCC_IAR. + Add IAR project for the RX113. + Add RX231 e2studio projects for the RX231. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2380 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Initial RZ/T port and demo - work in progress, currently only the tick ↵rtel2015-09-071-3/+3
| | | | | | interrupt can be installed. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2373 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Final preparation for new release:rtel2015-08-121-3/+14
| | | | | | | | | | | | FreeRTOS+Trace: - Add trace macros for task notifications. - Update to the latest trace recorder library. Demo projects: - Only include the CLI command to show run time states if configGENERATE_RUN_TIME_STATS is set to 1. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2366 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version numbers in preparation for new release.rtel2015-08-051-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2365 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Common scheduler code:rtel2015-08-041-0/+6
| | | | | | | | | | | - Back out changes that allow mutexes to be given from a semaphore after tests showed issues that would not be fast to fix. Demo projects: - Update the Microblaze Kintex 7 project and BSP to use version 2015.2 of the Xilinx SDK. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2363 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Preparing for new release...rtel2015-08-011-8/+6
| | | | | | | | | | | | | Kernel changes: - Remove an assert that was preventing xQueueSendFromISR() being used to give a mutex from an ISR (mutexes cannot be given using xSemaphoreGiveFromISR()). - Introduce xTaskNotifyAndQueryFromISR() as the interrupt safe version of xTaskNotifyAndQuery(). Common demo task changes: - Update IntSemTest.c to prove the theory that it is safe to give a mutex type semaphore from an interrupt using xQueueSendFromISR() instead of xSemaphoreGiveFromISR(). - Update TaskNotify.c to test the new xTaskNotifyAndQuery() from ISR fuction. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2361 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel changes to improve power saving:rtel2015-05-201-29/+74
| | | | | | | | | + The timer task now blocks indefinitely if there are no timers active, allowing eTaskConfirmSleepModeStatus to return eNoTasksWaitingTimeout when configUSE_TIMERS is set to 1. + The next unblock time is calculated automatically after a task unblocks when waiting for a notification, allowing deep sleep to be entered earlier. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2350 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Add the errno definitions used by FreeRTOS+TCP and FreeRTOS+FAT into ↵rtel2015-04-131-1/+2
| | | | | | | | | | | FreeRTOS's projdefs.h. Remove redundant global definition vPortInstallFreeRTOSVectorTable from the GCC ARM_CA9 portASM.S file. Ensure correct sequence of start up sequence when the Windows port is used on multi-core Windows machines by starting one thread in the suspended state. Move initialisation of xNextTaskUnblockTime to the function that starts the scheduler, rather than from where the variable is declared - this fixes a compiler warning in newer IAR compilers. Fix "elif (SELECTED_PORT == PORT_MICROCHIP_PIC32MX || PORT_MICROCHIP_PIC32MZ)" in the FreeRTOS+Trace trcHardwarePort.h header file. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2342 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Final V8.2.1 release ready for tagging:rtel2015-03-241-1/+6
| | | | | | | | | | + Added MSP432 (ARM Cortex-M4F MSP430!) demos for IAR, Keil and CCS. + Renamed directory containing demo for STM32F7 ARM Cortex-M7. + Renamed directory containing demo for SAMV71 ARM Cortex-M7. + Introduced xTaskNotifyAndQuery(). git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2338 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version number ready for V8.2.1 release.rtel2015-03-211-12/+12
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2337 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Minor updates relating to formatting and comments only.rtel2015-03-201-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2335 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel code:rtel2015-03-041-3/+2
| | | | | | | | | | | + Added mtCOVERAGE_TEST_DELAY() macro to facilitate getting better code coverage during testing. + Update prvNotifyQueueSetContainer() so it does not call xTaskRemoveFromEventList() if it is called from an interrupt, and the queue is locked. Demo apps: Added QueueSetPolling.c/h demo/test functions. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2331 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel updates:rtel2015-02-111-7/+19
| | | | | | | | | | | | | | + Added vTimerSetTimerID() to compliment vTimerGetTimerID(). Now the timer ID can be used as timer local storage. + Updated comments and added some additional assert() calls. Win32 port: + Some changes to allow easier 64-bit builds PIC24/dsPIC port: + Added NOP after disable interrupt instruction. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2329 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel updates:rtel2015-01-261-1/+53
| | | | | | - Add user configurable thread local storage array, with get/set access function. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2328 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version number in preparation for official V8.2.0 release.rtel2015-01-161-40/+14
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2324 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Release candidate - this will be tagged as FreeRTOS V8.2.0rc1 and a zip file ↵rtel2014-12-241-11/+8
| | | | | | | | provided. Minor lint changes. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2320 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Update version numbers in preparation for V8.2.0 release candidate 1.rtel2014-12-211-19/+49
| | | | git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2318 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
* Kernel changes:rtel2014-12-211-2/+86
| | | | | | | | | | | | | | + Made xTaskNotifyGiveFromISR() its own function, rather than a macro that calls xTaskNotifyFromISR() (minor performance improvement). + GCC and Keil Cortex-M4F ports now use vPortRaiseBASEPRI() in place of ulPortRaiseBASEPRI() where the return value is not required (minor performance improvement). Demo changes: Change the [very basic] FreeRTOS+UDP SAM4E driver to use task notifications rather than a semaphore (execution time now 55% what it was in FreeRTOS V8.1.2!). Robustness improvements to IntQueue.c standard demo task.h. Added the latest standard demo tasks, reg test tasks and int q tasks to the SAM4E demo. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2317 1d2547de-c912-0410-9cb9-b8ca96c0e9e2