|
对了,贴上我的代码吧
void TaskGeneral(void * pdata)
{
unsigned int c_data;
int x, y;
pdata = pdata;
LCD_Clear(0);
printf( "<General Task Experiment>\n\r" );
LCD_DispString( "<General Task Experiment>", WHITE, BLACK, 0, 0 );
//SD_Test();
FIFO_CS_L();
FIFO_WE_H();
LCD_DispString( "OV7725 Initialize ... ", WHITE, BLACK, 0, 2 );
while( 1 != ov7725_init() );
LCD_DispString( "[ok]", GREEN, BLACK, 22, 2 );
for(;;)
{
FIFO_RRST_L();
for( x = 0; x < 128; x++ )
{
FIFO_RD_H();
FIFO_RD_L();
}
FIFO_RRST_H();
delay_us(10);
for( x = 0; x < 240; x++ )
{
for( y = 319; y >= 0; y-- )
{
FIFO_RD_H();
FIFO_RD_L();
c_data = (FIFO_DATA_PORT->IDR << 8) & 0xFF00;
FIFO_RD_H();
FIFO_RD_L();
c_data |= FIFO_DATA_PORT->IDR & 0x00FF;
LCD_DrawDot(c_data, x, y);
}
}
OSTimeDlyHMSM(0,0,0,10);
}
}
我是放在ucos的一个任务里运行的,另外没有别的任务了,另外就是所有IO、中断、包括MCO的初始化操作我都一起在之前就执行了,不知道跟这些有没有关系 |
|