亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uimgr.c

?? 基于avr單片機的嵌入式攝像機的源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
		a request has come to dump a frame...this will
		be received by the FrameMgr, which will begin
		dumping the frame...a short delay is needed
		here to keep the Java demo app happy (sometimes
		it wouldn't be able to receive the serial data
		as quickly as AVRcam can provide it). */
		Utility_delay(100);
		PUBLISH_EVENT(EV_DUMP_FRAME);
	}
	else if (receivedCmd == setCameraRegsCmd)
	{
		/* we need to gather the tokens and
		build config cmds to be sent to the camera */
		for (i=1; i<tokenCount; i+=2)  /* starts at 1 since first token
											is the CR cmd */
		{
			CamConfig_setCamReg(tokenBuffer[i],tokenBuffer[i+1]);
		}
		CamConfig_sendFifoCmds();
	}
	else if (receivedCmd == enableTrackingCmd)
	{
		/* publish the event...again with a short delay */
		Utility_delay(100);
		PUBLISH_EVENT(EV_ENABLE_TRACKING);
	}
	else if (receivedCmd == disableTrackingCmd)
	{
		PUBLISH_EVENT(EV_DISABLE_TRACKING);
	}
	else if (receivedCmd == setColorMapCmd)
	{
		/* copy the received tokens into the color map */
		for (i=0; i<tokenCount; i++)
		{
			colorMap[i] = tokenBuffer[i+1];
            
            /* write each colorMap byte to EEPROM, but only those
            that changed...this will help reduce wear on the EEPROM */
            eepromData = eeprom_read_byte( (unsigned char*)(i+1));
            if (eepromData != colorMap[i])
            {
                /* need to actually perform the write because the
                data in eeprom is different than the current colorMap */
                eeprom_write_succeeded = FALSE;
                while(eeprom_write_succeeded == FALSE && num_writes < MAX_EEPROM_WRITE_ATTEMPTS)
                {
                    eeprom_write_byte((unsigned char*)(i+1),colorMap[i]);
                    num_writes++;
                    eepromData = eeprom_read_byte( (unsigned char*)(i+1));
                    if (eepromData == colorMap[i])
                    {
                        eeprom_write_succeeded = TRUE;
                    }
                }
                num_writes = 0;
            }
		}

#if	DEBUG_COLOR_MAP			
            			/* for debugging...send out the entire color map */
        UIMgr_txBuffer("\r\n",2);
		for (i=0; i<NUM_ELEMENTS_IN_COLOR_MAP; i++)
		{
			memset(asciiBuffer,0x00,5);
			itoa(colorMap[i],asciiBuffer,10);
			UIMgr_txBuffer(asciiBuffer,3);
			UIMgr_txBuffer(" ",1);
			if (i==15 || i == 31)
			{
				/* break up the output */
				UIMgr_txBuffer("\r\n",2);
			}
		}
#endif			
	}
}

