野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 16173|回复: 1

DMA2_Stream1_IRQHandler

[复制链接]
发表于 2017-6-23 13:36:54 | 显示全部楼层 |阅读模式
5火花
本帖最后由 LighthgiL 于 2017-6-23 13:37 编辑

这里面的DMA2_Stream1_IRQHandler是怎么执行的呢?其他的程序里面根本就没有调用DMA2_Stream1_IRQHandler呀!



  1. /**
  2.   ******************************************************************************
  3.   * @file    FMC_SDRAM/stm32f4xx_it.c
  4.   * @author  MCD Application Team
  5.   * @version V1.0.1
  6.   * @date    11-November-2013
  7.   * @brief   Main Interrupt Service Routines.
  8.   *         This file provides template for all exceptions handler and
  9.   *         peripherals interrupt service routine.
  10.   ******************************************************************************
  11.   * @attention
  12.   *
  13.   * <h2><center>&#169; COPYRIGHT 2013 STMicroelectronics</center></h2>
  14.   *
  15.   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  16.   * You may not use this file except in compliance with the License.
  17.   * You may obtain a copy of the License at:
  18.   *
  19.   *        http://www.st.com/software_license_agreement_liberty_v2
  20.   *
  21.   * Unless required by applicable law or agreed to in writing, software
  22.   * distributed under the License is distributed on an "AS IS" BASIS,
  23.   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  24.   * See the License for the specific language governing permissions and
  25.   * limitations under the License.
  26.   *
  27.   ******************************************************************************
  28.   */

  29. /* Includes ------------------------------------------------------------------*/
  30. #include "stm32f4xx_it.h"
  31. #include "./camera/bsp_ov2640.h"
  32. #include "./systick/bsp_SysTick.h"
  33. #include "./Recognization/Recognization.h"

  34. extern unsigned int Task_Delay[];

  35. /** @addtogroup STM32F429I_DISCOVERY_Examples
  36.   * @{
  37.   */

  38. /** @addtogroup FMC_SDRAM
  39.   * @{
  40.   */

  41. /* Private typedef -----------------------------------------------------------*/
  42. /* Private define ------------------------------------------------------------*/
  43. /* Private macro -------------------------------------------------------------*/
  44. /* Private variables ---------------------------------------------------------*/
  45. /* Private function prototypes -----------------------------------------------*/
  46. /* Private functions ---------------------------------------------------------*/

  47. /******************************************************************************/
  48. /*            Cortex-M4 Processor Exceptions Handlers                         */
  49. /******************************************************************************/

  50. /**
  51.   * @brief  This function handles NMI exception.
  52.   * @param  None
  53.   * @retval None
  54.   */
  55. void NMI_Handler(void)
  56. {
  57. }

  58. /**
  59.   * @brief  This function handles Hard Fault exception.
  60.   * @param  None
  61.   * @retval None
  62.   */
  63. void HardFault_Handler(void)
  64. {
  65.   /* Go to infinite loop when Hard Fault exception occurs */
  66.   while (1)
  67.   {}
  68. }

  69. /**
  70.   * @brief  This function handles Memory Manage exception.
  71.   * @param  None
  72.   * @retval None
  73.   */
  74. void MemManage_Handler(void)
  75. {
  76.   /* Go to infinite loop when Memory Manage exception occurs */
  77.   while (1)
  78.   {}
  79. }

  80. /**
  81.   * @brief  This function handles Bus Fault exception.
  82.   * @param  None
  83.   * @retval None
  84.   */
  85. void BusFault_Handler(void)
  86. {
  87.   /* Go to infinite loop when Bus Fault exception occurs */
  88.   while (1)
  89.   {}
  90. }

  91. /**
  92.   * @brief  This function handles Usage Fault exception.
  93.   * @param  None
  94.   * @retval None
  95.   */
  96. void UsageFault_Handler(void)
  97. {
  98.   /* Go to infinite loop when Usage Fault exception occurs */
  99.   while (1)
  100.   {}
  101. }

  102. /**
  103.   * @brief  This function handles Debug Monitor exception.
  104.   * @param  None
  105.   * @retval None
  106.   */
  107. void DebugMon_Handler(void)
  108. {}

  109. /**
  110.   * @brief  This function handles SVCall exception.
  111.   * @param  None
  112.   * @retval None
  113.   */
  114. void SVC_Handler(void)
  115. {}

  116. /**
  117.   * @brief  This function handles PendSV_Handler exception.
  118.   * @param  None
  119.   * @retval None
  120.   */
  121. void PendSV_Handler(void)
  122. {}

  123.        
  124. extern uint32_t Task_Delay[];
  125. /**
  126.   * @brief  This function handles SysTick Handler.
  127.   * @param  None
  128.   * @retval None
  129.   */
  130. void SysTick_Handler(void)
  131. {
  132.         uint8_t i;
  133.        
  134.   TimingDelay_Decrement();
  135.        
  136.         for(i=0;i<NumOfTask;i++)
  137.         {
  138.                 if(Task_Delay[i])
  139.                 {
  140.                         Task_Delay[i]--;
  141.                 }
  142.         }
  143. }



  144. /******************************************************************************/
  145. /*                 STM32F4xx Peripherals Interrupt Handlers                   */
  146. /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
  147. /*  available peripheral interrupt handler's name please refer to the startup */
  148. /*  file (startup_stm32f429_439xx.s).                         */
  149. /******************************************************************************/

  150. extern uint16_t lcd_width, lcd_height;
  151. extern uint16_t img_width, img_height;
  152. extern uint8_t fps;

  153. //记录传输了多少行
  154. static uint16_t line_num =0;


  155. void DMA2_Stream1_IRQHandler(void)
  156. {
  157.   if(  DMA_GetITStatus(DMA2_Stream1,DMA_IT_TCIF1) == SET )   
  158.   {
  159.                 /*行计数*/
  160.                 line_num++;

  161.     if(line_num==img_height)
  162.                 {
  163.                         /*传输完一帧,计数复位*/
  164.                         line_num=0;
  165.                        
  166.                         xiang();
  167.                
  168.                 }               
  169.                 /*DMA 一行一行传输*/
  170.     OV2640_DMA_Config(FSMC_LCD_ADDRESS+(lcd_width*2*(lcd_height-line_num-1)),img_width*2/4);
  171.     DMA_ClearITPendingBit(DMA2_Stream1,DMA_IT_TCIF1);
  172.         }
  173. }


  174. //使用帧中断重置line_num,可防止有时掉数据的时候DMA传送行数出现偏移
  175. void DCMI_IRQHandler(void)
  176. {

  177.         if(  DCMI_GetITStatus (DCMI_IT_FRAME) == SET )   
  178.         {
  179.                 /*传输完一帧,计数复位*/
  180.                 line_num=0;
  181.                 fps++; //帧率计数
  182.        
  183.                
  184.                
  185.                 DCMI_ClearITPendingBit(DCMI_IT_FRAME);
  186.         }
  187. }


  188. /**
  189.   * @}
  190.   */

  191. /**
  192.   * @}
  193.   */

  194. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
复制代码


回复

使用道具 举报

发表于 2017-6-23 18:39:43 | 显示全部楼层
OV2640_DMA_Config 配置了dma
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-5-2 02:17 , Processed in 0.074378 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表