Feature/multiple direct to task notifications (#73)

* Add TaskNotifyArray.c with the single task tests updated to use the task notification array up to the point where the timer is created.

* Continue working on TaskNotifyArray.c to test the new task notification indexes.  Next TaskNotifyArray.c will be refactored to break the tests up a bit.

* Refactor and update the comments in TaskNotifyArray.c - no functional changes.

* Change from the task notify "array" to task notification "indexed" nomenclature in the new task notification API functions that work on one particular task notification with the array of task notifications.

* Update the implementation of the taskNOTIFY_TAKE() and taskNOTIFY_WAIT() trace macros to take the array index of the task notification they are acting on.
Rename configNUMBER_OF_TASK_NOTIFICATIONS to configTASK_NOTIFICATION_ARRAY_ENTRIES.
Add FreeRTOS/Demo/Common/Minimal/TaskNotifyArray.c to the Visual Studio project - the file implements tests specific to the behaviour of the indexed task notification functions and should be used in addition to the tests already provided in FreeRTOS/Demo/Common/Minimal/TaskNotify.c.
pull/88/head^2
RichardBarry 5 years ago committed by GitHub
parent b9e4ecfaf7
commit 2df5eeef57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1253,8 +1253,8 @@ extern void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t si
trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(TRACE_TASK_NOTIFY_TAKE_TRCFAILED, TASK, pxCurrentTCB, xTicksToWait); \
}
#else /* TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0 */
#define traceTASK_NOTIFY_TAKE() \
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED){ \
#define traceTASK_NOTIFY_TAKE( index ) \
if (pxCurrentTCB->ucNotifyState[ ( index ) ] == taskNOTIFICATION_RECEIVED){ \
trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(TRACE_TASK_NOTIFY_TAKE, TASK, pxCurrentTCB, xTicksToWait); \
}else{ \
trcKERNEL_HOOKS_KERNEL_SERVICE_WITH_PARAM(TRACE_TASK_NOTIFY_TAKE_TRCFAILED, TASK, pxCurrentTCB, xTicksToWait);}
@ -1276,10 +1276,10 @@ extern void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t si
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT_TRCFAILED, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \
}
#else /* TRC_CFG_FREERTOS_VERSION < TRC_FREERTOS_VERSION_9_0_0 */
#define traceTASK_NOTIFY_WAIT() \
#define traceTASK_NOTIFY_WAIT( index ) \
if (TRACE_GET_OBJECT_FILTER(TASK, pxCurrentTCB) & CurrentFilterMask) \
{ \
if (pxCurrentTCB->ucNotifyState == taskNOTIFICATION_RECEIVED) \
if (pxCurrentTCB->ucNotifyState[ ( index ) ] == taskNOTIFICATION_RECEIVED) \
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \
else \
prvTraceStoreKernelCallWithParam(TRACE_TASK_NOTIFY_WAIT_TRCFAILED, TRACE_CLASS_TASK, TRACE_GET_TASK_NUMBER(pxCurrentTCB), xTicksToWait); \

File diff suppressed because it is too large Load Diff

@ -0,0 +1,38 @@
/*
* FreeRTOS Kernel V10.3.0
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
#ifndef TASK_NOTIFY_ARRAY_H
#define TASK_NOTIFY_ARRAY_H
void vStartTaskNotifyArrayTask( void );
BaseType_t xAreTaskNotificationArrayTasksStillRunning( void );
void xNotifyArrayTaskFromISR( void );
#endif /* TASK_NOTIFY_ARRAY_H */

@ -62,6 +62,7 @@
#define configUSE_ALTERNATIVE_API 0
#define configUSE_QUEUE_SETS 1
#define configUSE_TASK_NOTIFICATIONS 1
#define configTASK_NOTIFICATION_ARRAY_ENTRIES 5
#define configSUPPORT_STATIC_ALLOCATION 1
#define configINITIAL_TICK_COUNT ( ( TickType_t ) 0 ) /* For test. */
#define configSTREAM_BUFFER_TRIGGER_LEVEL_TEST_MARGIN 1 /* As there are a lot of tasks running. */

@ -105,6 +105,7 @@
<ClCompile Include="..\Common\Minimal\StreamBufferDemo.c" />
<ClCompile Include="..\Common\Minimal\StreamBufferInterrupt.c" />
<ClCompile Include="..\Common\Minimal\TaskNotify.c" />
<ClCompile Include="..\Common\Minimal\TaskNotifyArray.c" />
<ClCompile Include="..\Common\Minimal\timerdemo.c" />
<ClCompile Include="main.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

@ -160,6 +160,9 @@
<ClCompile Include="..\Common\Minimal\MessageBufferAMP.c">
<Filter>Demo App Source\Full_Demo\Common Demo Tasks</Filter>
</ClCompile>
<ClCompile Include="..\Common\Minimal\TaskNotifyArray.c">
<Filter>Demo App Source\Full_Demo\Common Demo Tasks</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="FreeRTOSConfig.h">

@ -44,7 +44,6 @@
* port for further information:
* http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html
*
*
*******************************************************************************
*/

@ -97,6 +97,7 @@
#include "EventGroupsDemo.h"
#include "IntSemTest.h"
#include "TaskNotify.h"
#include "TaskNotifyArray.h"
#include "QueueSetPolling.h"
#include "StaticAllocation.h"
#include "blocktim.h"
@ -183,6 +184,7 @@ int main_full( void )
/* Create the standard demo tasks. */
vStartTaskNotifyTask();
vStartTaskNotifyArrayTask();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
@ -286,6 +288,10 @@ HeapStats_t xHeapStats;
{
pcStatusMessage = "Error: Notification";
}
else if( xAreTaskNotificationArrayTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: NotificationArray";
}
else if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntSem";
@ -496,6 +502,7 @@ TaskHandle_t xTimerTask;
/* Exercise using task notifications from an interrupt. */
xNotifyTaskFromISR();
xNotifyArrayTaskFromISR();
/* Writes to stream buffer byte by byte to test the stream buffer trigger
level functionality. */

@ -370,7 +370,6 @@ const HeapRegion_t xHeapRegions[] =
/* The heap has not been initialised yet so expect stats to all be zero. */
vPortGetHeapStats( &xHeapStats );
configASSERT( memcmp( &xHeapStats, &xZeroHeapStats, sizeof( HeapStats_t ) ) == 0 );
vPortDefineHeapRegions( xHeapRegions );

Loading…
Cancel
Save