123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- #include "main.h"
- #include "stm32g0xx_it.h"
- void NMI_Handler(void)
- {
- while (1)
- {
- }
- }
- void HardFault_Handler(void)
- {
-
- TIM1->CCER &= ~(TIM_CCER_CC1E);
- TIM3->CCER &= ~(TIM_CCER_CC4E);
- TIM3->CCER &= ~(TIM_CCER_CC3E);
- TIM3->CCER &= ~(TIM_CCER_CC2E);
- TIM3->CCER &= ~(TIM_CCER_CC1E);
- GPIOA->BSRR = 0x10;
-
- TIM1->CCR2 = 0xff; TIM1->CCR3 = 0; TIM1->CCR4 = 0;
- while (1)
- {
- }
- }
- void SVC_Handler(void)
- {
- }
- void PendSV_Handler(void)
- {
- }
- void EXTI4_15_IRQHandler(void)
- {
- if ((EXTI->FPR1 & EXTI_IMR1_IM14) != 0)
- {
- EXTI->FPR1 = EXTI_IMR1_IM14;
- Flag.RTC_IRQ = 1;
- ES_PlaceEvent(evNewSecond);
- }
- }
- void DMA1_Channel1_IRQHandler(void)
- {
- if ((DMA1->ISR & DMA_IFCR_CTCIF1) != 0) {
- DMA1->IFCR |= DMA_IFCR_CTCIF1;
- Flag.SPI_TX_End = 1;
-
- DMA1_Channel1->CCR &= ~DMA_CCR_EN;
-
- LATCH_DOWN;
- while ((SPI1->SR & SPI_SR_FTLVL) != 0);
- while ((SPI1->SR & SPI_SR_BSY) != 0);
- LATCH_UP;
- }
- }
- void DMA1_Channel2_3_IRQHandler(void)
- {
- if ((DMA1->ISR & DMA_ISR_TCIF2) != 0) {
-
- DMA1->IFCR |= DMA_IFCR_CTCIF2;
-
- DMA1_Channel2->CCR &= ~DMA_CCR_EN;
- Flag.I2C_RX_End = 1;
- }
- if ((DMA1->ISR & DMA_ISR_TEIF2) != 0) {
- DMA1->IFCR |= DMA_IFCR_CTEIF2;
- DMA1_Channel2->CCR &= ~DMA_CCR_EN;
- Flag.I2C_RX_End = 1;
- Flag.I2C_RX_Err = 1;
- }
- if ((DMA1->ISR & DMA_ISR_TCIF3) != 0) {
-
- DMA1->IFCR |= DMA_IFCR_CTCIF3;
-
- DMA1_Channel3->CCR &= ~DMA_CCR_EN;
- Flag.I2C_TX_End = 1;
- }
- if ((DMA1->ISR & DMA_ISR_TEIF3) != 0) {
- DMA1->IFCR |= DMA_IFCR_CTEIF3;
- DMA1_Channel3->CCR &= ~DMA_CCR_EN;
- Flag.I2C_TX_End = 1;
- Flag.I2C_TX_Err = 1;
- }
- }
- void TIM14_IRQHandler(void)
- {
- if ((TIM14->SR & TIM_SR_UIF) != 0) {
-
- TIM14->SR &= ~TIM_SR_UIF;
-
- TUBE_ALL_ON;
- }
- if ((TIM14->SR & TIM_SR_CC1IF) != 0) {
-
- TIM14->SR &= ~TIM_SR_CC1IF;
-
- if (Flag.Blink_1 != 0) {
- TUBE_A_OFF;
- }
- if (Flag.Blink_2 != 0) {
- TUBE_B_OFF;
- }
- if (Flag.Blink_3 != 0) {
- TUBE_C_OFF;
- }
- if (Flag.Blink_4 != 0) {
- TUBE_D_OFF;
- }
- if (Flag.Blink_5 != 0) {
- TUBE_E_OFF;
- }
- }
- }
- void TIM16_IRQHandler(void)
- {
- if ((TIM16->SR & TIM_SR_UIF) != 0) {
-
- TIM16->SR |= TIM_SR_UIF;
- }
- }
- void TIM17_IRQHandler(void)
- {
- if ((TIM17->SR & TIM_SR_UIF) != 0) {
-
- TIM17->SR |= TIM_SR_UIF;
- }
- }
- void SPI1_IRQHandler(void)
- {
- }
- void USART1_IRQHandler(void)
- {
- }
|