Zap'Em Blast'Em Robots
robots that play laser tag!
Loading...
Searching...
No Matches
stm32f4xx_it.c File Reference

Interrupt Service Routines. More...

#include "main.h"
#include "stm32f4xx_it.h"
#include "sound_task.h"
#include "start_buf.h"
#include "hit_buf.h"
#include "laser_buf.h"
#include "game_over_buf.h"
#include <stdint.h>

Functions

void NMI_Handler (void)
 This function handles Non maskable interrupt.
void HardFault_Handler (void)
 This function handles Hard fault interrupt.
void MemManage_Handler (void)
 This function handles Memory management fault.
void BusFault_Handler (void)
 This function handles Pre-fetch fault, memory access fault.
void UsageFault_Handler (void)
 This function handles Undefined instruction or illegal state.
void SVC_Handler (void)
 This function handles System service call via SWI instruction.
void DebugMon_Handler (void)
 This function handles Debug monitor.
void PendSV_Handler (void)
 This function handles Pendable request for system service.
void SysTick_Handler (void)
 This function handles System tick timer.
void TIM1_BRK_TIM9_IRQHandler (void)
 This function handles TIM1 break interrupt and TIM9 global interrupt.
void TIM2_IRQHandler (void)
 This function handles TIM2 global interrupt for intersective PWM generation for audio.
void EXTI15_10_IRQHandler (void)
 This function handles EXTI line[15:10] interrupts.
void DMA2_Stream0_IRQHandler (void)
 This function handles DMA2 stream0 global interrupt.

Variables

uint32_t ms_counter = 0
DMA_HandleTypeDef hdma_adc1
TIM_HandleTypeDef htim1
TIM_HandleTypeDef htim2
TIM_HandleTypeDef htim9

Detailed Description

Interrupt Service Routines.

Attention

Copyright (c) 2025 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Function Documentation

◆ TIM1_BRK_TIM9_IRQHandler()

void TIM1_BRK_TIM9_IRQHandler ( void )

This function handles TIM1 break interrupt and TIM9 global interrupt.

TIM9 is used to generate a 1 ms timer for non-blocking delays

◆ TIM2_IRQHandler()

void TIM2_IRQHandler ( void )

This function handles TIM2 global interrupt for intersective PWM generation for audio.

When the playing flag is set by the sound task, this interrupt feeds data from the current audio buff to the PWM duty cycle output. The PWM operates at a frequency twice that of our audio frequency which gives decent sound quality.