X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FPIC32MZ_MPLAB%2Fmain_full.c;h=9acb3a28bed693efad990ca0df6e3a49726a71cf;hb=19b29b9ac426c6f5c64009809b1cde1777abb285;hp=6daed0fb181e04e67654789cc4122a4d16d52c11;hpb=61e4c8bcd10d8a2d87dfda1962932c88f0c7a92f;p=freertos diff --git a/FreeRTOS/Demo/PIC32MZ_MPLAB/main_full.c b/FreeRTOS/Demo/PIC32MZ_MPLAB/main_full.c index 6daed0fb1..9acb3a28b 100644 --- a/FreeRTOS/Demo/PIC32MZ_MPLAB/main_full.c +++ b/FreeRTOS/Demo/PIC32MZ_MPLAB/main_full.c @@ -1,5 +1,5 @@ /* - FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd. + FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. @@ -138,18 +138,19 @@ #include "QueueOverwrite.h" #include "QueueSet.h" #include "recmutex.h" +#include "EventGroupsDemo.h" /*-----------------------------------------------------------*/ /* The period after which the check timer will expire, in ms, provided no errors have been reported by any of the standard demo tasks. ms are converted to the -equivalent in ticks using the portTICK_RATE_MS constant. */ -#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS ) +equivalent in ticks using the portTICK_PERIOD_MS constant. */ +#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_PERIOD_MS ) /* The period at which the check timer will expire, in ms, if an error has been reported in one of the standard demo tasks. ms are converted to the equivalent -in ticks using the portTICK_RATE_MS constant. */ -#define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_RATE_MS ) +in ticks using the portTICK_PERIOD_MS constant. */ +#define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_PERIOD_MS ) /* The priorities of the various demo application tasks. */ #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) @@ -180,7 +181,7 @@ occur. */ /* * The check timer callback function, as described at the top of this file. */ -static void prvCheckTimerCallback( xTimerHandle xTimer ); +static void prvCheckTimerCallback( TimerHandle_t xTimer ); /* * It is important to ensure the high frequency timer test does not start before @@ -189,7 +190,7 @@ static void prvCheckTimerCallback( xTimerHandle xTimer ); * executing. A one-shot timer is used, so the callback function will only * execute once (unless it is manually reset/restarted). */ -static void prvSetupHighFrequencyTimerTest( xTimerHandle xTimer ); +static void prvSetupHighFrequencyTimerTest( TimerHandle_t xTimer ); /* * Tasks that test the context switch mechanism by filling the processor @@ -221,7 +222,7 @@ volatile unsigned long ulRegTest1Cycles = 0, ulRegTest2Cycles = 0; */ int main_full( void ) { -xTimerHandle xTimer = NULL; +TimerHandle_t xTimer = NULL; /* Create all the other standard demo tasks. */ vStartLEDFlashTimers( mainNUM_FLASH_TIMER_LEDS ); @@ -236,6 +237,7 @@ xTimerHandle xTimer = NULL; vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_TASK_PRIORITY ); vStartQueueSetTasks(); vStartRecursiveMutexTasks(); + vStartEventGroupTasks(); /* Create the tasks defined within this file. */ xTaskCreate( prvRegTestTask1, /* The function that implements the task. */ @@ -313,7 +315,7 @@ extern void vRegTest2( volatile unsigned long * ); } /*-----------------------------------------------------------*/ -static void prvCheckTimerCallback( xTimerHandle xTimer ) +static void prvCheckTimerCallback( TimerHandle_t xTimer ) { static long lChangedTimerPeriodAlready = pdFALSE; static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0, ulLastHighFrequencyTimerInterrupts = 0; @@ -383,13 +385,17 @@ extern unsigned long ulHighFrequencyTimerInterrupts; { ulErrorOccurred |= ( 0x01UL << 12UL ); } + else if( xAreEventGroupTasksStillRunning() != pdTRUE ) + { + ulErrorOccurred |= ( 0x01UL << 13UL ); + } /* Ensure the expected number of high frequency interrupts have occurred. */ if( ulLastHighFrequencyTimerInterrupts != 0 ) { if( ( ulHighFrequencyTimerInterrupts - ulLastHighFrequencyTimerInterrupts ) < ulExpectedHighFrequencyInterrupts ) { - ulErrorOccurred |= ( 0x01UL << 13UL ); + ulErrorOccurred |= ( 0x01UL << 14UL ); } } ulLastHighFrequencyTimerInterrupts = ulHighFrequencyTimerInterrupts; @@ -415,7 +421,7 @@ extern unsigned long ulHighFrequencyTimerInterrupts; } /*-----------------------------------------------------------*/ -static void prvSetupHighFrequencyTimerTest( xTimerHandle xTimer ) +static void prvSetupHighFrequencyTimerTest( TimerHandle_t xTimer ) { void vSetupTimerTest( unsigned short usFrequencyHz );