From de502afcb2f5d433f6bac435d251566e853ac96e Mon Sep 17 00:00:00 2001 From: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Date: Thu, 24 Sep 2020 10:24:33 -0700 Subject: [PATCH] Fix rendezvous test failure in EventGroupsDemo (#294) The rendezvous test in EventGroupsDemo assumed that one tick is not enough for rendezvous to complete. Turns out that it is not true on a system with 1ms tick and rendezvous does get complete within one tick. This commit removes the test with one tick assumption. Signed-off-by: Gaurav Aggarwal --- FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c b/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c index 50804145b..a607f619f 100644 --- a/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c +++ b/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c @@ -78,7 +78,6 @@ that synchronise with the xEventGroupSync() function. */ /* A block time of zero simply means "don't block". */ #define ebDONT_BLOCK ( 0 ) -#define ebONE_TICK ( ( TickType_t ) 1 ) /* A 5ms delay. */ #define ebSHORT_DELAY pdMS_TO_TICKS( ( TickType_t ) 5 ) @@ -290,10 +289,9 @@ EventBits_t uxSynchronisationBit, uxReturned; /* Set the bit that indicates this task is at the synchronisation point. The first time this is done the 'test master' task has a lower priority than this task so this task will get to the sync point before - the set bits task - test this by first calling xEventGroupSync() with - a zero block time, and a block time that is too short for the other - task, before calling again with a max delay - the first two calls should - return before the rendezvous completes, the third only after the + the set bits task - test this by calling xEventGroupSync() with a zero + block time before calling again with a max delay - the first call should + return before the rendezvous completes, the second only after the rendezvous is complete. */ uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */ uxSynchronisationBit, /* The bit to set in the event group to indicate this task is at the sync point. */ @@ -304,15 +302,6 @@ EventBits_t uxSynchronisationBit, uxReturned; rendezvous is not expected to have completed yet. */ configASSERT( ( uxReturned & ebALL_SYNC_BITS ) != ebALL_SYNC_BITS ); - uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */ - uxSynchronisationBit, /* The bit to set in the event group to indicate this task is at the sync point. */ - ebALL_SYNC_BITS, /* The bits to wait for - these bits are set by the other tasks taking part in the sync. */ - ebONE_TICK ); /* The maximum time to wait for the sync condition to be met before giving up. */ - - /* A short block time was specified, so as per the comments above, the - rendezvous is not expected to have completed yet. */ - configASSERT( ( uxReturned & ebALL_SYNC_BITS ) != ebALL_SYNC_BITS ); - uxReturned = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */ uxSynchronisationBit, /* The bit to set in the event group to indicate this task is at the sync point. */ ebALL_SYNC_BITS,/* The bits to wait for - these bits are set by the other tasks taking part in the sync. */