From d060479353a341c2ceab42939fb72e676ca38906 Mon Sep 17 00:00:00 2001 From: alfred gedeon <28123637+alfred2g@users.noreply.github.com> Date: Tue, 19 Jan 2021 15:32:01 -0800 Subject: [PATCH 01/17] Fix Github checks after move from master to main (#246) --- .github/workflows/ci.yml | 2 +- .github/workflows/kernel-checks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc5e1d150..f5ff4eefb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ on: push: branches: ["**"] pull_request: - branches: [master] + branches: [main] workflow_dispatch: jobs: spell-check: diff --git a/.github/workflows/kernel-checks.yml b/.github/workflows/kernel-checks.yml index 8c644873d..4eb63055f 100644 --- a/.github/workflows/kernel-checks.yml +++ b/.github/workflows/kernel-checks.yml @@ -36,7 +36,7 @@ jobs: uses: lots0logs/gh-action-get-changed-files@2.1.4 with: token: ${{ secrets.GITHUB_TOKEN }} - + # Run checks - name: Check File Headers run: | From 6b524a2fee7f98b7f72eb20489fbea7d46c2ba1c Mon Sep 17 00:00:00 2001 From: Evgeny Ermakov <22344340+unspecd@users.noreply.github.com> Date: Tue, 19 Jan 2021 21:55:34 -0500 Subject: [PATCH 02/17] Fix typo in comment in task.h (#244) --- include/task.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/task.h b/include/task.h index 66c99c56f..cbf412b22 100644 --- a/include/task.h +++ b/include/task.h @@ -1638,7 +1638,7 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL * configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION * * @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer - * @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task + * @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task * @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer */ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, From d0afede565cea83069c18d90a2709f7839780782 Mon Sep 17 00:00:00 2001 From: David Chalco <59750547+dachalco@users.noreply.github.com> Date: Wed, 27 Jan 2021 09:38:20 -0800 Subject: [PATCH 03/17] Delete gitattributes (#253) --- .gitattributes | 105 ------------------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 81170d514..000000000 --- a/.gitattributes +++ /dev/null @@ -1,105 +0,0 @@ -# Line ending normalization -* text=auto - -# Documents -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain -*.md text -*.adoc text -*.textile text -*.mustache text -*.csv text -*.tab text -*.tsv text -*.sql text -*.html text -*.css text - -# Graphics -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.tif binary -*.tiff binary -*.ico binary -*.svg binary -*.eps binary - -#sources -*.c text -*.cc text -*.cxx text -*.cpp text -*.c++ text -*.hpp text -*.h text -*.h++ text -*.hh text -*.s text -*.S text -*.asm text - -# Compiled Object files -*.slo binary -*.lo binary -*.o binary -*.obj binary - -# Precompiled Headers -*.gch binary -*.pch binary - -# Compiled Dynamic libraries -*.so binary -*.dylib binary -*.dll binary - -# Compiled Static libraries -*.lai binary -*.la binary -*.a binary -*.lib binary - -# Executables -*.exe binary -*.out binary -*.app binary - - -# Basic .gitattributes for a python repo. - -# Source files -# ============ -*.pxd text -*.py text -*.py3 text -*.pyw text -*.pyx text - -# Binary files -# ============ -*.db binary -*.p binary -*.pkl binary -*.pyc binary -*.pyd binary -*.pyo binary - -# Note: .db, .p, and .pkl files are associated -# with the python modules ``pickle``, ``dbm.*``, -# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` -# (among others). - -*.sh text -make text -makefile text -*.mk text From 6b4a3d0a6e13de2c35377745aebf23ea5f4d1a01 Mon Sep 17 00:00:00 2001 From: nazar01 Date: Fri, 29 Jan 2021 23:05:04 +0300 Subject: [PATCH 04/17] Typos (#248) * Fix typos in FreeRTOS.h * Fix typos in task.h * Fix typos in tasks.c --- .github/lexicon.txt | 2 ++ include/FreeRTOS.h | 22 +++++++++---------- include/task.h | 52 ++++++++++++++++++++++----------------------- tasks.c | 14 ++++++------ 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/.github/lexicon.txt b/.github/lexicon.txt index 2e6e9a956..d2ac65fe7 100644 --- a/.github/lexicon.txt +++ b/.github/lexicon.txt @@ -1630,6 +1630,7 @@ pvyieldevent pwdtc pwm pwmc +pxtaskcode pxblock pxblocktoinsert pxcallbackfunction @@ -2651,6 +2652,7 @@ wu www wwwfreertos wxr +xtasktodelete xa xaa xaaaa diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index 5e443a629..df263a1bd 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -979,7 +979,7 @@ #ifndef configMIN -/* The application writer has not provided their own MAX macro, so define +/* The application writer has not provided their own MIN macro, so define * the following generic implementation. */ #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) #endif @@ -1105,7 +1105,7 @@ * data hiding policy, so the real structures used by FreeRTOS to maintain the * state of tasks, queues, semaphores, etc. are not accessible to the application * code. However, if the application writer wants to statically allocate such - * an object then the size of the object needs to be know. Dummy structures + * an object then the size of the object needs to be known. Dummy structures * that are guaranteed to have the same size and alignment requirements of the * real objects are used for this purpose. The dummy list and list item * structures below are used for inclusion in such a dummy structure. @@ -1154,7 +1154,7 @@ typedef struct xSTATIC_LIST * strict data hiding policy. This means the Task structure used internally by * FreeRTOS is not accessible to application code. However, if the application * writer wants to statically allocate the memory required to create a task then - * the size of the task object needs to be know. The StaticTask_t structure + * the size of the task object needs to be known. The StaticTask_t structure * below is provided for this purpose. Its sizes and alignment requirements are * guaranteed to match those of the genuine structure, no matter which * architecture is being used, and no matter how the values in FreeRTOSConfig.h @@ -1217,7 +1217,7 @@ typedef struct xSTATIC_TCB * strict data hiding policy. This means the Queue structure used internally by * FreeRTOS is not accessible to application code. However, if the application * writer wants to statically allocate the memory required to create a queue - * then the size of the queue object needs to be know. The StaticQueue_t + * then the size of the queue object needs to be known. The StaticQueue_t * structure below is provided for this purpose. Its sizes and alignment * requirements are guaranteed to match those of the genuine structure, no * matter which architecture is being used, and no matter how the values in @@ -1288,7 +1288,7 @@ typedef struct xSTATIC_EVENT_GROUP * strict data hiding policy. This means the software timer structure used * internally by FreeRTOS is not accessible to application code. However, if * the application writer wants to statically allocate the memory required to - * create a software timer then the size of the queue object needs to be know. + * create a software timer then the size of the queue object needs to be known. * The StaticTimer_t structure below is provided for this purpose. Its sizes * and alignment requirements are guaranteed to match those of the genuine * structure, no matter which architecture is being used, and no matter how the @@ -1316,12 +1316,12 @@ typedef struct xSTATIC_TIMER * internally by FreeRTOS is not accessible to application code. However, if * the application writer wants to statically allocate the memory required to * create a stream buffer then the size of the stream buffer object needs to be - * know. The StaticStreamBuffer_t structure below is provided for this purpose. - * Its size and alignment requirements are guaranteed to match those of the - * genuine structure, no matter which architecture is being used, and no matter - * how the values in FreeRTOSConfig.h are set. Its contents are somewhat - * obfuscated in the hope users will recognise that it would be unwise to make - * direct use of the structure members. + * known. The StaticStreamBuffer_t structure below is provided for this + * purpose. Its size and alignment requirements are guaranteed to match those + * of the genuine structure, no matter which architecture is being used, and + * no matter how the values in FreeRTOSConfig.h are set. Its contents are + * somewhat obfuscated in the hope users will recognise that it would be unwise + * to make direct use of the structure members. */ typedef struct xSTATIC_STREAM_BUFFER { diff --git a/include/task.h b/include/task.h index cbf412b22..d2d1a1901 100644 --- a/include/task.h +++ b/include/task.h @@ -87,7 +87,7 @@ typedef BaseType_t (* TaskHookFunction_t)( void * ); typedef enum { eRunning = 0, /* A task is querying the state of itself, so must be running. */ - eReady, /* The task being queried is in a read or pending ready list. */ + eReady, /* The task being queried is in a ready or pending ready list. */ eBlocked, /* The task being queried is in the Blocked state. */ eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */ eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */ @@ -158,7 +158,7 @@ typedef struct xTASK_STATUS /* Possible return values for eTaskConfirmSleepModeStatus(). */ typedef enum { - eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPORESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */ + eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */ eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */ eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */ } eSleepModeStatus; @@ -246,12 +246,12 @@ typedef enum * task. h *
  * BaseType_t xTaskCreate(
- *                            TaskFunction_t pvTaskCode,
- *                            const char * const pcName,
+ *                            TaskFunction_t pxTaskCode,
+ *                            const char *pcName,
  *                            configSTACK_DEPTH_TYPE usStackDepth,
  *                            void *pvParameters,
  *                            UBaseType_t uxPriority,
- *                            TaskHandle_t *pvCreatedTask
+ *                            TaskHandle_t *pxCreatedTask
  *                        );
  * 
* @@ -275,7 +275,7 @@ typedef enum * support can alternatively create an MPU constrained task using * xTaskCreateRestricted(). * - * @param pvTaskCode Pointer to the task entry function. Tasks + * @param pxTaskCode Pointer to the task entry function. Tasks * must be implemented to never return (i.e. continuous loop). * * @param pcName A descriptive name for the task. This is mainly used to @@ -296,7 +296,7 @@ typedef enum * example, to create a privileged task at priority 2 the uxPriority parameter * should be set to ( 2 | portPRIVILEGE_BIT ). * - * @param pvCreatedTask Used to pass back a handle by which the created task + * @param pxCreatedTask Used to pass back a handle by which the created task * can be referenced. * * @return pdPASS if the task was successfully created and added to a ready @@ -348,12 +348,12 @@ typedef enum /** * task. h *
- * TaskHandle_t xTaskCreateStatic( TaskFunction_t pvTaskCode,
- *                               const char * const pcName,
+* TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode,
+ *                               const char *pcName,
  *                               uint32_t ulStackDepth,
  *                               void *pvParameters,
  *                               UBaseType_t uxPriority,
- *                               StackType_t *pxStackBuffer,
+ *                               StackType_t *puxStackBuffer,
  *                               StaticTask_t *pxTaskBuffer );
  * 
* @@ -369,7 +369,7 @@ typedef enum * memory. xTaskCreateStatic() therefore allows a task to be created without * using any dynamic memory allocation. * - * @param pvTaskCode Pointer to the task entry function. Tasks + * @param pxTaskCode Pointer to the task entry function. Tasks * must be implemented to never return (i.e. continuous loop). * * @param pcName A descriptive name for the task. This is mainly used to @@ -386,7 +386,7 @@ typedef enum * * @param uxPriority The priority at which the task will run. * - * @param pxStackBuffer Must point to a StackType_t array that has at least + * @param puxStackBuffer Must point to a StackType_t array that has at least * ulStackDepth indexes - the array will then be used as the task's stack, * removing the need for the stack to be allocated dynamically. * @@ -394,15 +394,15 @@ typedef enum * then be used to hold the task's data structures, removing the need for the * memory to be allocated dynamically. * - * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will - * be created and a handle to the created task is returned. If either - * pxStackBuffer or pxTaskBuffer are NULL then the task will not be created and + * @return If neither puxStackBuffer nor pxTaskBuffer are NULL, then the task + * will be created and a handle to the created task is returned. If either + * puxStackBuffer or pxTaskBuffer are NULL then the task will not be created and * NULL is returned. * * Example usage: *
  *
- *  // Dimensions the buffer that the task being created will use as its stack.
+ *  // Dimensions of the buffer that the task being created will use as its stack.
  *  // NOTE:  This is the number of words the stack will hold, not the number of
  *  // bytes.  For example, if each stack item is 32-bits, and this is set to 100,
  *  // then 400 bytes (100 * 32-bits) will be allocated.
@@ -643,7 +643,7 @@ typedef enum
  *
  * @param xTask The handle of the task being updated.
  *
- * @param xRegions A pointer to an MemoryRegion_t structure that contains the
+ * @param xRegions A pointer to a MemoryRegion_t structure that contains the
  * new memory region definitions.
  *
  * Example usage:
@@ -684,7 +684,7 @@ void vTaskAllocateMPURegions( TaskHandle_t xTask,
 /**
  * task. h
  * 
- * void vTaskDelete( TaskHandle_t xTask );
+ * void vTaskDelete( TaskHandle_t xTaskToDelete );
  * 
* * INCLUDE_vTaskDelete must be defined as 1 for this function to be available. @@ -703,7 +703,7 @@ void vTaskAllocateMPURegions( TaskHandle_t xTask, * See the demo application file death.c for sample code that utilises * vTaskDelete (). * - * @param xTask The handle of the task to be deleted. Passing NULL will + * @param xTaskToDelete The handle of the task to be deleted. Passing NULL will * cause the calling task to be deleted. * * Example usage: @@ -1976,7 +1976,7 @@ uint32_t ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION; * * eSetBits - * The target notification value is bitwise ORed with ulValue. - * xTaskNofifyIndexed() always returns pdPASS in this case. + * xTaskNotifyIndexed() always returns pdPASS in this case. * * eIncrement - * The target notification value is incremented. ulValue is not used and @@ -2119,7 +2119,7 @@ BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify, * value, if at all. Valid values for eAction are as follows: * * eSetBits - - * The task's notification value is bitwise ORed with ulValue. xTaskNofify() + * The task's notification value is bitwise ORed with ulValue. xTaskNotify() * always returns pdPASS in this case. * * eIncrement - @@ -2289,7 +2289,7 @@ BaseType_t xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, * the Blocked state for a notification to be received, should a notification * not already be pending when xTaskNotifyWait() was called. The task * will not consume any processing time while it is in the Blocked state. This - * is specified in kernel ticks, the macro pdMS_TO_TICSK( value_in_ms ) can be + * is specified in kernel ticks, the macro pdMS_TO_TICKS( value_in_ms ) can be * used to convert a time specified in milliseconds to a time specified in * ticks. * @@ -2559,7 +2559,7 @@ void vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify, * should the count not already be greater than zero when * ulTaskNotifyTake() was called. The task will not consume any processing * time while it is in the Blocked state. This is specified in kernel ticks, - * the macro pdMS_TO_TICSK( value_in_ms ) can be used to convert a time + * the macro pdMS_TO_TICKS( value_in_ms ) can be used to convert a time * specified in milliseconds to a time specified in ticks. * * @return The task's notification count before it is either cleared to zero or @@ -2738,7 +2738,7 @@ void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION; * @param pxTicksToWait The number of ticks to check for timeout i.e. if * pxTicksToWait ticks have passed since pxTimeOut was last updated (either by * vTaskSetTimeOutState() or xTaskCheckForTimeOut()), the timeout has occurred. - * If the timeout has not occurred, pxTIcksToWait is updated to reflect the + * If the timeout has not occurred, pxTicksToWait is updated to reflect the * number of remaining ticks. * * @return If timeout has occurred, pdTRUE is returned. Otherwise pdFALSE is @@ -2875,7 +2875,7 @@ BaseType_t xTaskIncrementTick( void ) PRIVILEGED_FUNCTION; * xItemValue value, and inserts the list item at the end of the list. * * The 'ordered' version uses the existing event list item value (which is the - * owning tasks priority) to insert the list item into the event list is task + * owning task's priority) to insert the list item into the event list in task * priority order. * * @param pxEventList The list containing tasks that are blocked waiting @@ -2885,7 +2885,7 @@ BaseType_t xTaskIncrementTick( void ) PRIVILEGED_FUNCTION; * event list is not ordered by task priority. * * @param xTicksToWait The maximum amount of time that the task should wait - * for the event to occur. This is specified in kernel ticks,the constant + * for the event to occur. This is specified in kernel ticks, the constant * portTICK_PERIOD_MS can be used to convert kernel ticks into a real time * period. */ diff --git a/tasks.c b/tasks.c index 884005af0..fc44c817d 100644 --- a/tasks.c +++ b/tasks.c @@ -76,7 +76,7 @@ */ #define tskSTACK_FILL_BYTE ( 0xa5U ) -/* Bits used to recored how a task's stack and TCB were allocated. */ +/* Bits used to record how a task's stack and TCB were allocated. */ #define tskDYNAMICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 0 ) #define tskSTATICALLY_ALLOCATED_STACK_ONLY ( ( uint8_t ) 1 ) #define tskSTATICALLY_ALLOCATED_STACK_AND_TCB ( ( uint8_t ) 2 ) @@ -100,8 +100,8 @@ #define tskSUSPENDED_CHAR ( 'S' ) /* - * Some kernel aware debuggers require the data the debugger needs access to be - * global, rather than file scope. + * Some kernel aware debuggers require the data the debugger needs access to to + * be global, rather than file scope. */ #ifdef portREMOVE_STATIC_QUALIFIER #define static @@ -224,7 +224,7 @@ /*-----------------------------------------------------------*/ /* - * Several functions take an TaskHandle_t parameter that can optionally be NULL, + * Several functions take a TaskHandle_t parameter that can optionally be NULL, * where NULL is used to indicate that the handle of the currently executing * task should be used in place of the parameter. This macro simply checks to * see if the parameter is NULL and returns a pointer to the appropriate TCB. @@ -338,7 +338,7 @@ typedef tskTCB TCB_t; PRIVILEGED_DATA TCB_t * volatile pxCurrentTCB = NULL; /* Lists for ready and blocked tasks. -------------------- - * xDelayedTaskList1 and xDelayedTaskList2 could be move to function scople but + * xDelayedTaskList1 and xDelayedTaskList2 could be moved to function scope but * doing so breaks some kernel aware debuggers and debuggers that rely on removing * the static qualifier. */ PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ]; /*< Prioritised ready tasks. */ @@ -1660,7 +1660,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxPriorityUsedOnEntry ] ), &( pxTCB->xStateListItem ) ) != pdFALSE ) { /* The task is currently in its ready list - remove before - * adding it to it's new ready list. As we are in a critical + * adding it to its new ready list. As we are in a critical * section we can do this even if the scheduler is suspended. */ if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 ) { @@ -2787,7 +2787,7 @@ BaseType_t xTaskIncrementTick( void ) * state - so record the item value in * xNextTaskUnblockTime. */ xNextTaskUnblockTime = xItemValue; - break; /*lint !e9011 Code structure here is deedmed easier to understand with multiple breaks. */ + break; /*lint !e9011 Code structure here is deemed easier to understand with multiple breaks. */ } else { From 0345a202023caaba4210ea764ed95693d343b098 Mon Sep 17 00:00:00 2001 From: David Chalco <59750547+dachalco@users.noreply.github.com> Date: Fri, 29 Jan 2021 18:58:55 -0800 Subject: [PATCH 05/17] incorporate updates from common (#255) * incorporate updates from common * empty commit to rerun check --- .github/scripts/kernel_checker.py | 6 +++++- .github/workflows/kernel-checks.yml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/kernel_checker.py b/.github/scripts/kernel_checker.py index 91620ec53..3daca3e61 100755 --- a/.github/scripts/kernel_checker.py +++ b/.github/scripts/kernel_checker.py @@ -83,7 +83,11 @@ def main(): checker.ignoreFile(*KERNEL_IGNORED_FILES) checker.ignoreFile(os.path.split(__file__)[-1]) - return checker.processArgs(args) + rc = checker.processArgs(args) + if rc: + checker.showHelp(__file__) + + return rc if __name__ == '__main__': exit(main()) diff --git a/.github/workflows/kernel-checks.yml b/.github/workflows/kernel-checks.yml index 4eb63055f..9e6890830 100644 --- a/.github/workflows/kernel-checks.yml +++ b/.github/workflows/kernel-checks.yml @@ -41,7 +41,7 @@ jobs: - name: Check File Headers run: | mv tools/.github/scripts/common inspect/.github/scripts + pip install -r inspect/.github/scripts/common/requirements.txt cd inspect .github/scripts/kernel_checker.py --json ${HOME}/files_modified.json ${HOME}/files_added.json ${HOME}/files_renamed.json exit $? - From 21b1058bf783d67743a52178f2213bbd4ffe6e71 Mon Sep 17 00:00:00 2001 From: Cobus van Eeden <35851496+cobusve@users.noreply.github.com> Date: Wed, 10 Feb 2021 15:27:16 -0800 Subject: [PATCH 06/17] Update issue templates --- .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..143cedd7e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest a new feature for this project +title: "[Feature Request] " +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From a4b2e0c3f398a7d9fb7955fa39e9322b959c54bc Mon Sep 17 00:00:00 2001 From: alfred gedeon <28123637+alfred2g@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:04:08 -0800 Subject: [PATCH 07/17] Check: improve verbosity of url verifier (#260) * Check: improve verbosity of url verifier * Fix Renesas url * Fix Renesas url * URL add Renesas full url * Fix more Renesas URLs * Fix Renesas url in IAR directory * Testing new curl command for url checks * Fix url_checker * Fix url_verifier * Revert Renesas url changes * add txt to the ignored header checker extentions --- .github/actions/url_verifier.sh | 8 ++++++-- .github/scripts/kernel_checker.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/actions/url_verifier.sh b/.github/actions/url_verifier.sh index 4e9575aa3..f92d2df6d 100755 --- a/.github/actions/url_verifier.sh +++ b/.github/actions/url_verifier.sh @@ -8,6 +8,7 @@ then exit 2 fi +USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36" SCRIPT_RET=0 set -o nounset # Treat unset variables as an error @@ -27,7 +28,7 @@ function test { for UNIQ_URL in ${!dict[@]} # loop urls do - CURL_RES=$(curl -I ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ') + CURL_RES=$(curl -si --user-agent "$(USER_AGENT)" ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ') RES=$? if [ "${CURL_RES}" == '' -o "${CURL_RES}" != '200' ] @@ -38,11 +39,14 @@ function test { then CURL_RES=$RES SCRIPT_RET=1 + echo ERROR: Result is: "${CURL_RES}" elif [ "${CURL_RES}" == '403' ] then SCRIPT_RET=1 + echo ERROR: Result is: "${CURL_RES}" + else + echo WARNING: Result is: "${CURL_RES}" fi - echo Result is: "${CURL_RES}" echo "=================================" fi done diff --git a/.github/scripts/kernel_checker.py b/.github/scripts/kernel_checker.py index 3daca3e61..f29749267 100755 --- a/.github/scripts/kernel_checker.py +++ b/.github/scripts/kernel_checker.py @@ -30,7 +30,8 @@ KERNEL_IGNORED_EXTENSIONS = [ '.tex', '.png', '.bat', - '.sh' + '.sh', + '.txt' ] KERNEL_IGNORED_PATTERNS = [ From 5b9549ab82efade64b053df1816bc37c00cee5e6 Mon Sep 17 00:00:00 2001 From: milesfrain Date: Wed, 10 Feb 2021 21:41:05 -0800 Subject: [PATCH 08/17] Remove unmatched braces in MessageBuffer pre tags (#256) Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> --- include/message_buffer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/message_buffer.h b/include/message_buffer.h index a9d21ce69..1ed49761e 100644 --- a/include/message_buffer.h +++ b/include/message_buffer.h @@ -630,7 +630,7 @@ typedef void * MessageBufferHandle_t; /** * message_buffer.h *
- * BaseType_t xMessageBufferIsFull( MessageBufferHandle_t xMessageBuffer ) );
+ * BaseType_t xMessageBufferIsFull( MessageBufferHandle_t xMessageBuffer );
  * 
