From 3aeec295bc58fd631954bbe91a2a5146ee125b8c Mon Sep 17 00:00:00 2001 From: rtel Date: Sun, 16 Feb 2014 22:03:39 +0000 Subject: [PATCH] Add event groups demo to SAM4E demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2206 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../RTOSDemo.atsuo | Bin 102400 -> 99328 bytes .../RTOSDemo.cproj | 8 ++++++++ .../src/config/FreeRTOSConfig.h | 2 ++ .../src/main_full.c | 14 ++++++++++++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.atsuo b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/RTOSDemo.atsuo index 864edf72d853a115a559f324f30b9004bc0ab91d..85c113a8bbf7c93dd6054823eee3eb9bf851cd97 100644 GIT binary patch delta 4214 zcma)92~?9;7XEJtAuM88#05nN3aAhwDpHFY1eJ~~0dXbDmZ&I88Uj*54NDbmMc@{m z;s&_ZS{HuDw8sssqt;qPYh6aG*lIiNX>HwlT00|i|3J{w_H^by=gWKdEr0I2_q+Gq z-_#&6RY(rH+t_P4j+;t|#z8io_7kb6CL~~ljoYwP>OJr5?3_*Q9Ku{eGC@O_N0?7Y zA;jZyo4&9BYi+LC{dDtrbNYyje4e-jBvWWIDgvL`4u|RdP>Gk=9tP1+ZvvC$LjbB| zVk~rs5%&{Dobn+MpE#(cCX&R~HN4SLEtYza=+raxq<6bWY9!IoIs}dUQ`ePJNj-4f zcOrh7=Q6Qm7EP{7#%F`$#DlHt(CFPRwI#{r#fZ-@E~l5b9q9zSv(U*rD~ek2~rKk+a1by=@{YxI>#(E0P;Z@jb4dM*s8 zPH^Mvr&WW?gt==U_kHcH;fXPeeHWed`?d)amb#-lc7@B5gokA-R_$y}Q5{%4?rld; zCt=T{*tvGzv*-jf2!i3aQ#+e5hcK70l7Lw=s%%WavBotpo)4cnVW3M~L8nW-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K(6l{-#1DlmgSuf-Z$krXzq1p3s*FcPNdSn7Sy2Xug!jJ`u*NmAnrDyADv7p?3wprPM@J$3%{ zb~3hq7WA;)*|1rN$qQL~0R*7xX4zvG=x9O{z8-ktW(Xz^c%a9?N>ts^p{3LvjTK_{ zAO?cp4FHkJKNzk6Q-*~ z9v)Lk?@$Xc=Tj$ykkBT~e8!|34=Pbj1eD0fL_2!&-4XZ3RIj|RC~{v}mF$L^rCv@Q zA%X2#1jo>=p%%@((G;t*9fewQD5p^Z@+af9&J1!|L3}5|HJTeJ_>O^Hnh&AigB|z( z!76jXpQ#r^ILxyrFJZ3AkzST!y^siGiLtD52}n%+YDf}+%sx-W_T<4b>|2>hdzP^e zovlemUZa7TVhPQ*7RF4g0c*_(H`r|rq>2lE9!ZCCwkivJDJ0LaM%>sp-SHwDjV+f` z_1FFI#Wz1>yK^W9?CvVE)&iJZE@kf&fESfGM_5!Lq~YP(Lc!p3*~St$CCSrfrsw8h zRq04_B){KGxql$nLX+RYmtZD{we~%mv}@oThy`=Bp3bCQ3*~@%b23J*m*RDUgq7!k zhw0V^kOAusrTXh|mW;-P6zxW{N-*kv+(9i&7ddeoiT1H;k~}SH#@e8 zYAU5vX+@-1{M(G0e9*CyrBI3gvnHTdk7Dr=prRcJe|zE|h1CVDH3e!zwA>2HK)GBd zx0Xw%ua`>6N2n~;+D5wBm@qhN zBTfrqRKt1M=)+bza)FDD7FOPmYrnLs6;>AL0NePLA^O2YVJU2B;&JVRnYOX7Y_ieT zZ4`^)ebjwTvFMPHeuXA1-t@compile src\FreeRTOS+\FreeRTOS+FAT SL\PSP\Target\RTC\psp_rtc.c + + compile + src\FreeRTOS\event_groups.c + compile src\Common Demo Tasks\blocktim.c @@ -569,6 +573,10 @@ compile src\Common Demo Tasks\dynamic.c + + compile + src\Common Demo Tasks\EventGroupsDemo.c + compile src\Common Demo Tasks\flash_timer.c diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSConfig.h index 335cfb070..758c37cb1 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/config/FreeRTOSConfig.h @@ -143,6 +143,8 @@ to exclude the API function. */ #define INCLUDE_vTaskSuspend 1 #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 1 /* Cortex-M specific definitions. */ #ifdef __NVIC_PRIO_BITS diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c index cf39d8fef..1f4840c00 100644 --- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c +++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c @@ -135,6 +135,7 @@ #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 @@ -178,10 +179,11 @@ http://www.FreeRTOS.org/udp */ #define mainCONNECTED_IP_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) #define mainDISCONNECTED_IP_TASK_PRIORITY ( tskIDLE_PRIORITY ) -/* UDP command server task parameters. */ +/* UDP command server and echo task parameters. */ #define mainUDP_CLI_TASK_PRIORITY ( tskIDLE_PRIORITY ) #define mainUDP_CLI_PORT_NUMBER ( 5001UL ) #define mainUDP_CLI_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2U ) +#define mainECHO_CLIENT_STACK_SIZE ( configMINIMAL_STACK_SIZE + 30 ) /* Set to 1 to include the UDP echo client tasks in the build. The echo clients require the IP address of the echo server to be defined using the @@ -293,6 +295,7 @@ TimerHandle_t xTimer = NULL; vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_TASK_PRIORITY ); vStartQueueSetTasks(); vStartRecursiveMutexTasks(); + vStartEventGroupTasks(); /* Create the software timer that performs the 'check' functionality, as described at the top of this file. */ @@ -365,6 +368,10 @@ unsigned long ulErrorOccurred = pdFALSE; { ulErrorOccurred |= ( 0x01UL << 12UL ); } + else if( xAreEventGroupTasksStillRunning() != pdTRUE ) + { + ulErrorOccurred |= ( 0x01UL << 13UL ); + } if( ulErrorOccurred != pdFALSE ) { @@ -422,7 +429,7 @@ char cIPAddress[ 20 ]; address of the echo server to be defined using the configECHO_SERVER_ADDR0 to configECHO_SERVER_ADDR3 constants in FreeRTOSConfig.h. */ - vStartEchoClientTasks( configMINIMAL_STACK_SIZE, tskIDLE_PRIORITY ); + vStartEchoClientTasks( mainECHO_CLIENT_STACK_SIZE, tskIDLE_PRIORITY ); } #endif } @@ -487,6 +494,9 @@ void vFullDemoTickHook( void ) /* Call the periodic queue set ISR test function. */ vQueueSetAccessQueueSetFromISR(); + + /* Call the event group ISR tests. */ + vPeriodicEventGroupsProcessing(); } /*-----------------------------------------------------------*/ -- 2.39.5