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

📄 vdcoffcmd.cpp

📁 m16c flash startor 源码
💻 CPP
字号:
// VdcoffCmd.cpp: the implementation of the CVdcoffCmd class   
//
// 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 "VdcoffCmd.h"
#include "SaveIni.h"

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

//////////////////////////////////////////////////////////////////////
//Construction/disappearance   
//////////////////////////////////////////////////////////////////////

CVdcoffCmd::CVdcoffCmd()
{

}

CVdcoffCmd::~CVdcoffCmd()
{

}

//////////////////////////////////////////////////////////////////////
//It is Vdcoff command implementation.
BOOL CVdcoffCmd::exec(void)
{
	BOOL	bResult = FALSE;
	BYTE	send[2];
 
	//I acquire the communication object.  
	CSerialComm& comObj = GetSerialComm();

	send[0] = 0xf8;
	send[1] = 0xd0;
	bResult = comObj.Write(send, 2);

	//I wait until next it becomes a transmission passable.
	Sleep(SLEEP_IN);

	//I check status.
	// Get result.
	send[0] = 0x70;
	BYTE btSRD[2];
	comObj.Write(&send, 1);
	if(!comObj.Read(btSRD, 2))
	{
		CommError();
		return FALSE;
	}

	if(!(1 & (btSRD[1] >> 0)))
	{
		AfxGetMainWnd()->MessageBox(GetResString(IDS_VDC_OFF_NG), GetResString(IDS_FLASH_TITLE), MB_ICONERROR);
	}
	else
	{
		AfxGetMainWnd()->MessageBox(GetResString(IDS_VDC_OFF_OK), GetResString(IDS_FLASH_TITLE), MB_ICONINFORMATION);
	}





	return	bResult;
}







⌨️ 快捷键说明

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