* * Tests to see if a message buffer is full. A message buffer is full if it @@ -648,7 +648,7 @@ typedef void * MessageBufferHandle_t; /** * message_buffer.h *
- * BaseType_t xMessageBufferIsEmpty( MessageBufferHandle_t xMessageBuffer ) );
+ * BaseType_t xMessageBufferIsEmpty( MessageBufferHandle_t xMessageBuffer );
  * 
* * Tests to see if a message buffer is empty (does not contain any messages). @@ -690,7 +690,7 @@ typedef void * MessageBufferHandle_t; /** * message_buffer.h *
- * size_t xMessageBufferSpaceAvailable( MessageBufferHandle_t xMessageBuffer ) );
+ * size_t xMessageBufferSpaceAvailable( MessageBufferHandle_t xMessageBuffer );
  * 
* Returns the number of bytes of free space in the message buffer. * @@ -714,7 +714,7 @@ typedef void * MessageBufferHandle_t; /** * message_buffer.h *
- * size_t xMessageBufferNextLengthBytes( MessageBufferHandle_t xMessageBuffer ) );
+ * size_t xMessageBufferNextLengthBytes( MessageBufferHandle_t xMessageBuffer );
  * 
* Returns the length (in bytes) of the next message in a message buffer. * Useful if xMessageBufferReceive() returned 0 because the size of the buffer From 1d4d16fd54bbf15970892033874f9d72d670aa24 Mon Sep 17 00:00:00 2001 From: Jeff Tenney Date: Mon, 15 Feb 2021 15:00:20 -0700 Subject: [PATCH 09/17] Update URL in history.txt (#259) * Update URL in history.txt * Configure CI header checker to ignore .txt files Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com> --- History.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/History.txt b/History.txt index 6dcf3ce31..296068721 100644 --- a/History.txt +++ b/History.txt @@ -79,7 +79,7 @@ Changes between FreeRTOS V10.3.1 and FreeRTOS V10.4.0 released September 10 2020 the same way the Windows port layer enables FreeRTOS to run on Windows hosts. + Many other minor optimisations and enhancements. For full details - see https://github.com/FreeRTOS/FreeRTOS-Kernel/commits/master + see https://github.com/FreeRTOS/FreeRTOS-Kernel/commits/main Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020 From 81f5892105c4d1c93d2941d6ee6c157cfe70bc5c Mon Sep 17 00:00:00 2001 From: Carl Lundin <53273776+lundinc2@users.noreply.github.com> Date: Thu, 18 Feb 2021 18:48:11 -0800 Subject: [PATCH 10/17] Update python version to 3.7.10 (#265) --- .github/workflows/auto-release.yml | 2 +- .github/workflows/kernel-checks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 18712c464..9a6ff1102 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -21,7 +21,7 @@ jobs: - name: Tool Setup uses: actions/setup-python@v2 with: - python-version: 3.8.5 + python-version: 3.7.10 architecture: x64 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/kernel-checks.yml b/.github/workflows/kernel-checks.yml index 9e6890830..df2563e98 100644 --- a/.github/workflows/kernel-checks.yml +++ b/.github/workflows/kernel-checks.yml @@ -11,7 +11,7 @@ jobs: - name: Tool Setup uses: actions/setup-python@v2 with: - python-version: 3.8.5 + python-version: 3.7.10 architecture: x64 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2a604f4a2818b8354b5e1a39e388eb5e16cfbc1f Mon Sep 17 00:00:00 2001 From: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Date: Tue, 23 Feb 2021 18:36:27 -0800 Subject: [PATCH 11/17] Support allocating stack from separate heap (#267) The change adds support for allocating task stacks from separate heap. When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 1 in FreeRTOSConfig.h, task stacks are allocated and freed using pvPortMallocStack and vPortFreeStack functions. This allows the application writer to provide a separate allocator for task stacks. When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 0, task stacks are allocated and freed using FreeRTOS heap functions pvPortMalloc and vPortFree. For backward compatibility, configSTACK_ALLOCATION_FROM_SEPARATE_HEAP defaults to 0. Signed-off-by: Gaurav Aggarwal --- .github/lexicon.txt | 1 + include/FreeRTOS.h | 5 +++++ include/portable.h | 8 ++++++++ tasks.c | 10 +++++----- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/lexicon.txt b/.github/lexicon.txt index d2ac65fe7..9ffef9ac6 100644 --- a/.github/lexicon.txt +++ b/.github/lexicon.txt @@ -1617,6 +1617,7 @@ pvowner pvparameter pvparameters pvportmalloc +pvportmallocstack pvportrealloc pvreg pvrxdata diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index df263a1bd..957325875 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -896,6 +896,11 @@ #define configSUPPORT_DYNAMIC_ALLOCATION 1 #endif +#ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP + /* Defaults to 0 for backward compatibility. */ + #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0 +#endif + #ifndef configSTACK_DEPTH_TYPE /* Defaults to uint16_t for backward compatibility, but can be overridden diff --git a/include/portable.h b/include/portable.h index 4f4c1d52a..f836747f8 100644 --- a/include/portable.h +++ b/include/portable.h @@ -179,6 +179,14 @@ void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION; size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION; size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; +#if( configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1 ) + void *pvPortMallocStack( size_t xSize ) PRIVILEGED_FUNCTION; + void vPortFreeStack( void *pv ) PRIVILEGED_FUNCTION; +#else + #define pvPortMallocStack pvPortMalloc + #define vPortFreeStack vPortFree +#endif + /* * Setup the hardware ready for the scheduler to take control. This generally * sets up a tick interrupt and sets timers for the correct tick frequency. diff --git a/tasks.c b/tasks.c index fc44c817d..6ba21bbd3 100644 --- a/tasks.c +++ b/tasks.c @@ -748,7 +748,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; /* Allocate space for the stack used by the task being created. * The base of the stack memory stored in the TCB so the task can * be deleted later if required. */ - pxNewTCB->pxStack = ( StackType_t * ) pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */ + pxNewTCB->pxStack = ( StackType_t * ) pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */ if( pxNewTCB->pxStack == NULL ) { @@ -763,7 +763,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; StackType_t * pxStack; /* Allocate space for the stack used by the task being created. */ - pxStack = pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */ + pxStack = pvPortMallocStack( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */ if( pxStack != NULL ) { @@ -779,7 +779,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; { /* The stack cannot be used as the TCB was not created. Free * it again. */ - vPortFree( pxStack ); + vPortFreeStack( pxStack ); } } else @@ -3950,7 +3950,7 @@ static void prvCheckTasksWaitingTermination( void ) { /* The task can only have been allocated dynamically - free both * the stack and TCB. */ - vPortFree( pxTCB->pxStack ); + vPortFreeStack( pxTCB->pxStack ); vPortFree( pxTCB ); } #elif ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */ @@ -3962,7 +3962,7 @@ static void prvCheckTasksWaitingTermination( void ) { /* Both the stack and TCB were allocated dynamically, so both * must be freed. */ - vPortFree( pxTCB->pxStack ); + vPortFreeStack( pxTCB->pxStack ); vPortFree( pxTCB ); } else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY ) From 4fde4a8d0adfb302cd9915f5b21010bf1662c834 Mon Sep 17 00:00:00 2001 From: gomonovych Date: Tue, 2 Mar 2021 02:10:00 +0100 Subject: [PATCH 12/17] 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> --- include/task.h | 6 ++++-- tasks.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/task.h b/include/task.h index d2d1a1901..181ed70fd 100644 --- a/include/task.h +++ b/include/task.h @@ -1795,8 +1795,10 @@ UBaseType_t uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, * demo applications. Do not consider it to be part of the scheduler. * * vTaskList() calls uxTaskGetSystemState(), then formats part of the - * uxTaskGetSystemState() output into a human readable table that displays task - * names, states and stack usage. + * uxTaskGetSystemState() output into a human readable table that displays task: + * names, states, priority, stack usage and task number. + * Stack usage specified as the number of unused StackType_t words stack can hold + * on top of stack - not the number of bytes. * * vTaskList() has a dependency on the sprintf() C library function that might * bloat the code size, use a lot of stack, and provide different results on diff --git a/tasks.c b/tasks.c index 6ba21bbd3..a994ec908 100644 --- a/tasks.c +++ b/tasks.c @@ -4434,7 +4434,9 @@ static void prvResetNextTaskUnblockTime( void ) * * vTaskList() calls uxTaskGetSystemState(), then formats part of the * uxTaskGetSystemState() output into a human readable table that - * displays task names, states and stack usage. + * displays task: names, states, priority, stack usage and task number. + * Stack usage specified as the number of unused StackType_t words stack can hold + * on top of stack - not the number of bytes. * * vTaskList() has a dependency on the sprintf() C library function that * might bloat the code size, use a lot of stack, and provide different From 5e45472d6ec29d89eb677c8588cfab2038837636 Mon Sep 17 00:00:00 2001 From: Joseph Julicher Date: Wed, 3 Mar 2021 10:38:12 -0700 Subject: [PATCH 13/17] fixed documentation for ulTaskNotifyTake() and ulTaskNotifyTakeIndexed() (#269) --- include/task.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/task.h b/include/task.h index 181ed70fd..d17bef8e7 100644 --- a/include/task.h +++ b/include/task.h @@ -1934,9 +1934,8 @@ uint32_t ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION; * that way task notifications can be used to send data to a task, or be used as * light weight and fast binary or counting semaphores. * - * A task can use xTaskNotifyWaitIndexed() to [optionally] block to wait for a - * notification to be pending, or ulTaskNotifyTakeIndexed() to [optionally] block - * to wait for a notification value to have a non-zero value. The task does + * A task can use xTaskNotifyWaitIndexed() or ulTaskNotifyTakeIndexed() to + * [optionally] block to wait for a notification to be pending. The task does * not consume any CPU time while it is in the Blocked state. * * A notification sent to a task will remain pending until it is cleared by the @@ -2522,8 +2521,8 @@ void vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify, * value acts like a counting semaphore. * * A task can use ulTaskNotifyTakeIndexed() to [optionally] block to wait for - * the task's notification value to be non-zero. The task does not consume any - * CPU time while it is in the Blocked state. + * a notification. The task does not consume any CPU time while it is in the + * Blocked state. * * Where as xTaskNotifyWaitIndexed() will return when a notification is pending, * ulTaskNotifyTakeIndexed() will return when the task's notification value is From 98eba938e2defa4eca516517113e5bfb0c38969f Mon Sep 17 00:00:00 2001 From: xuelix <33909469+xuelix@users.noreply.github.com> Date: Thu, 4 Mar 2021 21:00:22 +0000 Subject: [PATCH 14/17] Added git-secrets check to Github Actions (#270) Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com> --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5ff4eefb..cb689b7d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,23 @@ jobs: - name: URL Checker run: | bash kernel/.github/actions/url_verifier.sh kernel + + git-secrets: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Checkout awslabs/git-secrets + uses: actions/checkout@v2 + with: + repository: awslabs/git-secrets + ref: master + path: git-secrets + - name: Install git-secrets + run: cd git-secrets && sudo make install && cd .. + - name: Run git-secrets + run: | + git-secrets --register-aws + git-secrets --scan + From 4b5d1e43959e5f4e245c3af708056f6b4b324862 Mon Sep 17 00:00:00 2001 From: alfred gedeon <28123637+alfred2g@users.noreply.github.com> Date: Fri, 5 Mar 2021 09:13:03 -0800 Subject: [PATCH 15/17] Comment: fix code comment for xTaskAbortDelay (#272) --- tasks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks.c b/tasks.c index a994ec908..fd3c25744 100644 --- a/tasks.c +++ b/tasks.c @@ -2694,8 +2694,8 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) #if ( configUSE_PREEMPTION == 1 ) { /* Preemption is on, but a context switch should only be - * performed if the unblocked task has a priority that is - * equal to or higher than the currently executing task. */ + * performed if the unblocked task has a priority that is + * higher than the currently executing task. */ if( pxTCB->uxPriority > pxCurrentTCB->uxPriority ) { /* Pend the yield to be performed when the scheduler From de19eeb7d343531496a7e46ca36e10abe3874f02 Mon Sep 17 00:00:00 2001 From: xuelix <33909469+xuelix@users.noreply.github.com> Date: Fri, 5 Mar 2021 22:00:57 +0000 Subject: [PATCH 16/17] Moved git-secrets check to a different workflow (#271) git-secrets check is now performed on all PR branches --- .github/workflows/ci.yml | 19 ------------------- .github/workflows/git-secrets.yml | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/git-secrets.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb689b7d4..50c1b1871 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,22 +45,3 @@ jobs: run: | bash kernel/.github/actions/url_verifier.sh kernel - git-secrets: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Checkout awslabs/git-secrets - uses: actions/checkout@v2 - with: - repository: awslabs/git-secrets - ref: master - path: git-secrets - - name: Install git-secrets - run: cd git-secrets && sudo make install && cd .. - - name: Run git-secrets - run: | - git-secrets --register-aws - git-secrets --scan - diff --git a/.github/workflows/git-secrets.yml b/.github/workflows/git-secrets.yml new file mode 100644 index 000000000..b78a79c45 --- /dev/null +++ b/.github/workflows/git-secrets.yml @@ -0,0 +1,24 @@ +name: git-secrets Check +on: + push: + pull_request: + workflow_dispatch: +jobs: + git-secrets: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Checkout awslabs/git-secrets + uses: actions/checkout@v2 + with: + repository: awslabs/git-secrets + ref: master + path: git-secrets + - name: Install git-secrets + run: cd git-secrets && sudo make install && cd .. + - name: Run git-secrets + run: | + git-secrets --register-aws + git-secrets --scan From 18d4ba9c0792278a4e6351508e3410bdabe98275 Mon Sep 17 00:00:00 2001 From: Paul Bartell Date: Fri, 5 Mar 2021 18:46:49 -0800 Subject: [PATCH 17/17] Add some assertions and coverage exceptions to queue.c (#273) * Add an LCOV_BRANCH exception for the check that sizeof( StaticQueue_t ) == sizeof( Queue_t ) * Add LCOV_BRANCH coverage exception for a configASSERT on pxQueueSetContainer with a condition that is unreachable. * Add configASSERTs to alert when invalid parameters are passed into Queue Registry related functions. * Assert that the semaphore handle passed into xQueueGetMutexHolder is not NULL. * Correct some typos in queue.c * Update lexicon.txt --- .github/lexicon.txt | 6 ++++-- queue.c | 30 ++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/lexicon.txt b/.github/lexicon.txt index 9ffef9ac6..800def74d 100644 --- a/.github/lexicon.txt +++ b/.github/lexicon.txt @@ -1529,6 +1529,7 @@ prvinitialisenewstreambuffer prvinitialisenewtimer prvinsertblockintofreelist prvlockqueue +prvnotifyqueuesetcontainer prvportmalloc prvportresetpic prvprocesssimulatedinterrupts @@ -1631,7 +1632,6 @@ pvyieldevent pwdtc pwm pwmc -pxtaskcode pxblock pxblocktoinsert pxcallbackfunction @@ -1688,6 +1688,7 @@ pxprevious pxpreviouswaketime pxqueue pxqueuebuffer +pxqueuesetcontainer pxramstack pxreadycoroutinelists pxreadytaskslists @@ -1707,6 +1708,7 @@ pxstreambuffercreatestatic pxtagvalue pxtask pxtaskbuffer +pxtaskcode pxtaskdefinition pxtaskstatus pxtaskstatusarray @@ -2653,7 +2655,6 @@ wu www wwwfreertos wxr -xtasktodelete xa xaa xaaaa @@ -3020,6 +3021,7 @@ xtaskswaitingforbits xtaskswaitingtermination xtaskswaitingtoreceive xtaskswaitingtosend +xtasktodelete xtasktonotify xtasktoquery xtasktoresume diff --git a/queue.c b/queue.c index 7ed8e9878..6805cd050 100644 --- a/queue.c +++ b/queue.c @@ -342,8 +342,10 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue, * variable of type StaticQueue_t or StaticSemaphore_t equals the size of * the real queue and semaphore structures. */ volatile size_t xSize = sizeof( StaticQueue_t ); - configASSERT( xSize == sizeof( Queue_t ) ); - ( void ) xSize; /* Keeps lint quiet when configASSERT() is not defined. */ + + /* This assertion cannot be branch covered in unit tests */ + configASSERT( xSize == sizeof( Queue_t ) ); /* LCOV_EXCL_BR_LINE */ + ( void ) xSize; /* Keeps lint quiet when configASSERT() is not defined. */ } #endif /* configASSERT_DEFINED */ @@ -398,7 +400,7 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue, configASSERT( ( uxItemSize == 0 ) || ( uxQueueLength == ( xQueueSizeInBytes / uxItemSize ) ) ); /* Check for addition overflow. */ - configASSERT( ( sizeof( Queue_t ) + xQueueSizeInBytes ) > xQueueSizeInBytes ); + configASSERT( ( sizeof( Queue_t ) + xQueueSizeInBytes ) > xQueueSizeInBytes ); /* Allocate the queue and storage area. Justification for MISRA * deviation as follows: pvPortMalloc() always ensures returned memory @@ -561,6 +563,8 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, TaskHandle_t pxReturn; Queue_t * const pxSemaphore = ( Queue_t * ) xSemaphore; + configASSERT( xSemaphore ); + /* This function is called by xSemaphoreGetMutexHolder(), and should not * be called directly. Note: This is a good way of determining if the * calling task is the mutex holder, but not a good way of determining the @@ -944,15 +948,15 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue, vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait ); /* Unlocking the queue means queue events can effect the - * event list. It is possible that interrupts occurring now + * event list. It is possible that interrupts occurring now * remove this task from the event list again - but as the * scheduler is suspended the task will go onto the pending - * ready last instead of the actual ready list. */ + * ready list instead of the actual ready list. */ prvUnlockQueue( pxQueue ); /* Resuming the scheduler will move tasks from the pending * ready list into the ready list - so it is feasible that this - * task is already in a ready list before it yields - in which + * task is already in the ready list before it yields - in which * case the yield will not cause a context switch unless there * is also a higher priority task in the pending ready list. */ if( xTaskResumeAll() == pdFALSE ) @@ -1774,7 +1778,7 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue, taskEXIT_CRITICAL(); /* Interrupts and other tasks can send to and receive from the queue - * now the critical section has been exited. */ + * now that the critical section has been exited. */ vTaskSuspendAll(); prvLockQueue( pxQueue ); @@ -2723,6 +2727,9 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) { UBaseType_t ux; + configASSERT( xQueue ); + configASSERT( pcQueueName ); + /* See if there is an empty space in the registry. A NULL name denotes * a free slot. */ for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ ) @@ -2753,6 +2760,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) UBaseType_t ux; const char * pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ + configASSERT( xQueue ); + /* Note there is nothing here to protect against another task adding or * removing entries from the registry while it is being searched. */ @@ -2781,6 +2790,8 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) { UBaseType_t ux; + configASSERT( xQueue ); + /* See if the handle of the queue being unregistered in actually in the * registry. */ for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ ) @@ -2967,7 +2978,10 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) /* This function must be called form a critical section. */ - configASSERT( pxQueueSetContainer ); + /* The following line is not reachable in unit tests because every call + * to prvNotifyQueueSetContainer is preceded by a check that + * pxQueueSetContainer != NULL */ + configASSERT( pxQueueSetContainer ); /* LCOV_EXCL_BR_LINE */ configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength ); if( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength )