OV5640_RGB565_Mode(); //RGB565Ä£ê½
OV5640_Focus_Init();
OV5640_JPEG_Mode(); //JPEGÄ£ê½
OV5640_Light_Mode(0); //×Ô¶ˉÄ£ê½
OV5640_Color_Saturation(3);//é«2ê±¥oí¶è0
OV5640_Brightness(4); //áá¶è0
OV5640_Contrast(3); //¶Ô±è¶è0
OV5640_Sharpness(33); //×Ô¶ˉèñ¶è
OV5640_Focus_Constant();//Æô¶ˉ3ÖDø¶Ô½1
My_DCMI_Init(); //DCMIÅäÖÃ
DCMI_DMA_Init((u32)&jpeg_buf,jpeg_buf_size,DMA_MemoryDataSize_Word,DMA_MemoryInc_Enable);//DCMI DMAÅäÖÃ
OV5640_OutSize_Set(4,0,jpeg_img_size_tbl[size][0],jpeg_img_size_tbl[size][1]);//éèÖÃêä3ö3ß′ç
DCMI_Start(); //Æô¶ˉ′«êä
while(1)
{
if(jpeg_data_ok==1) //òѾ-2é¼ˉíêò»Ö¡í¼ÏñáË
{
p=(u8*)jpeg_buf;
PRINT_COM2("jpeg_data_len:%d
",jpeg_data_len*4);//′òó¡Ö¡Âê
// LCD_ShowString(30,210,210,16,16,"Sending JPEG data..."); //ìáê¾ÕyÔú′«êäêy¾Y
jpglen=0; //éèÖÃjpgÎļt′óD¡Îa0
headok=0; //Çå3yjpgí·±ê¼Ç
for(i=0;i<jpeg_data_len*4;i++)//2éÕò0XFF,0XD8oí0XFF,0XD9,»ñè¡jpgÎļt′óD¡
{
if((p[i]==0XFF)&&(p[i+1]==0XD8))//Õòμ½FF D8
{
jpgstart=i;
headok=1; //±ê¼ÇÕòμ½jpgí·(FF D8)
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
{
if(jpeg_data_ok==0) //jpegêy¾Y»1Î′2é¼ˉíê?
{
DMA_Cmd(DMA2_Stream1, DISABLE);//í£Ö1μ±Ç°′«êä
while (DMA_GetCmdStatus(DMA2_Stream1) != DISABLE){}//μè′yDMA2_Stream1¿éÅäÖÃ
PRINT_COM2("size is %d ",DMA_GetCurrDataCounter(DMA2_Stream1));
jpeg_data_len=jpeg_buf_size-DMA_GetCurrDataCounter(DMA2_Stream1);//μÃμ½′Ë′Îêy¾Y′«êäμÄ3¤¶è
jpeg_data_ok=1; //±ê¼ÇJPEGêy¾Y2é¼ˉíê°′3é,μè′yÆäËûoˉêy′|àí
}
if(jpeg_data_ok==2) //éÏò»′ÎμÄjpegêy¾YòѾ-±»′|àíáË
{
PRINT_COM2("done ");
DMA2_Stream1->NDTR=jpeg_buf_size;
DMA_SetCurrDataCounter(DMA2_Stream1,jpeg_buf_size);//′«êä3¤¶èÎajpeg_buf_size*4×Ö½ú
DMA_Cmd(DMA2_Stream1, ENABLE); //ÖØDÂ′«êä
jpeg_data_ok=0; //±ê¼Çêy¾YÎ′2é¼ˉ
}
这个地方DMA_GetCurrDataCounter得到的永远都是jpeg_buf_size的值,为什么啊????搞了一天了,是DCMI设置有问题吗
一周热门 更多>