Interrupt counters added (use -DDEBUG_INTERRUPTS=YES to enable and CLI command "print int" to see them)
This commit is contained in:
@@ -58,8 +58,8 @@ void init2MhzTimer()
|
||||
TIMER_2MHz_TIMER->CR1 = TIM_CR1_CEN;
|
||||
}
|
||||
|
||||
// Starts TIMER at 200Hz, 5mS period
|
||||
void init5msTimer()
|
||||
// Starts TIMER at 1000Hz
|
||||
void init1msTimer()
|
||||
{
|
||||
INTERRUPT_5MS_TIMER->ARR = 999 ; // 1mS
|
||||
INTERRUPT_5MS_TIMER->PSC = (PERI1_FREQUENCY * TIMER_MULT_APB1) / 1000000 - 1 ; // 1uS from 30MHz
|
||||
@@ -72,15 +72,8 @@ void init5msTimer()
|
||||
NVIC_SetPriority(TIM8_TRG_COM_TIM14_IRQn, 7);
|
||||
}
|
||||
|
||||
void stop5msTimer( void )
|
||||
{
|
||||
TIM14->CR1 = 0 ; // stop timer
|
||||
NVIC_DisableIRQ(TIM8_TRG_COM_TIM14_IRQn) ;
|
||||
RCC->APB1ENR &= ~RCC_APB1ENR_TIM14EN ; // Disable clock
|
||||
}
|
||||
|
||||
// TODO use the same than board_sky9x.cpp
|
||||
void interrupt5ms()
|
||||
void interrupt1ms()
|
||||
{
|
||||
static uint32_t pre_scale ; // Used to get 10 Hz counter
|
||||
|
||||
@@ -106,7 +99,8 @@ void interrupt5ms()
|
||||
extern "C" void TIM8_TRG_COM_TIM14_IRQHandler()
|
||||
{
|
||||
TIM14->SR &= ~TIM_SR_UIF ;
|
||||
interrupt5ms() ;
|
||||
interrupt1ms() ;
|
||||
DEBUG_INTERRUPT(INT_1MS);
|
||||
}
|
||||
|
||||
void boardInit()
|
||||
@@ -155,7 +149,7 @@ void boardInit()
|
||||
lcdInit();
|
||||
audioInit();
|
||||
init2MhzTimer();
|
||||
init5msTimer();
|
||||
init1msTimer();
|
||||
usbInit();
|
||||
hapticInit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user