📄 main.c
字号:
#include <stdio.h>
#include <stdlib.h>
#include <ccblkfn.h>
#include <cdefBF533.h>
#include "dsp_init.h"
#include "dsp_uart.h"
#include "pll_detect.h"
#include "gprs_protocol.h"
#include "dsp_sys.h"
//#include "assert.h"
//#include "stdio.h"
//extern char SMMS_BUF[];
extern unsigned char *pCur_Yuv,*pRef_Yuv;
extern unsigned char *YUV_656;
FILE *outfile;
#define BAUD_UART (115200)
#define STOPCK 0X0008
/*******************************************************************/
/*******************************************************************
Copyright (C), 2004-2006, Zhejiang University ISEE 407.
File name: //main.c
Author:xbwang020 Version:1.0 Date:2006.4.12
Description: // 用于详细说明此程序文件完成的主要功能,与其他模块
// 或函数的接口,输出值、取值范围、含义及参数间的控
// 制、顺序、独立或依赖等关系
Others: // 其它内容的说明
Function List: // 主要函数列表,每条记录应包括函数名及功能简要说明
1. ....
History: // 修改历史记录列表,每条修改记录应包括修改日期、修改
// 者及修改内容简述
1. Date:
Author:
Modification:
2. ...
//RBG888->YUV444
Y = ( ( 66 * R + 129 * G + 25 * B + 128) >> 8) + 16
U = ( ( -38 * R - 74 * G + 112 * B + 128) >> 8) + 128
V = ( ( 112 * R - 94 * G - 18 * B + 128) >> 8) + 128
R:255 Y:82
G:0 -> U:90
B:0 V:240
*********************************************************************/
/********************************************************************/
int main()
{
int div,sclk,ret;//relate to the baud
//outfile=fopen("g:\\a.jpeg","wb");
dsp_init();//init the system
BF533_WDOG_WRITE_CNT();
BF533_WDOG_WRITE_CTL();
watchdog_interrupt_init();
//we should detect the baud automatic and get the div,
//but now we can't
get_clk(0, &sclk);
div = sclk/(16*BAUD_UART);
uart_init(div);//initial the uart
YUV_656 = (unsigned char*)malloc(1440*288*2);
pCur_Yuv = pRef_Yuv = YUV_656;
jpeg_pack.info.pic_big=0;
jpeg_pack.info.quality=80;
//set the uart wakeup bit.
//*pSIC_IWR |= 0x4041;
//Clear the bypass bit;
//*pPLL_CTL &= ~BYPASS;
while(1)
{
//uart_send(YUV_656,1024);
// unsigned int sti_reg;
//for saving power
/*sti_reg = cli();
*pPLL_CTL |= STOPCK;
*pVR_CTL = 0X017B;
idle();
sti(sti_reg);
sti_reg = cli();
*pVR_CTL = 0X01DB;
idle();
sti(sti_reg); */
ret = command_proc();
BF533_WDOG_WRITE_STAT();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -