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

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

?? dnw.cpp

?? samsung arm開發調試工具,通過usb或串口下載程序到目標板
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
#define STRICT
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <tchar.h>
#include <string.h>
#include <process.h>
#include <stdlib.h>

#include "resource.h"

#include "def.h"
#include "dnw.h"
#include "engine.h"
#include "fileopen.h"
#include "d_box.h"
#include "usbtxrx.h"

//NOTE: _beginthread() 
// To use _beginenthread(),Activate "Project/Settings/C/C++/Categry/Code generation/
// Use Run-Time library/Multithreaded or Debug Multithreaded"


/*
===================== REVISON HISTORY =====================
1. 2000. 3.30: V0.01 
  First release of DNW
2. 2000.10.11: V0.2
  The edit control is used for scroll, copy&paste, smooth screen update
3. 2001.1.26: V0.3
  a) The CPU usage will be less. Sleep() is inserted during TX.
  b) The filesize and checksum are transmitted together with bin file.
  c) WriteCommBlock() bug is fixed. The txEmpty flag should be changed in only DoRxTx().
4. 2001.2.24: V0.31
  a) The size of edit buffer is changed by EM_LIMITTEXT message.
     EDIT_BUF_SIZE(30000) -> MAX_EDIT_BUF_SIZE(65000)
  b) If the edit box is greater than 50000,
     the size of edit box is reduced by 10000.
  c) The horizontal scroll bar is removed for better look. 
  d) In WaitCommEvent() loop, 
     the following condition is inserted to clear the overrun condition.
    	if((dwEvtMask & EV_ERR){...}
  e) EB_Printf() have some error to process large string data.
5. 2001.3.8: V0.32
  a) EDIT_BUF_SIZE is reduced 25000 because the EM_REPLACESEL message is done very slowly
     if the size is over about 30000.
6. 2001.4.11: V0.32A
  a) Experimentally, MAX_EDIT_BUF_SIZE is set to the default value(32767). 
     //SendMessage(_hwndEdit, EM_SETLIMITTEXT, MAX_EDIT_BUF_SIZE, 0L);
     RESULT: MAX_EDIT_BUF_SIZE doesn't affect the display delay problem.
             I think that the new method for deleting the contents should be applied
	     Let's do tonight
7. 2001.5.14: V0.34
   a) I have known that the edit control isn't adequate for console program.
      So, I would give up the development of DNW using the edit control
      The last decision is as follows;
      MAX_EDIT_BUF_SIZE (65000) //up to 65535
      EDIT_BUF_SIZE (30000)   
      EDIT_BUF_DEC_SIZE (10000)
   b) If the selected text is deleted, the edit control displays the first of the text.
      In this case, to show the end of the text, dummy REPLACE_SEL is added.

8. 2001.11.23: V0.4
   a) USB download function is added.
   b) GetOverlappedResult() is used in TxFile() in order to save the cpu time more efficiently 
   c) Serial Configuration dialog box
   d) In secbulk.sys is changed to support IRP_MN_QUERY_CAPABILITIES.
      So, the surpriseRemoval is allowed. When the USB is yanked impolitely, 
      the warning dialog box won't appear in WIN2000.

9. 2001.11.24: v0.41alpha
   a) WriteFile() supports overlapped I/O to check broken pipe.
   b) progress bar is added for transmit operation.
   c) USB,serial status is printed on the window title bar
   
10. 2001.12.5: v0.42a
   a) In secbulk.sys, the maximum number of bulk packit in 1ms frame duration is changed to 16 from 4.
      So, transfer rate is increased from 220KB/S to 405KB/S 
   b) Although the fileopen was failed(or canceled), the transmit wasn't canceled. This is fixed.      
   c) When the options menu is selected, a serial port will be reconnected.
   d) The receive test menu is added. 

11. 2001.12.6: v0.43
   a) Fou USB tx operation, TX_SIZE is increased from 2KB to 16KB.
      So, transfer rate is increased from 405KB/S to 490KB/S.
      (2KB:405KB/S 4KB:450KB/S  8KB:470KB/S 16KB:490KB/S)

12. 2001.12.7: v0.44b
   a) Although a serial port is not connected, the serial port is connected 
      after Configuration/Options menu -> fixed.
   b) The name dnw.cfg for v 0.4x is changed to dnw.ini 
      in order not to confuse old dnw.cfg for ver 0.3x
      
12. 2002.01.2: v0.44c
   a) The edit box size is changed to display 80x25 characters 
      
13. 2002.02.22: v0.45
   a) In windows95, DNW doesn't search USB stack.
   b) When download, there should be a cancel button
   c) Sometimes, the progress bar is not filled although download is doing.
      I think it's because InitDownloadProgress() is executed 
      before than DownloadProgressProc().
      So, I inserted the code to wait until DownloadProgressProc() is executed as follows;
	  while(_hDlgDownloadProgress==0); //wait until the progress dialog box is ready.
   d) secbulk is optimized 
14. 2002.04.01: v0.46
   a) If DNW is start to transmit although the b/d is not ready, DNW will be hung.
      It's only solution to turn off and on the b/d.
      To solve this problem smoothly, the overlapped I/O will be used for USB transfer. 
      But, secbulk.sys may not support overlapped I/O. 
      Although I implemented the overlapped I/O, WriteFile() function didn't return before its completion.
   b) Because the overlapped I/O doens't work as my wish,
      and in order to quit the dnw.exe hung, modaless dialogue box is used for the progress bar.
   c) *.nb0

  15. 2002.04.10: v0.47
   a) I reduce the edit box size as follows;  
	#define MAX_EDIT_BUF_SIZE (0x7FFE) 
	#define EDIT_BUF_SIZE (0x6000)   
	#define EDIT_BUF_DEC_SIZE (0x1000)
      There is no good cause about why I change. I want to just reduce the edit box size.
   b) Sometimes, when transmit, there is no transmit although the transmit progrss dialog box is shown.
      I think that it's because the _enthread() fails.
      To debug this problem, the _enthread result is checked.

  16. 2002.04.19: v0.48
   a) The bug of WIN2K WINAPI is found. ->It's not fixed perfectly.
      Please let me know of the solution to avoid the memory problem of SetWindowText() API.

      The SetWindowText()(also,WM_SETTEXT message) consumes 4KB system memory every times.
      I think there is some bug in SetWindowText API.
      In my case, because SetWindowText() is called every 1 seconds, 
      the system memory used by DNW.exe is increased by 4KB every 1 seconds.
      For emergency fix, SetWindowText() will be called only when its content is changed.
      
      NOTE. This memory problem is not memory leakage problem 
      because the memory is flushed when the window is shrinked.

  17. 2002.05.03:v0.49
   a) Sometimes, when transmit, there is no transmit although the transmit progrss dialog box is shown.
      I have found the cause.
      It's because _hDlgDownloadProgress.
      If the TxFile thread is executed first than WM_INITDIALOG message,
      while(_hDlgDownloadProgress==NULL); will not exited because _hDlgDownloadProgress 
      in CPU register will be checked. So, the volatile should have been used 
      because _hDlgDownloadProgress value is changed in another thread.
      The solution is as follows;
      volatile HWND _hDlgDownloadProgress=NULL;
   b) Sometimes, the CPU usage will be always 100% if dnw.exe is being executed.
      This is because of the just above problem.
      If the problem 17-a) is occurred, the TxFile will be an obsolete thread.
      while(_hDlgDownloadProgress==NULL); will use the CPU at 100%.
      I think that this problem may be cleared because the problem 17-a) is cleared.
   c) The small icon,DNW is displayed in the window shell task bar and the window title.
*/

