\r
#define configUSE_PREEMPTION 1\r
#define configUSE_IDLE_HOOK 1\r
-#define configUSE_TICK_HOOK 0\r
-#define configTICK_RATE_HZ ( 50 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
+#define configUSE_TICK_HOOK 1\r
+#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */\r
#define configTOTAL_HEAP_SIZE ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */\r
#define configMAX_TASK_NAME_LEN ( 12 )\r
#define configUSE_TRACE_FACILITY 1\r
-#define configUSE_16_BIT_TICKS 0\r
+#define configUSE_16_BIT_TICKS 1\r
#define configIDLE_SHOULD_YIELD 1\r
#define configUSE_CO_ROUTINES 0\r
#define configUSE_MUTEXES 1\r
#define configQUEUE_REGISTRY_SIZE 0\r
#define configUSE_MALLOC_FAILED_HOOK 1\r
#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_COUNTING_SEMAPHORES 1\r
+#define configUSE_ALTERNATIVE_API 1\r
\r
#define configUSE_TIMERS 1\r
#define configTIMER_TASK_PRIORITY 2\r
-#define configTIMER_QUEUE_LENGTH 3\r
+#define configTIMER_QUEUE_LENGTH 20\r
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )\r
\r
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 )\r
#define INCLUDE_uxTaskGetStackHighWaterMark 1\r
#define INCLUDE_xTaskGetSchedulerState 1\r
\r
+extern void vAssertCalled( void );\r
+#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()\r
+\r
#endif /* FREERTOS_CONFIG_H */\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<ClCompile Include="..\..\Source\portable\MemMang\heap_3.c" />\r
+ <ClCompile Include="..\..\Source\timers.c" />\r
<ClCompile Include="..\Common\Minimal\BlockQ.c" />\r
<ClCompile Include="..\Common\Minimal\blocktim.c" />\r
+ <ClCompile Include="..\Common\Minimal\countsem.c" />\r
<ClCompile Include="..\Common\Minimal\flop.c" />\r
<ClCompile Include="..\Common\Minimal\GenQTest.c" />\r
<ClCompile Include="..\Common\Minimal\integer.c" />\r
<ClCompile Include="..\Common\Minimal\PollQ.c" />\r
<ClCompile Include="..\Common\Minimal\QPeek.c" />\r
<ClCompile Include="..\Common\Minimal\semtest.c" />\r
+ <ClCompile Include="..\Common\Minimal\timerdemo.c" />\r
<ClCompile Include="DemosModifiedForLowTickRate\recmutex.c" />\r
<ClCompile Include="main.c">\r
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
</ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
+ <ClInclude Include="..\..\Source\include\timers.h" />\r
+ <ClInclude Include="..\..\Source\include\timer_test.h" />\r
<ClInclude Include="..\..\Source\portable\MSVC-MingW\portmacro.h" />\r
<ClInclude Include="FreeRTOSConfig.h" />\r
<ClInclude Include="..\..\Source\include\croutine.h" />\r
<ClCompile Include="DemosModifiedForLowTickRate\recmutex.c">\r
<Filter>Demo App Source\Common Demo Tasks\ModifiedForLowTickRate</Filter>\r
</ClCompile>\r
+ <ClCompile Include="..\..\Source\timers.c">\r
+ <Filter>FreeRTOS Source\Source</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\Common\Minimal\timerdemo.c">\r
+ <Filter>Demo App Source\Common Demo Tasks</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\Common\Minimal\countsem.c">\r
+ <Filter>Demo App Source\Common Demo Tasks</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="FreeRTOSConfig.h">\r
<ClInclude Include="..\..\Source\portable\MSVC-MingW\portmacro.h">\r
<Filter>FreeRTOS Source\Include</Filter>\r
</ClInclude>\r
+ <ClInclude Include="..\..\Source\include\timers.h">\r
+ <Filter>FreeRTOS Source\Include</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\Source\include\timer_test.h">\r
+ <Filter>FreeRTOS Source\Include</Filter>\r
+ </ClInclude>\r
</ItemGroup>\r
</Project>
\ No newline at end of file
#include "recmutex.h"\r
#include "flop.h"\r
#include "TimerDemo.h"\r
+#include "countsem.h"\r
\r
/* Priorities at which the tasks are created. */\r
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )\r
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
\r
-#define mainTIMER_FREQUENCY ( configTICK_RATE_HZ )\r
+#define mainTIMER_TEST_PERIOD ( 50 )\r
\r
/* Task function prototypes. */\r
static void prvCheckTask( void *pvParameters );\r
vStartQueuePeekTasks();\r
vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
vStartRecursiveMutexTasks();\r
- vStartTimerDemoTask( mainTIMER_FREQUENCY );\r
+ vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
+ vStartCountingSemaphoreTasks();\r
\r
/* Start the scheduler itself. */\r
vTaskStartScheduler();\r
static void prvCheckTask( void *pvParameters )\r
{\r
portTickType xNextWakeTime;\r
-const portTickType xCycleFrequency = 5000 / portTICK_RATE_MS;\r
+const portTickType xCycleFrequency = 1000 / portTICK_RATE_MS;\r
char *pcStatusMessage = "OK";\r
\r
/* Just to remove compiler warning. */\r
vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );\r
\r
/* Check the standard demo tasks are running without error. */\r
- if( xAreTimerDemoTasksStillRunning() != pdTRUE )\r
+ if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )\r
{\r
pcStatusMessage = "Error: TimerDemo";\r
}\r
{\r
pcStatusMessage = "Error: RecMutex";\r
}\r
+ else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )\r
+ {\r
+ pcStatusMessage = "Error: CountSem";\r
+ }\r
\r
/* This is the only task that uses stdout so its ok to call printf() \r
directly. */\r
/* Can be implemented if required, but not required in this \r
environment and running this demo. */\r
}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationTickHook( void )\r
+{\r
+ /* Call the periodic timer test, which tests the timer API functions that\r
+ can be called from an ISR. */\r
+ vTimerPeriodicISRTests();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vAssertCalled( void )\r
+{\r
+ taskDISABLE_INTERRUPTS();\r
+ for( ;; );\r
+}\r
\r