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

📄 lineimage.cpp

📁 M16C Flash Starter Software Ver.2.0.0.46 Source Files.zip是瑞萨的M16C系列单片机的flash烧写程序。
💻 CPP
字号:
// LineImage.cpp: the implementation of the CLineImage 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 "LineImage.h"

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

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

/////////////// The initializarion of the static variable ////////////////////////

BYTE CLineImage::s_byteBody[PAGE_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
										  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
										  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
										  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
										  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
										  0, 0, 0, 0, 0, 0};
										  
//////////////////////////////////////////////////////////////////////

CLineImage::CLineImage()
{

}

CLineImage::~CLineImage()
{

}

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

	//The contents of a line are set up.
BOOL CLineImage::SetBody(BYTE* byteBody, int nAddress, int nLength)
{
	BOOL bResult = TRUE;

	int nIndex = nAddress % PAGE_SIZE;
	for(int nStrIndex = 0; nLength > nStrIndex; nIndex++, nStrIndex++)
	{
		m_byteBody[nIndex] = byteBody[nStrIndex];
	}

	return bResult;
}

//I report the contents of a line.
void CLineImage::GetBody(BYTE* byteBody)
{
	for(int nIndex = 0; PAGE_SIZE > nIndex; nIndex++)
	{
		byteBody[nIndex] = m_byteBody[nIndex];
	}
}

	//It does a page the clear.  
void CLineImage::ClearPage(void)
{
	for(int nIndex = 0; PAGE_SIZE > nIndex; nIndex++)
	{
		m_byteBody[nIndex] = 0xff;
	}
}

		 //The data of the previous time causes to be returned.  
void CLineImage::BackData(void)
{
	for(int nIndex = 0; nIndex < PAGE_SIZE; nIndex++)
	{
		m_byteBody[nIndex] = s_byteBody[nIndex];
	}
}

		 //I preserve data.  
void CLineImage::KeepData(void)
{
	for(int nIndex = 0; nIndex < PAGE_SIZE; nIndex++)
	{
		s_byteBody[nIndex] = m_byteBody[nIndex];
	}
}

⌨️ 快捷键说明

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