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

📄 statesdlg.cpp

📁 M16C Flash Starter Software Ver.2.0.0.46 Source Files.zip是瑞萨的M16C系列单片机的flash烧写程序。
💻 CPP
字号:
// StatesDlg.cpp : Implementation.
//
// This software can be offered for free and used as necessary to aid 
// in your program developments.
//
// RENESAS TECHNOLOGY CORPORATION, RENESAS SOLUTIONS CORPORATION,
// and related original software developers assume no responsibility 
// for any damage or infringement of any third-party's rights, originating 
// in the use of the following software.
// Please use this software under the agreement and acceptance of these conditions. 
//
// Copyright(C)1998(2003) RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION
// ALL RIGHTS RESERVED
//

#include "stdafx.h"
#include "M16Cflsh.h"
#include "StatesDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CStatesDlg dialog


CStatesDlg::CStatesDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CStatesDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CStatesDlg)
	m_strAfterBlock = _T("");
	m_strMacineStates = _T("");
	m_strProgram = _T("");
	m_strErase = _T("");
	m_strCheckSum = _T("");
	m_strIDCheck = _T("");
	m_strTimeout = _T("");
	m_strDataNum = _T("");
	//}}AFX_DATA_INIT
}


void CStatesDlg::DoDataExchange(CDataExchange* pDX)
{

	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CStatesDlg)
	DDX_Text(pDX, IDC_EDIT_AFTER_BLOCK, m_strAfterBlock);
	DDX_Text(pDX, IDC_EDIT_MACINE_STATES, m_strMacineStates);
	DDX_Text(pDX, IDC_EDIT_PROGRAM, m_strProgram);
	DDX_Text(pDX, IDC_EDIT_ERASE, m_strErase);
	DDX_Text(pDX, IDC_EDIT_CHECKSUM, m_strCheckSum);
	DDX_Text(pDX, IDC_EDIT_IDCHECK, m_strIDCheck);
	DDX_Text(pDX, IDC_EDIT_TIMEOUT, m_strTimeout);
	DDX_Text(pDX, IDC_EDIT_DATA_NUM, m_strDataNum);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CStatesDlg, CDialog)
	//{{AFX_MSG_MAP(CStatesDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////

	// Set Status.
void CStatesDlg::SetStates(BYTE btSRD, BYTE btSRD1)
{
	// SRD
	BOOL bWSM = 1 & (btSRD >> 7);
	m_strMacineStates = (bWSM) ? "Ready" : "Busy";
	BOOL bStateErase = 1 & (btSRD >> 5);
	m_strErase = (bStateErase) ? "Error" : "Right";
	BOOL bStateProgram = 1 & (btSRD >> 4);
	m_strProgram = (bStateProgram) ? "Error" : "Right";
	BOOL bStateAftProg = 1 & (btSRD >> 3);
	m_strAfterBlock = (bStateAftProg) ? "Error" : "Right";

	// SRD1
	BOOL bStateChkSum = 1 & (btSRD1 >> 4);
	m_strCheckSum = (bStateChkSum) ? "Match" : "Not match";
	int nStateID = 3 & (btSRD1 >> 2);
	if(0 == nStateID)
	{
		m_strIDCheck = "Not yet";
	}
	else if(1 == nStateID)
	{
		m_strIDCheck = "Not match";
	}
	else if(3 == nStateID)
	{
		m_strIDCheck = "Match";
	}
	BOOL bStateTimeOut = 1 & (btSRD1 >> 1);
	m_strTimeout = (bStateTimeOut) ? "Timeout" : "Right";
	BOOL bStateNumOver = 1 & btSRD1;
	m_strDataNum = (bStateNumOver) ? "Over" : "Right";
}

/////////////////////////////////////////////////////////////////////////////
// CStatesDlg message handler.

⌨️ 快捷键说明

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