/*   
Items to be enhanced.
   - avoid SetWindowText() API problem.
   - remove debug stuff in following functions.
         void InitDownloadProgress(void);   
	 void DisplayDownloadProgress(int percent);

   - make status bar.
   - malloc() uses too much memory for large file transfer.
   - Enlarge the scroll buffer -> the edit box is not adequate.
   - file logging function
   - Ctrl+C should be work as copy function.
  
*/ 

/*
Edit Box Note:
- Check if the edit box is scrolled to show the text being deleted
  when the selected text is deleted in Win2000. In windows98, It's scrolled unfortunately.
*/


int userBaudRate,idBaudRate;
int userComPort;

#define MAX_BLOCK_SIZE (4096)

HANDLE idComDev;
OVERLAPPED osWrite,osRead;
volatile int isConnected=FALSE;
TCHAR rxBuf[MAX_BLOCK_SIZE+1];
volatile char *txBuf;
volatile DWORD iTxBuf;
DWORD txBufSize;

volatile int txEmpty=TRUE;



void MenuAbout(HWND hwnd)
{
    MessageBox(hwnd,TEXT("Serial Console with Serial/USB Download\n\n")
		    TEXT("1. e-mail: purnnamu@sec.samsung.com\n")
	  	    TEXT("2. USB Tx format: addr(4)+size(4)+data(n)+cs(2)   \n")
		    TEXT("3. Serial Tx format: size(4)+data(n)+cs(2)\n"),
	   	    TEXT("About ")APPNAME,MB_OK | MB_ICONINFORMATION );
}





void Quit(HWND hwnd)
{
    CloseComPort();
}



