Commit Graph

44 Commits

Author SHA1 Message Date
Jeff Tenney
990643ebe8
Fix support for stepping tick by xExpectedIdleTime (#73)
* Fix support for stepping maximum number of ticks

This commit fixes support for tickless implementations that call
vTaskStepTick() with the maximum number of allowed ticks to step.

vTaskStepTick()
---------------
Function vTaskStepTick() provides a way for the tickless idle
implementation to account for ticks that elapse during tickless idle.
The maximum number of stepped ticks allowed is the number passed to
portSUPPRESS_TICKS_AND_SLEEP().  It is the number of ticks between
xTickCount and xNextTaskUnblockTime.

vTaskStepTick() is specifically intended for use with tickless idle,
so it always executes with the scheduler disabled.  For reference,
compare it with the more general function xTaskCatchUpTicks().

Without this Change
-------------------
Prior to this commit, if a task is supposed to wake at xTickCount ==
0xFFFFFFFF, then when tickless idle ends, function vTaskStepTick()
sets the tick to 0xFFFFFFFF but the task remains on the delayed list
because xTaskIncrementTick() does not execute.  One tick later,
xTaskIncrementTick() executes because it's time to increment xTickCount
to 0x00000000.  An assertion failure occurs in
taskSWITCH_DELAYED_LISTS() because the delayed task list is not
empty.  Other examples of valling vTaskStepTick() with the maximum
allowed number of ticks merely result in a task waking one tick late.

Default Tickless Implementations
--------------------------------
Note that the default tickless implementations never pass the maximum
allowed value to vTaskStepTick().  The default implementations use the
tick interrupt to finish the sleep and allow that one tick to be
counted normally via the tick ISR and xTaskIncrementTick().

* Protect xPendedTicks with critical section

Function xTaskIncrementTick() increments xPendedTicks when the
scheduler is disabled.  That function typically executes inside the tick
ISR.  So code in xTaskCatchUpTicks() must mask interrupts when modifying
xPendedTicks.

* uncrustify tasks.c

* Update tasks.c

Style changes only - added comment and indentation to the two modified files.

* uncrustify

* Add test coverage for new conditional

* Add typecast

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
Co-authored-by: Joseph Julicher <jjulicher@mac.com>
Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com>
2022-01-10 12:44:12 -07:00
Joseph Julicher
c4f9e27c28
Feature: Add task top/end of stack to task info report (#436)
uncrustify

Co-authored-by: Shreyas Balakrishna <shreyasbharath@users.noreply.github.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2022-01-06 12:03:56 -07:00
Pramith K V
4c4089b154
Remove tickless idle mode dependency with include v task suspend (#422)
* Fix Remove tickless idle feature dependency with INCLUDE_vTaskSuspend
* fix unused variable warning
* Fix CI fomatting check

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Authored-by: pramithkv <pramit@lifesignals.com>
2021-12-08 15:47:07 -08:00
prplz
a40d52dc05
Fix documentation mistake (#407)
ulTaskNotification -> ulTaskNotify
2021-11-05 10:55:17 -07:00
Zim Kalinowski
f8ada39d85
Replace <pre> with @code - remaining files (#388)
Co-authored-by: Paul Bartell <pbartell@amazon.com>
Co-authored-by: Ming Yue <mingyue86010@gmail.com>
2021-09-07 12:03:12 -07:00
alfred gedeon
ce81bcb33f
Run uncrustify with github workflows (#369)
* uncrustify with github workflows

* Fix find expression

* Add uncrustify configuration file

* Uncrustify some files

* uncrustify some more files

* uncrustify more files

* Fix whitespace at end of lines

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2021-07-28 17:53:10 -07:00
Tobias Nießen
1d86b973aa
Fix description of vTaskDelay (#363) 2021-07-06 14:10:53 -07:00
swaldhoer
46338705bd
Replace two dashes and one whitespace with their corresponding ASCII characters. (#362) 2021-06-30 15:07:55 -07:00
RichardBarry
ddc840fd28
Make the type used to hold run-time counter values configurable (#350)
* Introduce configRUN_TIME_COUNTER_TYPE which enables developers to define the type used to hold run time statistic counters.  Defaults to uint32_t for backward compatibility.  #define configRUN_TIME_COUNTER_TYPE to a type (for example, uint64_t) in FreeRTOSConfig.h to override the default.

Introduce ulTaskGetIdleRunTimePercent() to complement the pre-existing ulTaskGetIdleRunTimeCounter().  Whereas the pre-existing function returns the raw run time counter value, the new function returns the percentage of the entire run time consumed by the idle task.  Note the amount of idle time is only a good measure of the slack time in a system if there are no other tasks executing at the idle priority, tickless
idle is not used, and configIDLE_SHOULD_YIELD is set to 0.

* Add ultaskgetidleruntimepercent to lexicon.txt.

* Update History file.
Add the MPU version of ulTaskGetIdleRunTimePercent().

* Update include/FreeRTOS.h to correct comment as per aggarg@ suggestion.
* Fix alignment in mpu_wrappers.h.
Commit changes to mpu_prototypes.h which were missed from the original commit.
2021-06-14 12:17:41 -07:00
paulbartell
2f6c91be62 [AUTO][RELEASE]: Bump task.h version macros to "10.4.4+" 2021-05-28 23:03:08 +00:00
Joseph Julicher
b4a7a04657
Add history.txt for the 10.4.4 release (#336)
* updated history.txt for 10.4.4

* Update the release date in History.txt

* added link to SMP branch to History.txt

* Added comment explaining the + in the version string

* corrected typos in the + comment

Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
Co-authored-by: Paul Bartell <pbartell@amazon.com>
2021-05-28 15:48:53 -07:00
Paul Bartell
3a413d1022 Add SPDX-License-Identifier: MIT to MIT licensed files. 2021-05-27 19:57:55 -07:00
Paul Bartell
a1b9132a6d Update tskKERNEL_VERSION_NUMBER and tskKERNEL_VERSION_BUILD to V10.4.999 to denote the development branch 2021-05-27 19:57:55 -07:00
Paul Bartell
adfc53368f Update copyright year from 2020 to 2021 2021-05-27 19:57:55 -07:00
Paul Bartell
08dc6f64ee Change kernel revision in each file header from V10.4.3 to <DEVELOPMENT BRANCH> 2021-05-27 19:57:55 -07:00
Joseph Julicher
5e45472d6e
fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() (#269) 2021-03-03 09:38:12 -08:00
gomonovych
4fde4a8d0a
Add description for vTaskList (#206)
Describe each column which vTaskList print:
task name, task status, task priority, task stack unused watermark lewel, task number

Co-authored-by: David Chalco <59750547+dachalco@users.noreply.github.com>
2021-03-01 18:10:00 -07:00
nazar01
6b4a3d0a6e
Typos (#248)
* Fix typos in FreeRTOS.h

* Fix typos in task.h

* Fix typos in tasks.c
2021-01-29 12:05:04 -08:00
Evgeny Ermakov
6b524a2fee
Fix typo in comment in task.h (#244) 2021-01-19 18:55:34 -08:00
Cobus van Eeden
aa471cfd3f [AUTO][RELEASE]: Bump task.h version macros to "10.4.3" 2020-12-14 10:13:41 -08:00
Cobus van Eeden
ec62f69dab [AUTO][RELEASE]: Bump file header version to "10.4.3" 2020-12-14 10:13:39 -08:00
David Chalco
50a2321838 [AUTO][RELEASE]: Bump task.h version macros to "10.4.2" 2020-11-10 14:42:58 -08:00
David Chalco
337bca615e [AUTO][RELEASE]: Bump file header version to "10.4.2" 2020-11-10 14:42:58 -08:00
alfred gedeon
f62dfa20c8
Fix: C++ compiler warning (#203) 2020-10-20 15:37:14 -07:00
RichardBarry
5fb26de019
Recently vTaskDelayUntil() was updated to xTaskDelayUntil() because the function now returns a value. The PR didn't make the same change in the MPU port, or update the constants required to include the xTaskDelayUntil() function in the build. (#199)
This PR:
Changes the INCLUDE_vTaskDelayUntil compile time constant to INCLUDE_xTaskDelayUntil.
Updates FreeRTOS.h to ensure backward compatibility for projects that already have INCLUDE_vTaskDelayUntil defined.
Updates the MPU prototypes, wrapper and implementation to use the updated xTaskDelayUntil() function.

Tests to be checked into the FreeRTOS/FreeRTOS repository after this PR.
2020-10-11 14:04:49 -07:00
RichardBarry
167ea16282
Minor updates to formatting and MISRA compliance of the PR used to update the vTaskDelayUntil() function to xTaskDelayUntil(). (#198) 2020-10-10 21:42:38 -07:00
Spacefish
3260e228c3
vTaskDelayUntil improvement (#77)
* vTaskDelayUntil improvement

* suggestions implemented

* xTaskDelayUntil #define added

* doc small fix

* small formatting stuff

* more small formatting stuff

* Update lexicon.txt

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Co-authored-by: Carl Lundin <lundinc@amazon.com>
2020-10-08 17:46:47 -07:00
David Chalco
3604527e3b
Update version number to 10.4.1 (#173) 2020-09-17 15:25:15 -07:00
Ravishankar Bhagavandas
31dc8f39bd
Fix: Rename parameter uxIndexToNotify to uxIndexToWaitOn (#174) 2020-09-17 13:16:39 -07:00
Carl Lundin
acee77be5b
FreeRTOS Kernel Spelling Update (#170)
* FreeRTOS Kernel Spelling Update

* Added spell check to kernel repository.
* Fixed small spelling errors in various kernel source files.
* Added documentation for spellcheck.

Note: Only kernel files are checked for spelling, and portable files are ignored.
2020-09-16 11:17:39 -07:00
David Chalco
5dfab0306b
Update version number to 10.4.0 (#153) 2020-09-10 19:49:34 -07:00
alfred gedeon
a038146915
Style: Make freertos.org = FreeRTOS.org and add https (#134)
* Style: make freertos.org = FreeRTOS.org also add https

* Style: Fix freertos into FreeRTOS

* Style: Fix freertos into FreeRTOS

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
2020-08-21 11:30:39 -07:00
alfred gedeon
0b0a2060c0
Style: Change FreeRTOS websites in comments (#131)
* Style: Change FreeRTOS websites in comments

* Style: Change freertos to FreeRTOS in comments

* Style: Remove broken link

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
2020-08-20 14:59:28 -07:00
David Chalco
ebda49376e
finish up PR67. Also add missing <\pre> tags (#130) 2020-08-18 16:28:02 -07:00
Joseph Julicher
1865857eae
Moving the function prototypes to headers (#128)
* Removing StackMacros.h

* Moving 4 Function Prototypes out of the C files into the headers

* Revert "Removing StackMacros.h"

This reverts commit cdd8307817048c794d038588aa00833b0532401b.
2020-08-18 11:29:00 -07:00
alfred gedeon
9a1ebfec31
Style: Uncrustify kernel file - remove tab == 4 spaces (#123)
* Style: uncrystify kernel files and remove tabs

* Style: uncrystify kernel files and remove tabs

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
2020-08-17 16:16:11 -07:00
alfred gedeon
8c77117c32
Style: Remove tabs and tab == 4 spaces (#120)
* Style: Remove tabls and tab == 4 spaces

* Style: remove xx accidentally left

* Style: revert uncrustify for untested portable directories

* Style: revert more uncrustify files

* Style: Revert more uncrustified files

* Style: Revert some uncrutified files

* Style: change more files

* Style: remove t tab == 4 spaces

* Style: remove tabs = spaces

* Style: revert changed files

* Style: redo the stuyles

* Style: add uncrustify disable parsing for asm

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
2020-08-17 14:50:56 -07:00
Alfred Gedeon
587a83d647 Style: uncrustify kernel files 2020-07-08 10:24:06 -07:00
Alfred Gedeon
718178c68a Style: uncrusitfy 2020-07-08 10:24:06 -07:00
Alfred Gedeon
a5dbc2b1de Style: uncrustify kernel files 2020-07-08 10:24:06 -07:00
RichardBarry
f2081af030
Feature/multiple direct to task notifications (#63)
Description
Before this change each task had a single direct to task notification value and state as described here: https://www.FreeRTOS.org/RTOS-task-notifications.html. After this change each task has an array of task notifications, so more than one task notification value and state per task. The new FreeRTOSConfig.h compile time constant configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the array.

Each notification within the array operates independently - a task can only block on one notification within the array at a time and will not be unblocked by a notification sent to any other array index.

Task notifications were introduced as a light weight method for peripheral drivers to pass data and events to tasks without the need for an intermediary object such as a semaphore - for example, to unblock a task from an ISR when the operation of a peripheral completed. That use case only requires a single notification value. Their popularity and resultant expanded use cases have since made the single value a limitation - especially as FreeRTOS stream and message buffers themselves use the notification mechanism. This change resolves that limitation. Stream and message buffers still use the task notification at array index 0, but now application writers can avoid any conflict that might have with their own use of task notifications by using notifications at array indexes other than 0.

The pre-existing task notification API functions work in a backward compatible way by always using the task notification at array index 0. For each such function there is now an equivalent that is postfixed "Indexed" and takes an additional parameter to specify which index within the array it should operate upon. For example, xTaskNotify() is the original that only operates on array index 0. xTaskNotifyIndexed() is the new function that can operate on any array index.

Test Steps
The update is tested using the Win32 demo (PR to be created in the FreeRTOS/FreeRTOS github repo), which has been updated to build and run a new test file FreeRTOS/Demo/Common/Minimal/TaskNotifyArray.c. The tests in that file are in addition to, not a replacement for those in FreeRTOS/Demo/Common/Minimal/TaskNotify.c.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
2020-05-27 12:28:48 -07:00
RichardBarry
5d28744feb Improve documentation for the ulTaskNotifyValueClear() and xTaskCatchUpTicks() API functions.
Move the prototype and documentation for xTaskCatchUpTicks() into the correct place in the task.h header file (in the public documentation from the private documentation).
Rename the variable that holds the return value in xTaskCatchUpTicks() to more accurately represent its meaning.
2020-03-15 20:24:18 -07:00
Yuhui.Zheng
88e32327e9
version bump to v10.3.1 (#16)
* Verion bump from 10.3.0 to 10.3.1.
* version bump in task.h
* change history for 10.3.1.
2020-02-18 22:03:54 -08:00
Yuhui Zheng
210b1ffcc8 Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00