]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio/Source/FreeRTOSConfig.h
Update EFM32 demos to include an option to use the RTC as the clock source when using...
[freertos] / FreeRTOS / Demo / CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio / Source / FreeRTOSConfig.h
index 8c9f5192b0bc55384178dd024eef6dc1ceb7039d..e0f66cd52dd03180cc59905efa2a69ff776088ce 100644 (file)
@@ -87,16 +87,50 @@ extern "C" {
  *----------------------------------------------------------*/\r
 \r
 \r
-/* Set configCREATE_LOW_POWER_DEMO to one to run the simple blinky demo low power\r
-example, or 1 to run the more comprehensive test and demo application.  See\r
-the comments at the top of main.c for more information. */\r
-#define configCREATE_LOW_POWER_DEMO    1\r
+/* Set configCREATE_LOW_POWER_DEMO as follows:\r
+ *\r
+ * 0: Build the full test and demo application.\r
+ * 1: Build the simple blinky tickless low power demo, generating the tick\r
+ *    interrupt from the BURTC.  EM3 will be entered, but use of the ULFRCO\r
+ *    clock means timing will be inaccurate.\r
+ * 2: Build the simple blinky tickless low power demo, generating the tick from\r
+ *    the RTC.  EM2 will be entered.  The LXFO clock is used, which is more\r
+ *    accurate than the ULFRCO clock.\r
+ *  See the comments at the top of main.c, main_full.c and main_low_power.c for\r
+ *  more information.\r
+ */\r
+#define configCREATE_LOW_POWER_DEMO    2\r
 \r
 /* Some configuration is dependent on the demo being built. */\r
-#if( configCREATE_LOW_POWER_DEMO == 1 )\r
+#if( configCREATE_LOW_POWER_DEMO == 0 )\r
+\r
+       /* Tickless mode is not used. */\r
+\r
+       /* Some of the standard demo test tasks assume a tick rate of 1KHz, even\r
+       though that is faster than would normally be warranted by a real\r
+       application. */\r
+       #define configTICK_RATE_HZ                              ( 1000 )\r
+\r
+       /* The full demo always has tasks to run so the tick will never be turned\r
+       off.  The blinky demo will use the default tickless idle implementation to\r
+       turn the tick off. */\r
+       #define configUSE_TICKLESS_IDLE                 0\r
+\r
+       /* Hook function related definitions. */\r
+       #define configUSE_TICK_HOOK                             ( 1 )\r
+       #define configCHECK_FOR_STACK_OVERFLOW  ( 1 )\r
+       #define configUSE_MALLOC_FAILED_HOOK    ( 1 )\r
+       #define configUSE_IDLE_HOOK                     ( 1 )\r
+\r
+       #define configENERGY_MODE                               ( sleepEM3 )\r
+\r
+#elif( configCREATE_LOW_POWER_DEMO == 1 )\r
+\r
+       /* Tickless idle mode, generating RTOS tick interrupts from the BURTC, fed\r
+       by the [inaccurate] ULFRCO clock. */\r
 \r
        /* The slow clock used to generate the tick interrupt in the low power demo\r
-       runs at 32768Hz.  Ensure the clock is a multiple of the tick rate. */\r
+       runs at 2KHz.  Ensure the tick rate is a multiple of the clock. */\r
        #define configTICK_RATE_HZ                              ( 100 )\r
 \r
        /* The low power demo uses the tickless idle feature. */\r
@@ -108,23 +142,27 @@ the comments at the top of main.c for more information. */
        #define configUSE_MALLOC_FAILED_HOOK    ( 0 )\r
        #define configUSE_IDLE_HOOK                             ( 0 )\r
 \r
-#else\r
+       #define configENERGY_MODE                               ( sleepEM4 )\r
 \r
-       /* Some of the standard demo test tasks assume a tick rate of 1KHz, even\r
-       though that is faster than would normally be warranted by a real\r
-       application. */\r
-       #define configTICK_RATE_HZ                              ( 1000 )\r
+#elif( configCREATE_LOW_POWER_DEMO == 2 )\r
 \r
-       /* The full demo always has tasks to run so the tick will never be turned\r
-       off.  The blinky demo will use the default tickless idle implementation to\r
-       turn the tick off. */\r
-       #define configUSE_TICKLESS_IDLE                 0\r
+       /* Tickless idle mode, generating RTOS tick interrupts from the RTC, fed\r
+       by the LXFO clock. */\r
+\r
+       /* The slow clock used to generate the tick interrupt in the low power demo\r
+       runs at 32768/8=4096Hz.  Ensure the tick rate is a multiple of the clock. */\r
+       #define configTICK_RATE_HZ                              ( 128 )\r
+\r
+       /* The low power demo uses the tickless idle feature. */\r
+       #define configUSE_TICKLESS_IDLE                 1\r
 \r
        /* Hook function related definitions. */\r
-       #define configUSE_TICK_HOOK                             ( 1 )\r
-       #define configCHECK_FOR_STACK_OVERFLOW  ( 1 )\r
-       #define configUSE_MALLOC_FAILED_HOOK    ( 1 )\r
-       #define configUSE_IDLE_HOOK  ( 1 )\r
+       #define configUSE_TICK_HOOK                             ( 0 )\r
+       #define configCHECK_FOR_STACK_OVERFLOW  ( 0 )\r
+       #define configUSE_MALLOC_FAILED_HOOK    ( 0 )\r
+       #define configUSE_IDLE_HOOK                             ( 0 )\r
+\r
+       #define configENERGY_MODE                               ( sleepEM3 )\r
 \r
 #endif\r
 \r