⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flashupgraderdlg.h

📁 PW芯片方案Flash ROM烧写程序
💻 H
字号:
//---------------------------------------------------------------------------
// Pixelworks Inc. Company Confidential Strictly Private
//
// $Archive: $
// $Revision: 1.2 $
// $Author: PIX_NT\dennisd $
// $Date: 2006/01/03 21:07:01 $
//
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------------
// Copyright 1997-2003 (c) Pixelworks Inc.
//
// Pixelworks owns the sole copyright to this software. Under international 
// copyright laws you (1) may not make a copy of this software except for 
// the purposes of maintaining a single archive copy, (2) may not derive
// works herefrom, (3) may not distribute this work to others. These rights 
// are provided for information clarification, other restrictions of rights 
// may apply as well.
//
// This is an unpublished work.
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>>>>> WARRANTEE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------------
// Pixelworks Inc. MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THE USE OF
// THIS SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
// PURPOSE.
// --------------------------------------------------------------------------
//
// FlashUpgraderDlg.h : header file
//

#if !defined(AFX_FLASHUPGRADERDLG_H__F6106393_0B74_4120_A9B4_0111D86A0F0D__INCLUDED_)
#define AFX_FLASHUPGRADERDLG_H__F6106393_0B74_4120_A9B4_0111D86A0F0D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

typedef const char *	ccp;

#include "SXButton.h"

#define DOWNLOAD_COMPLETED_MESSAGE    (WM_USER + 0x101)

class CFlashUpgraderDlgAutoProxy;


/////////////////////////////////////////////////////////////////////////////
// CFlashUpgraderDlg dialog

class CFlashUpgraderDlg : public CDialog
{
	DECLARE_DYNAMIC(CFlashUpgraderDlg);
	friend class CFlashUpgraderDlgAutoProxy;

// Construction
public:
	void UpdateIcons();
	void UpdateControls();
	void SetStatus(int nId);
	BOOL AnythingToDownload();
	CHexFileData* GetHexFileData(CString strFile);
	BOOL FileExists(CString strPathName);
	void GetInitialSwitches();
	BOOL GetInitialInfFile(CString& strDest, CString& strFile);
	void GetInitialBaudRate();
	void GetInitialComPort();
	void GetInitialConnection();
	void DownloadFileCompleted();
	static void CallbackProc(eFLASHSTATUS eStatus, DWORD dwParam  = 0 );
	BOOL GetFirmwareFileItem(int nFileNum, PFILE_ITEM pFileItem);
	BOOL DownloadNextFile();
	void DisplayErrorMsg(LPCSTR pstrMsg  = NULL);
	CComPortCmd* GetComPortCmdPtr();
	BOOL CreateComPort();
	BOOL ValidateInfFile();
	BOOL CheckIfFileExist(LPCSTR lpszFilePath, BOOL bMessage = TRUE);
	BOOL ValidateROMFiles();
	void DisableControls(BOOL bDisable);
	void AddBitmap(int nIDC, CImageList *pList, COLORREF cr);
	void LoadRegionList();
	int GetHexField(CString strLine, int nStart, int nLength);
	void DeleteHexFileData();
	BOOL GatherHexFileRegions(CString strPath, CString strHexFile, BOOL bExecute, BOOL bVerify);
	CFlashUpgraderDlg(CWnd* pParent = NULL);	// standard constructor
	virtual ~CFlashUpgraderDlg();
	int GetServerList();

// Dialog Data
	//{{AFX_DATA(CFlashUpgraderDlg)
	enum { IDD = IDD_FLASHUPGRADER_DIALOG };
	CButton	m_butReset;
	CButton	m_butNotify;
	CSXButton	m_butLogo;
	CStatic	m_bmLogo;
	CEdit	m_editResetTime;
	CProgressCtrl	m_ctrlProgress;
	CButton	m_butHelp;
	CButton	m_butClose;
	CButton	m_chkContinuous;
	CButton	m_butBrowse;
	CButton	m_butFlash;
	CListCtrl	m_listRegions;
	CComboBox	m_cmbInfFile;
	CComboBox	m_cmbConnection;
	CComboBox	m_cmbComPort;
	CComboBox	m_cmbBaudRate;
	BOOL	m_bContinuous;
	CString	m_strComPort;
	CString	m_strConnection;
	CString	m_strInfFile;
	CString	m_strFileName;
	CString	m_strBaudRate;
	UINT	m_nResetTime;
	CString	m_strBytes;
	CString	m_strPercent;
	CString	m_strStatus;
	BOOL	m_bNotify;
	BOOL	m_bResetAfterLastFileLoaded;
	CString	m_strDirectory;
	int		m_nFlashMode;
	BOOL	m_chkBinary;
	//}}AFX_DATA

