]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil_GCC/main.c
Increase the test coverage of the GCC MPU demo that runs in the Keil simulator.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_CEC1302_Keil_GCC / main.c
index 4c843fa189df0cf42c98702c7e89b54a1ab0ba5a..d89c69eae1a756de41e60aa04dcaeda83e8438cf 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.0rc2 - Copyright (C) 2015 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -68,6 +68,8 @@
 */\r
 \r
 /******************************************************************************\r
+ * See http://www.freertos.org/Microchip_CEC1302_ARM_Cortex-M4F_Low_Power_Demo.html\r
+ *\r
  * This project provides two demo applications.  A simple blinky style project\r
  * that demonstrates low power tickless functionality, and a more comprehensive\r
  * test and demo application.  The configCREATE_LOW_POWER_DEMO setting, which is\r
@@ -76,6 +78,9 @@
  * more comprehensive test and demo application is implemented and described in\r
  * main_full.c.\r
  *\r
+ * The simple blinky demo uses aggregated interrupts.  The full demo uses\r
+ * disaggregated interrupts.\r
+ *\r
  * This file implements the code that is not demo specific, including the\r
  * hardware setup and standard FreeRTOS hook functions.\r
  *\r
@@ -140,6 +145,8 @@ volatile uint32_t ulLED = 0;
 \r
 int main( void )\r
 {\r
+       /* See http://www.freertos.org/Microchip_CEC1302_ARM_Cortex-M4F_Low_Power_Demo.html */\r
+\r
        /* Configure the hardware ready to run the demo. */\r
        prvSetupHardware();\r
 \r
@@ -147,10 +154,18 @@ int main( void )
        of this file. */\r
        #if( configCREATE_LOW_POWER_DEMO == 1 )\r
        {\r
+               /* The low power demo also demonstrated aggregated interrupts, so clear\r
+               the interrupt control register to disable the alternative NVIC vectors. */\r
+               mainEC_INTERRUPT_CONTROL = pdFALSE;\r
+\r
                main_low_power();\r
        }\r
        #else\r
        {\r
+               /* The full demo also demonstrated disaggregated interrupts, so set the\r
+               interrupt control register to enable the alternative NVIC vectors. */\r
+               mainEC_INTERRUPT_CONTROL = pdTRUE;\r
+\r
                main_full();\r
        }\r
        #endif\r
@@ -165,12 +180,9 @@ static void prvSetupHardware( void )
 extern void system_set_ec_clock( void );\r
 extern unsigned long __Vectors[];\r
 \r
-       /* Disable M4 write buffer: fix MEC1322 hardware bug. */\r
+       /* Disable M4 write buffer: fix CEC1302 hardware bug. */\r
        mainNVIC_AUX_ACTLR |= 0x07;\r
 \r
-       /* Enable alternative NVIC vectors. */\r
-       mainEC_INTERRUPT_CONTROL = pdTRUE;\r
-\r
        system_set_ec_clock();\r
 \r
        /* Assuming downloading code via the debugger - so ensure the hardware\r