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