Skip to content

Commit

Permalink
Setup exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Peque committed Apr 7, 2019
1 parent 39b400b commit ad5c45f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ static void setup_clock(void)
dwt_enable_cycle_counter();
}

/**
* @brief Exceptions configuration.
*
* This function configures Nested Vectored Interrupt Controller for IRQ and
* System Control Block for system interruptions.
*
* Interruptions enabled:
*
* - DMA 2 stream 7 interrupt.
* - USART1 interrupt.
*
* @see Programming Manual (PM0214).
*/
static void setup_exceptions(void)
{
nvic_enable_irq(NVIC_DMA2_STREAM7_IRQ);
nvic_enable_irq(NVIC_USART1_IRQ);
}

/**
* @brief Set SysTick interruptions frequency and enable SysTick counter.
*
Expand Down Expand Up @@ -350,6 +369,7 @@ static void setup_speaker(void)
void setup(void)
{
setup_clock();
setup_exceptions();
setup_gpio();
setup_speaker();
setup_motor_driver();
Expand Down

0 comments on commit ad5c45f

Please sign in to comment.