]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/include/FreeRTOSConfig.h
Tidy up STM32L low power demo and add 'comprehensive demo' option.
[freertos] / FreeRTOS / Demo / CORTEX_STM32L152_Discovery_IAR / include / FreeRTOSConfig.h
index 25a4a76efea027c3f9c17e145acca009d0f34337..46d059c915937c7f1f049f9a0439356a10fc6380 100644 (file)
@@ -78,7 +78,8 @@
  * See http://www.freertos.org/a00110.html.\r
  *----------------------------------------------------------*/\r
 \r
-/* Ensure stdint is only used by the compiler, and not the assembler. */\r
+/* Ensure stdint and C code is only used by the compiler, and not the\r
+assembler. */\r
 #ifdef __ICCARM__\r
        #include <stdint.h>\r
        extern uint32_t SystemCoreClock;\r
 \r
 /* Set configCREATE_LOW_POWER_DEMO to one to run the simple blinky low power\r
 demo, or 0 to run the more comprehensive test and demo application. */\r
-#define configCREATE_LOW_POWER_DEMO                    1\r
+#define configCREATE_LOW_POWER_DEMO                    0\r
 \r
+/* A few settings are dependent on the configCREATE_LOW_POWER_DEMO setting. */\r
 #if configCREATE_LOW_POWER_DEMO == 1\r
-       #define configCPU_CLOCK_HZ                                              SystemCoreClock\r
-       #define configUSE_TICKLESS_IDLE                                 1\r
        #define configTICK_RATE_HZ                                              ( 100 )\r
        #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP   ( 20 + 1 ) /* ( ( 200 / portTICK_RATE_MS ) + 1 ) written out pre-processed to enable #error statements to check its value. */\r
+       #define configUSE_TIMERS                                                0\r
 #else\r
-       #define configCPU_CLOCK_HZ                                              SystemCoreClock\r
-       #define configSYSTICK_CLOCK_HZ                                  ( SystemCoreClock >> 3UL )\r
-       #define configUSE_TICKLESS_IDLE                                 0\r
+       #define configSYSTICK_CLOCK_HZ                                  ( SystemCoreClock >> 3UL ) /* Systick clock is one eighth the system clock. */\r
        #define configTICK_RATE_HZ                                              ( ( portTickType ) 1000 )\r
+       #define configUSE_TIMERS                                                1\r
 #endif /* configCREATE_LOW_POWER_DEMO */\r
 \r
+/* Demo specific macros that allow the application writer to insert code to be\r
+executed immediately before the MCU's STOP low power mode is entered and exited\r
+respectively.  These macros are in addition to the standard\r
+configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros, which are\r
+called pre and post the low power SLEEP mode being entered and exited.  These\r
+macros can be used to turn turn off and on IO, clocks, the Flash etc. to obtain\r
+the lowest power possible while the tick is off.  See the comments at the top of\r
+main_low_power.c and in STM32L_low_power_tick_management.c. */\r
 #define configPRE_STOP_PROCESSING()\r
 #define configPOST_STOP_PROCESSING()                           vMainPostStopProcessing()\r
 \r
+/* The configUSE_TICKLESS_IDLE setting is dependent on the users setting of\r
+configCREATE_LOW_POWER_DEMO at the top of this file. */\r
+#define configUSE_TICKLESS_IDLE                                        configCREATE_LOW_POWER_DEMO\r
+\r
+#define configCPU_CLOCK_HZ                                             SystemCoreClock\r
 #define configUSE_PREEMPTION                                   1\r
 #define configUSE_PORT_OPTIMISED_TASK_SELECTION        1\r
 #define configUSE_IDLE_HOOK                                            1\r
 #define configUSE_TICK_HOOK                                            1\r
 #define configMAX_PRIORITIES                                   ( 5 )\r
 #define configMINIMAL_STACK_SIZE                               ( ( unsigned short ) 70 )\r
-#define configTOTAL_HEAP_SIZE                                  ( ( size_t ) ( 10 * 1024 ) )\r
+#define configTOTAL_HEAP_SIZE                                  ( ( size_t ) ( 14 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                                        ( 16 )\r
 #define configUSE_TRACE_FACILITY                               1\r
 #define configUSE_16_BIT_TICKS                                 0\r
@@ -119,9 +132,15 @@ demo, or 0 to run the more comprehensive test and demo application. */
 #define configUSE_MUTEXES                                              1\r
 #define configQUEUE_REGISTRY_SIZE                              5\r
 #define configCHECK_FOR_STACK_OVERFLOW                 2\r
-#define configUSE_RECURSIVE_MUTEXES                            0\r
+#define configUSE_RECURSIVE_MUTEXES                            1\r
 #define configUSE_MALLOC_FAILED_HOOK                   1\r
 #define configUSE_APPLICATION_TASK_TAG                 0\r
+#define configUSE_COUNTING_SEMAPHORES                  1\r
+\r
+/* Software timer related definitions. */\r
+#define configTIMER_TASK_PRIORITY                              ( configMAX_PRIORITIES - 1 )\r
+#define configTIMER_QUEUE_LENGTH                               10\r
+#define configTIMER_TASK_STACK_DEPTH                   configMINIMAL_STACK_SIZE\r
 \r
 /* Co-routine definitions. */\r
 #define configUSE_CO_ROUTINES                  0\r