	BOOL	m_bVerifyOnly;
	BOOL	m_bEraseOnly;

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFlashUpgraderDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void DeleteButton();
	CFlashUpgraderDlgAutoProxy* m_pAutoProxy;
	HICON m_hIcon;

	BOOL CanExit();
	void SetFlashText();

	// Generated message map functions
	//{{AFX_MSG(CFlashUpgraderDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClose();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnSelchangeCmbConnection();
	afx_msg void OnButBrowse();
	afx_msg void OnButFlash();
	afx_msg void OnSelchangeCmbInffile();
	afx_msg void OnCmdEnterKey();
	afx_msg void OnButClose();
	afx_msg void OnKillfocusCmbInffile();
	afx_msg void OnColumnclickListRegions(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg long OnDownloadCompletedMessage(UINT wParam, LONG lParam);
	afx_msg void OnChkContinuous();
	afx_msg void OnDblclkListRegions(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnClickListRegions(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclickListRegions(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnChkNotify();
	afx_msg void OnChkReset();
	afx_msg void OnRadioMode();
	afx_msg void OnRadioErase();
	afx_msg void OnRadioVerify();
	afx_msg void OnChkBinary();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	afx_msg long OnComPortMessage(UINT wParam, LONG lParam);

private:
	BOOL BeginDownloadingFirmware();
	BOOL BeginFlashProcess();
	BOOL ProcessInfFile();

	// dennisd - auto flash
	BOOL ProcessResetInfFile(CString szChip);

	void CaptureToImage();

	// Functions
	int				GatherInfFiles(CString strPath, CString strFile="");
	void			EnableSerialControls(BOOL bEnable=TRUE);

	//
	// Data
	//

	// A list of all other instances of FlashUpgrader running
	CStringList		m_Servers;

	// TRUE if this is the first instance of FlashUpgrader.
	BOOL			m_bFirstInstance;

	// A list of the hex files to be flashed from the currently
	// selected INF file.
	CPtrList		m_HexFiles;

	CImageList		m_ImageList;

	BOOL			m_bConflicts;

	BOOL			m_bFirstTime;

	BOOL			m_bGoMode;

    BOOL            m_bExitWhenDone;
	
	//dennisd - auto reset parameters
	BOOL			m_bNoReset;
	int				g_iResetDelay1;
	int				g_iResetWatchDogAddr;
	int				g_iResetWatchDogData;
	int				g_iResetDelay2;
	int				g_iResetAddr; 
	int				g_iResetData;


	// TRUE when flashing is in progress...
	BOOL			m_bFlashingInProgress;

	CComPortCmd	   *m_pComPort;

	int				m_nBaudRate;
	int				m_nComPort;

	static CFlashUpgraderDlg *m_pThis;

	CHexFileData   *m_pCurHexFile;

	// From Old Browse Page...
	CArray<FILE_ITEM, FILE_ITEM&>   m_FlashItemArray;
    BYTE                            m_cFlashFlags;
    //BOOL                            m_bResetAfterLastFileLoaded;	
	CInfFile						m_InfFile;

	// From Old FlashPage
	ePAGESTATE          m_eState;
    int                 m_nCurrentFileNum;
    FILE_ITEM           m_fileItem;
    int                 m_nTotalSize;
    int                 m_nTransferedSize;
    BOOL                m_bCancel;
    CFlashHelper        m_FlashHelper;
    CSafe               m_Safe;
	BOOL                m_bBrowsed;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_FLASHUPGRADERDLG_H__F6106393_0B74_4120_A9B4_0111D86A0F0D__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -