-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.c
More file actions
30 lines (25 loc) · 875 Bytes
/
debug.c
File metadata and controls
30 lines (25 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "debug.h"
/* Initialize globals */
xDebugStats_t xDebugStats = { 0 };
/**
* @brief Initialization debug statistics.
* @param None
* @retval None
*/
void vInitDebug( void )
{
/* Initialization structures. */
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
/* Initialize timer for debug purposes. */
/* Enable the clock used for TIM12 (42MHz) */
RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM12, ENABLE );
/* Time base configuration */
TIM_TimeBaseStructure.TIM_Period = 65535U;
TIM_TimeBaseStructure.TIM_Prescaler = 41U;
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit( TIM12, &TIM_TimeBaseStructure );
/* TIM12 enable counter */
TIM_Cmd(TIM12, ENABLE);
}
/*-----------------------------------------------------------*/