void MenuConnect(HWND hwnd)
{
    if(isConnected==TRUE)
    {
	CloseComPort();
    }

    OpenComPort(userComPort);
}



void UpdateWindowTitle(void)
{
    TCHAR title[256];
    TCHAR tch[16];
    
    static int prevComPort=0xff;
    static int prevBaudRate=0xff;
    static int prevUsbAlive=0xff;
    static int prevIsConnected=0xff;
    int usbAlive;

    lstrcpy(title,APPNAME);
    lstrcat(title,TEXT("   [COM"));

    if(isConnected==TRUE) //serial O.K.
    {
	tch[0]='0'+userComPort;
	tch[1]='\0';
	lstrcat(title,tch);
	lstrcat(title,TEXT(","));
	lstrcat(title,_itot(userBaudRate,tch,10) );   //_itot :TCHAR version of itoa 
	lstrcat(title,TEXT("bps]"));
    }
    else
    {
	lstrcat(title,TEXT(":x]"));
    }

    
    if(IsUsbConnected())
    {
	lstrcat(title,TEXT("[USB:OK]"));
	usbAlive=1;
    }
    else
    {
	lstrcat(title,TEXT("[USB:x]"));
	usbAlive=0;
    }

    //The bug of WIN2K WINAPI is found.
    //The SetWindowText()(also,WM_SETTEXT message) consumes 4KB system memory every times.
    //I think there is some bug in SetWindowText API.
    //In my case, because SetWindowText() is called every 1 seconds, 
    //the system memory used by DNW.exe is increased by 4KB every 1 seconds.
    //For emergency fix, SetWindowText will called only when its content is changed.
    //NOTE. This memory leakage is flushed when window is shrinked.

    if(userComPort!=prevComPort || userBaudRate!=prevBaudRate || usbAlive!=prevUsbAlive ||
       isConnected!=prevIsConnected )
    {
	SetWindowText(_hwnd,title);
    }
    prevComPort=userComPort;
    prevBaudRate=userBaudRate;
    prevUsbAlive=usbAlive;
    prevIsConnected=isConnected;
}



