| | |
| | | /**************************************************************************** |
| | | * Copyright: (C)2018 Î人ÁèÔÆÎïÍøÖÇ¿ÆÊµÑéÊÒ www.iot-yun.com |
| | | * Author: GuoWenxue<guowenxue@gmail.com> QQ: 281143292 |
| | | * Description: STM32L151C8T6 CubeMX ¿ª·¢°å FreeRTOS API |
| | | * Description: STM32L151C8T6 CubeMX ¿ª·¢°å FreeRTOS ÒÆÖ²ÒÀÀµº¯Êý |
| | | * |
| | | * ChangeLog: |
| | | * °æ±¾ºÅ ÈÕÆÚ ×÷Õß ËµÃ÷ |
| | |
| | | #include "stm32_vport.h" |
| | | |
| | | |
| | | |
| | | |
| | | unsigned long ulTIM6_OverflowCount = 0UL; |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | #endif |
| | | /*-----------------------------------------------------------*/ |