From a39234c0fd11d788aaab4b19de6bf01bf94f69fb Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 14 Nov 2018 11:44:03 +0800 Subject: [PATCH] Update Key interrupt priority and can work now, comment configUSE_TICK_HOOK in FreeRTOSConfig.h --- src/STM32L_FreeRTOS/board/stm32_vport.c | 69 ++++++++++++++++++---------------- 1 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/STM32L_FreeRTOS/board/stm32_vport.c b/src/STM32L_FreeRTOS/board/stm32_vport.c index 3771570..8671ccc 100644 --- a/src/STM32L_FreeRTOS/board/stm32_vport.c +++ b/src/STM32L_FreeRTOS/board/stm32_vport.c @@ -17,10 +17,45 @@ void prvSetupHardware( void ) { init_led_gpio(); - //init_keys_interrupt(); + init_keys_interrupt(); stm32_init_printf(USART_PORT1, 115200); } + +/* FreeRTOSConfig.h�ж����˺� configUSE_MALLOC_FAILED_HOOK ����Ҫ�ú���ʵ�� */ +void vApplicationMallocFailedHook( void ) +{ + /* Called if a call to pvPortMalloc() fails because there is insufficient + free memory available in the FreeRTOS heap. pvPortMalloc() is called + internally by FreeRTOS API functions that create tasks, queues or + semaphores. */ + for( ;; ); +} + + +/* FreeRTOSConfig.h�ж����˺� configUSE_IDLE_HOOK ����Ҫ�ú���ʵ�� */ +void vApplicationIdleHook( void ) +{ + /* Called on each iteration of the idle task. In this case the idle task + just enters a low(ish) power mode. */ + PWR_EnterSleepMode( PWR_Regulator_ON, PWR_SLEEPEntry_WFI ); +} + +/* FreeRTOSConfig.h�ж����˺� configCHECK_FOR_STACK_OVERFLOW ����Ҫ�ú���ʵ�� */ +void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) +{ + ( void ) pcTaskName; + ( void ) pxTask; + + /* Run time stack overflow checking is performed if + configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook + function is called if a stack overflow is detected. */ + for( ;; ); +} + + +/* FreeRTOSConfig.h�ж����˺� configUSE_TICK_HOOK ����Ҫ�ú���ʵ�� */ +#if (configUSE_TICK_HOOK == 1 ) void vConfigureTimerForRunTimeStats( void ) { TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; @@ -85,38 +120,7 @@ TIM_ClearITPendingBit( TIM6, TIM_IT_Update ); } } -/*-----------------------------------------------------------*/ -void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) -{ - ( void ) pcTaskName; - ( void ) pxTask; - - /* Run time stack overflow checking is performed if - configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook - function is called if a stack overflow is detected. */ - for( ;; ); -} -/*-----------------------------------------------------------*/ - -void vApplicationMallocFailedHook( void ) -{ - /* Called if a call to pvPortMalloc() fails because there is insufficient - free memory available in the FreeRTOS heap. pvPortMalloc() is called - internally by FreeRTOS API functions that create tasks, queues or - semaphores. */ - for( ;; ); -} -/*-----------------------------------------------------------*/ - -void vApplicationIdleHook( void ) -{ - /* Called on each iteration of the idle task. In this case the idle task - just enters a low(ish) power mode. */ - PWR_EnterSleepMode( PWR_Regulator_ON, PWR_SLEEPEntry_WFI ); -} - -#if 0 void vApplicationTickHook( void ) { static unsigned long ulCounter = 0; @@ -134,4 +138,3 @@ } } #endif -/*-----------------------------------------------------------*/ -- Gitblit v1.9.1