mirror of https://github.com/ARMmbed/mbed-os.git
Add FREEZE_TIMER_ON_DEBUG condition
In order to give the choice to enable or not the timer freeze on stop/breakpoint. This has to be defined in the mbed_app.json file for example.pull/5130/head
parent
9f86a32baf
commit
5bf18682e2
|
@ -148,12 +148,11 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||||
// Enable timer
|
// Enable timer
|
||||||
HAL_TIM_Base_Start(&TimMasterHandle);
|
HAL_TIM_Base_Start(&TimMasterHandle);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
#ifdef TIM_MST_DBGMCU_FREEZE
|
|
||||||
// Freeze timer on stop/breakpoint
|
// Freeze timer on stop/breakpoint
|
||||||
|
// Define the FREEZE_TIMER_ON_DEBUG macro in mbed_app.json for example
|
||||||
|
#if !defined(NDEBUG) && defined(FREEZE_TIMER_ON_DEBUG) && defined(TIM_MST_DBGMCU_FREEZE)
|
||||||
TIM_MST_DBGMCU_FREEZE;
|
TIM_MST_DBGMCU_FREEZE;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DEBUG_TICK > 0
|
#if DEBUG_TICK > 0
|
||||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
|
|
|
@ -118,12 +118,11 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||||
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, PreviousVal + HAL_TICK_DELAY);
|
__HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_2, PreviousVal + HAL_TICK_DELAY);
|
||||||
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);
|
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
#ifdef TIM_MST_DBGMCU_FREEZE
|
|
||||||
// Freeze timer on stop/breakpoint
|
// Freeze timer on stop/breakpoint
|
||||||
|
// Define the FREEZE_TIMER_ON_DEBUG macro in mbed_app.json for example
|
||||||
|
#if !defined(NDEBUG) && defined(FREEZE_TIMER_ON_DEBUG) && defined(TIM_MST_DBGMCU_FREEZE)
|
||||||
TIM_MST_DBGMCU_FREEZE;
|
TIM_MST_DBGMCU_FREEZE;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DEBUG_TICK > 0
|
#if DEBUG_TICK > 0
|
||||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
|
|
Loading…
Reference in New Issue