中级会员
- 积分
- 250
- 威望
- 128
- 贡献
- 88
- 兑换币
- 81
- 注册时间
- 2016-9-24
- 在线时间
- 17 小时
- 毕业学校
- ld
|
开中断的时间 怎么弄?是下面这个函数吗?
void OV_ISR(uint32_t index)
{
static uint8_t status = TRANSFER_IN_PROCESS;
static uint32_t h_counter, v_counter;
// uint32_t i;
/* DDÖD¶Ï */
if(index & (1 << BOARD_OV7620_HREF_PIN))
{
DMA_SetDestAddress(HW_DMA_CH2, (uint32_t)gpHREF[h_counter++]);
//i = DMA_GetMajorLoopCount(HW_DMA_CH2);
DMA_SetMajorLoopCounter(HW_DMA_CH2, (OV7620_W/8)+1);
DMA_EnableRequest(HW_DMA_CH2);
return;
}
/* 3¤ÖD¶Ï */
if(index & (1 << BOARD_OV7620_VSYNC_PIN))
{
DisableInterrupts();
switch(status)
{
case TRANSFER_IN_PROCESS:
UserApp(v_counter++);
//printf("i:%d %d\r\n", h_counter, i);
status = NEXT_FRAME;
h_counter = 0;
break;
case NEXT_FRAME: // waiting for next transfer
status = TRANSFER_IN_PROCESS;
break;
default:
break;
}
EnableInterrupts();
PORTA->ISFR = 0xFFFFFFFF;
h_counter = 0;
return;
}
}
|
|