/***********************************************************
	Function Name: UIMgr_convertTokenToValue
	Function Description: This function is responsible for
	converting a received token to a hex value It will
	access the asciiTokenBuffer directly, and store the
	result in the appropriate token buffer.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_convertTokenToValue(void)
{
	unsigned int newValue;
	
	newValue = atoi(asciiTokenBuffer);
	if (newValue > 255)
	{
		/* the value is too large */
		receivedCmd = invalidCmd;
		tokenBuffer[tokenCount] = 0xFF;  /* to indicate an error */
	}
	else
	{
		/* copy the value into the tokenBuffer */
		tokenBuffer[tokenCount] = newValue;
	}
	memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH);
	charIndex = 0;
	charCount = 0;
}
/***********************************************************
	Function Name: UIMgr_convertTokenToCmd
	Function Description: This function is responsible for
	parsing a received 2-character command.  It will
	access the asciiTokenBuffer directly.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_convertTokenToCmd(void)
{
	if ( (asciiTokenBuffer[0] == 'P') &&
		 (asciiTokenBuffer[1] == 'G') )
	{
		/* we got a "ping" command...but we still need to see
		if we are going to get the \r */
		receivedCmd = pingCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'G') &&
			   (asciiTokenBuffer[1] == 'V') )
	{
		/* we got the "get version" command */
		receivedCmd = getVersionCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'D') &&
			   (asciiTokenBuffer[1] == 'F') )
	{
		/* we should go into frame dump mode */
		receivedCmd = dumpFrameCmd;	
	}
	else if ( (asciiTokenBuffer[0] == 'C') &&
	           (asciiTokenBuffer[1] == 'R') )
	{
		/* the user wants to set registers in the OV6620 */
		receivedCmd = setCameraRegsCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'E') &&
			   (asciiTokenBuffer[1] == 'T') )
	{
		/* the user wants to enable tracking */
		receivedCmd = enableTrackingCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'S') &&
			   (asciiTokenBuffer[1] == 'M') )
	{
		/* the user wants to set the color map */
		receivedCmd = setColorMapCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'D') &&
			   (asciiTokenBuffer[1] == 'T') )
	{
		receivedCmd = disableTrackingCmd;
	}
	else if ( (asciiTokenBuffer[0] == 'R') &&
			   (asciiTokenBuffer[1] == 'S') )
	{
		receivedCmd = resetCameraCmd;
	}
	else
	{
		/* don't recognize the cmd */
		receivedCmd = invalidCmd;
	}
	memset(asciiTokenBuffer,0x00,MAX_TOKEN_LENGTH);
	charIndex = 0;
	charCount = 0;
}
/***********************************************************
	Function Name: UIMgr_sendAck
	Function Description: This function is responsible for
	queuing up an ACK to be sent to the user.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_sendAck(void)
{
	UIMgr_writeTxFifo('A');
	UIMgr_writeTxFifo('C');
	UIMgr_writeTxFifo('K');
	UIMgr_writeTxFifo('\r');
}

/***********************************************************
	Function Name: UIMgr_sendNck
	Function Description: This function is responsible for
	queueing up an NCK to be sent to the user.
	Inputs:  none 
	Outputs: none
***********************************************************/	
static void UIMgr_sendNck(void)
{
		UIMgr_writeTxFifo('N');
		UIMgr_writeTxFifo('C');
		UIMgr_writeTxFifo('K');
		UIMgr_writeTxFifo('\r');
}


/***********************************************************
	Function Name: UIMgr_writeBufferToTxFifo
	Function Description: This function is responsible for
	placing "length" bytes into the tx FIFO.
	Inputs:  pData -  a pointer to the data to send
	         length - the number of bytes to send
	Outputs: none
***********************************************************/	
void UIMgr_writeBufferToTxFifo(unsigned char *pData, unsigned char length)
{
	unsigned char tmpHead;
	if (length == 0)
	{
		return;
	}
	
	DISABLE_INTS();
	while(length-- != 0)
	{
		UIMgr_txFifo[UIMgr_txFifoHead] = *pData++;
	
		/* now move the head up */
		tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK);
		UIMgr_txFifoHead = tmpHead;
	}
	ENABLE_INTS();
}

/***********************************************************
	Function Name: UIMgr_txBuffer
	Function Description: This function is responsible for
	sending 'length' bytes out using the UartInterface 
	module.
	Inputs:  pData -  a pointer to the data to send
	         length - the number of bytes to send
	Outputs: none
***********************************************************/	
void UIMgr_txBuffer(unsigned char *pData, unsigned char length)
{
	while(length-- != 0)
	{
		UartInt_txByte(*pData++); 
	}
}

/***********************************************************
	Function Name: UIMgr_flushTxBuffer
	Function Description: This function is responsible for
	sending all data currently in the serial tx buffer
	to the user.
	Inputs:  none
	Outputs: none
***********************************************************/	
void UIMgr_flushTxBuffer(void)
{
	while(IS_DATA_IN_TX_FIFO() == TRUE)
	{
		UartInt_txByte(UIMgr_readTxFifo() );
	}
}

/***********************************************************
	Function Name: UIMgr_readRxFifo
	Function Description: This function is responsible for
	reading a single byte of data from the rx fifo, and
	updating the appropriate pointers.
	Inputs:  none 
	Outputs: unsigned char-the data read
***********************************************************/	
static unsigned char UIMgr_readRxFifo(void)
{
	unsigned char dataByte, tmpTail;
	
	/* just return the current tail from the rx fifo */
	DISABLE_INTS();
	dataByte = UIMgr_rxFifo[UIMgr_rxFifoTail];	
	tmpTail = (UIMgr_rxFifoTail+1) & (UI_MGR_RX_FIFO_MASK);
	UIMgr_rxFifoTail = tmpTail;
	ENABLE_INTS();
	
	return(dataByte);
}