void MenuTransmit(HWND hwnd)
{
    HANDLE hFile;
    DWORD fileSize;
    unsigned short cs=0;
    DWORD i;
    BOOL result;
    unsigned long threadResult;

    if(!isConnected)
    {
	EB_Printf(TEXT("[ERROR:Not Connected]\n"));
	return;
    }
    result=PopFileOpenDlg(hwnd,szFileName,szTitleName);
    
    if(result==0) //file open fail
    {
	return;
    }

    hFile=CreateFile(szFileName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);

    if(hFile==INVALID_HANDLE_VALUE)
    {
	EB_Printf(TEXT("[ERROR:File Open]\n") );
	return;
    }
    
    fileSize=GetFileSize(hFile,NULL);

    txBuf=(char *)malloc(fileSize+6);
    if(txBuf==0)
    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区欧美二区| 一区二区三区在线观看国产| 欧美国产日本视频| 日韩电影在线免费看| 不卡视频一二三| 日韩美女在线视频| 亚洲成人免费视频| 97成人超碰视| 欧美国产1区2区| 免费成人美女在线观看| 欧美午夜电影网| 亚洲天堂久久久久久久| 国产美女一区二区三区| 欧美哺乳videos| 偷拍日韩校园综合在线| 色老头久久综合| 亚洲免费在线视频| www.亚洲免费av| 中文字幕av一区二区三区免费看| 精品一区二区在线播放| 欧美一区二区啪啪| 日韩黄色一级片| 91麻豆精品国产91久久久使用方法 | 久久国产精品第一页| 91久久奴性调教| 国产精品成人免费在线| 成人免费av网站| 亚洲天堂福利av| 色综合久久久网| 亚洲女同女同女同女同女同69| 成人av在线影院| 国产精品久久久久aaaa| 成人黄色777网| 一区二区国产盗摄色噜噜| 欧美性感一类影片在线播放| 丝袜国产日韩另类美女| 日韩亚洲欧美高清| 精品中文av资源站在线观看| 日韩欧美高清一区| 国模套图日韩精品一区二区| 久久久亚洲精品石原莉奈| 成人午夜免费av| 亚洲色图20p| 欧美精品在线视频| 久久99热99| 国产精品水嫩水嫩| 日本乱人伦一区| 美腿丝袜亚洲综合| 久久久久综合网| 91麻豆福利精品推荐| 亚洲va韩国va欧美va精品 | 蜜桃久久精品一区二区| 欧美大片在线观看| 粉嫩一区二区三区性色av| 亚洲女同一区二区| 日韩亚洲国产中文字幕欧美| 国产精品18久久久久| 国产精品伦理在线| 欧美乱妇15p| 成人不卡免费av| 亚洲影院在线观看| 亚洲精品一线二线三线| 日本韩国欧美三级| 极品美女销魂一区二区三区免费| 中文子幕无线码一区tr| 欧美日韩一区二区三区免费看| 精品在线观看视频| 亚洲黄色录像片| 26uuu欧美| 欧美日韩国产成人在线91| 国产福利91精品| 三级成人在线视频| 成人免费一区二区三区视频 | 中文字幕欧美三区| 正在播放亚洲一区| 色8久久人人97超碰香蕉987| 国产一区美女在线| 婷婷丁香激情综合| 日韩美女视频一区二区 | 国产精品一区二区三区99| 艳妇臀荡乳欲伦亚洲一区| 久久美女高清视频| 7777精品伊人久久久大香线蕉的| 国产91在线|亚洲| 美女视频第一区二区三区免费观看网站| 欧美国产精品中文字幕| 日韩一级片在线播放| 在线亚洲一区观看| 不卡电影一区二区三区| 国内偷窥港台综合视频在线播放| 无码av免费一区二区三区试看| 国产精品的网站| 国产日韩亚洲欧美综合| 久久综合资源网| 欧美一区二区三区日韩视频| 色视频一区二区| 色综合激情五月| 95精品视频在线| k8久久久一区二区三区| 国产ts人妖一区二区| 国内精品写真在线观看| 麻豆视频一区二区| 久久国产生活片100| 青椒成人免费视频| 麻豆视频一区二区| 久久国产乱子精品免费女| 午夜欧美电影在线观看| 日日骚欧美日韩| 奇米综合一区二区三区精品视频| 亚洲成av人片在线| 天堂久久一区二区三区| 日日夜夜免费精品| 麻豆一区二区99久久久久| 美国十次综合导航| 国产一区三区三区| 国产99精品国产| 成人av免费在线| 91浏览器打开| 日本精品一级二级| 51精品秘密在线观看| 日韩一区二区影院| 久久在线观看免费| 中文字幕一区二区不卡| 一区二区三区小说| 亚洲国产欧美在线人成| 午夜电影网亚洲视频| 麻豆91小视频| 国产91精品在线观看| 91免费看片在线观看| 精品视频资源站| 日韩欧美卡一卡二| 欧美激情综合五月色丁香| 亚洲精品国产第一综合99久久 | 2021久久国产精品不只是精品| 国产亚洲一区二区三区在线观看| 国产色综合久久| 亚洲男人的天堂一区二区| 秋霞国产午夜精品免费视频| 国产精品18久久久久久vr| 在线视频一区二区免费| 欧美一区二区在线免费观看| 亚洲精品在线免费观看视频| 自拍视频在线观看一区二区| 天堂av在线一区| 丰满少妇在线播放bd日韩电影| 欧美午夜电影网| 国产亚洲人成网站| 亚洲黄色片在线观看| 国产一区二区三区四区五区美女| 99精品国产热久久91蜜凸| 7777精品伊人久久久大香线蕉超级流畅 | 国产日韩欧美一区二区三区乱码| 中文字幕一区二区三区乱码在线 | 国产日韩欧美综合一区| 图片区小说区国产精品视频| 国产成人免费在线观看不卡| 欧美日韩视频在线一区二区| 久久综合久久综合亚洲| 亚洲综合在线第一页| 国产一区二区毛片| 91精品免费观看| 亚洲男同1069视频| 国产河南妇女毛片精品久久久| 欧美日韩一区二区三区四区| 国产精品久久久久久久久快鸭| 免费在线观看一区| 欧美日韩免费视频| 亚洲视频一区二区在线| 精品中文字幕一区二区小辣椒 | 国产精品久久久久一区二区三区| 天堂久久久久va久久久久| 91女人视频在线观看| 久久久99久久| 狠狠狠色丁香婷婷综合激情| 制服丝袜日韩国产| 一区二区在线观看不卡| 成人高清免费在线播放| 精品三级在线看| 免费在线观看视频一区| 欧美精品tushy高清| 亚洲综合激情小说| av激情成人网| 国产精品天干天干在观线| 国产很黄免费观看久久| 久久网这里都是精品| 久久99国产精品尤物| 日韩精品在线网站| 日本不卡一区二区三区高清视频| 欧美优质美女网站| 亚洲综合清纯丝袜自拍| 欧美伊人久久久久久午夜久久久久| 国产精品国产三级国产有无不卡| 国产寡妇亲子伦一区二区| 久久一夜天堂av一区二区三区 | 精品国产一区二区三区不卡| 丝袜美腿亚洲一区| 日韩视频在线一区二区| 免费美女久久99| 欧美videofree性高清杂交| 麻豆精品一二三|