/***********************************************************
	Function Name: UIMgr_readTxFifo
	Function Description: This function is responsible for
	reading a single byte of data from the tx fifo, and
	updating the appropriate pointers.
	Inputs:  none 
	Outputs: unsigned char-the data read
***********************************************************/	
static unsigned char UIMgr_readTxFifo(void)
{
	unsigned char dataByte, tmpTail;
	
	/* just return the current tail from the tx fifo */
	DISABLE_INTS();
	dataByte = UIMgr_txFifo[UIMgr_txFifoTail];	
	tmpTail = (UIMgr_txFifoTail+1) & (UI_MGR_TX_FIFO_MASK);
	UIMgr_txFifoTail = tmpTail;
	ENABLE_INTS();
	
	return(dataByte);
}

/***********************************************************
	Function Name: UIMgr_writeTxFifo
	Function Description: This function is responsible for
	writing a single byte to the TxFifo and
	updating the appropriate pointers.
	Inputs:  data - the byte to write to the Fifo 
	Outputs: none
***********************************************************/	
void UIMgr_writeTxFifo(unsigned char data)
{
	unsigned char tmpHead;

	DISABLE_INTS();
	UIMgr_txFifo[UIMgr_txFifoHead] = data;

    /* now move the head up */
    tmpHead = (UIMgr_txFifoHead + 1) & (UI_MGR_TX_FIFO_MASK);
    UIMgr_txFifoHead = tmpHead;
	ENABLE_INTS();
	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月天亚洲婷婷| 国产风韵犹存在线视精品| 久久99精品久久只有精品| av网站一区二区三区| 欧美一级高清大全免费观看| 国产精品久久久久久久久快鸭| 久久成人久久爱| 欧美色图激情小说| 中文字幕一区二区三区在线观看| 男人的天堂久久精品| 色噜噜狠狠色综合中国| 国产三级精品三级| 美腿丝袜一区二区三区| 欧美性一二三区| 亚洲图片你懂的| 国产69精品一区二区亚洲孕妇| 欧美成人高清电影在线| 日日夜夜免费精品视频| 欧美偷拍一区二区| 亚洲精品伦理在线| 91香蕉国产在线观看软件| 久久久久久久电影| 国产在线不卡一卡二卡三卡四卡| 91精品在线观看入口| 午夜电影一区二区三区| 欧美日韩一级视频| 亚洲二区在线观看| 欧美日韩精品综合在线| 亚洲一区在线观看免费 | 国产精品乱码妇女bbbb| 久久99精品久久久久久动态图| 在线成人免费观看| 亚洲成av人在线观看| 欧美日韩国产综合草草| 天天影视涩香欲综合网 | 99在线精品视频| 国产精品高潮呻吟| 色婷婷精品大在线视频| 亚洲第一激情av| 欧美一区二区三区在线观看| 日本强好片久久久久久aaa| 欧美麻豆精品久久久久久| 三级久久三级久久| 精品国产自在久精品国产| 国产乱人伦精品一区二区在线观看 | 精品日韩欧美一区二区| 国产一区二区精品久久91| 中文字幕第一区第二区| 色综合久久久久综合体桃花网| 亚洲精品国产无天堂网2021| 欧美午夜精品一区二区蜜桃| 日韩高清电影一区| 久久精品欧美一区二区三区麻豆| 不卡的av中国片| 午夜a成v人精品| 欧美大片在线观看一区二区| 成人一区二区三区视频| 亚洲一区在线播放| 欧美成人一区二区三区片免费| 国产成人精品一区二区三区网站观看 | 久久综合九色综合97婷婷女人| 国产成人夜色高潮福利影视| 依依成人综合视频| 精品国产sm最大网站免费看| 成人精品视频一区二区三区| 亚洲电影你懂得| 国产色一区二区| 欧美日韩精品三区| 豆国产96在线|亚洲| 亚洲chinese男男1069| 欧美激情艳妇裸体舞| 欧美日韩国产中文| 成人h动漫精品| 日本不卡一区二区三区| 中文字幕一区二区三区乱码在线| 在线不卡欧美精品一区二区三区| 成人爽a毛片一区二区免费| 亚洲第一福利一区| 中文字幕日韩欧美一区二区三区| 日韩三级视频在线观看| 91美女片黄在线观看| 国内精品国产成人国产三级粉色 | 国产成人高清视频| 日韩不卡一二三区| 一区二区三区精品视频在线| 欧美国产精品中文字幕| 日韩欧美一区在线| 欧美色倩网站大全免费| av在线不卡电影| 国产精品亚洲第一区在线暖暖韩国| 亚洲第一在线综合网站| 最新热久久免费视频| 久久看人人爽人人| 日韩精品中文字幕一区| 欧美日韩一卡二卡三卡| 色视频一区二区| av中文字幕一区| 国产乱码精品一区二区三区av | 99久久99精品久久久久久| 狠狠色伊人亚洲综合成人| 奇米888四色在线精品| 午夜伊人狠狠久久| 亚洲国产成人av网| 亚洲综合色噜噜狠狠| 亚洲三级电影网站| 中文字幕一区二区日韩精品绯色| 久久九九久久九九| 久久久久久97三级| 久久久久亚洲综合| 精品国产亚洲在线| 精品国产乱码久久久久久图片| 日韩一区国产二区欧美三区| 91精品国产全国免费观看| 在线综合+亚洲+欧美中文字幕| 欧美午夜精品免费| 日本高清不卡视频| 91玉足脚交白嫩脚丫在线播放| 国产成人免费9x9x人网站视频| 日韩精品欧美成人高清一区二区| 一区二区三区免费在线观看| 亚洲欧美日韩综合aⅴ视频| 国产精品丝袜一区| 国产欧美精品在线观看| 国产精品色眯眯| 国产精品美女久久久久久久| 欧美韩国日本不卡| 中文字幕精品在线不卡| 91麻豆精品国产| 久久久精品日韩欧美| www亚洲一区| 国产午夜精品福利| 亚洲国产岛国毛片在线| 亚洲色图在线视频| 亚洲精品国产视频| 亚洲电影第三页| 日韩和欧美一区二区| 日本不卡一区二区| 成人午夜av在线| 91欧美一区二区| 欧美影视一区二区三区| 在线视频一区二区三区| 日韩视频一区在线观看| 久久久欧美精品sm网站| 国产精品网站在线播放| 亚洲色图另类专区| 亚洲电影中文字幕在线观看| 国产在线视频一区二区三区| 国产成人精品网址| 91在线免费播放| 欧美日本免费一区二区三区| 欧美mv日韩mv| 国产精品久久三| 性久久久久久久久久久久| 激情国产一区二区| 国产高清亚洲一区| 5月丁香婷婷综合| 久久久蜜臀国产一区二区| 日韩理论电影院| 美女视频黄久久| 色综合久久99| 精品少妇一区二区三区| 中文字幕一区二区视频| 日韩一区精品字幕| 成人福利视频在线| www.亚洲人| 日韩一区二区三区免费观看| 国产欧美视频一区二区| 亚洲成人一二三| 免费成人在线观看| 欧美日韩三级一区| 久久久www成人免费毛片麻豆| 亚洲影视资源网| 国产91综合网| 久久久亚洲国产美女国产盗摄 | 中文字幕免费在线观看视频一区| 亚洲韩国精品一区| 成人一区二区三区中文字幕| 在线不卡a资源高清| 亚洲自拍偷拍图区| 成人午夜视频网站| 欧美一区二区三区视频免费播放| xfplay精品久久| 美洲天堂一区二卡三卡四卡视频| 91啪亚洲精品| 中文字幕欧美区| 久久精品99国产精品| 在线成人av网站| 亚洲影院在线观看| 91小视频在线| 国产三级一区二区三区| 国产精品一区二区三区99| 337p亚洲精品色噜噜噜| 一区二区三区在线看| eeuss鲁一区二区三区| 成人免费在线视频观看| 国产高清视频一区| 久久蜜臀精品av| 香港成人在线视频| 欧美一区二区三区啪啪| 亚洲成人黄色小说|