当前位置: 首页>>代码示例>>C++>>正文


C++ MemoryManager::getMemoryArea方法代码示例

本文整理汇总了C++中MemoryManager::getMemoryArea方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryManager::getMemoryArea方法的具体用法?C++ MemoryManager::getMemoryArea怎么用?C++ MemoryManager::getMemoryArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemoryManager的用法示例。


在下文中一共展示了MemoryManager::getMemoryArea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: configure

void CycleCounter::configure()
{
	if (emulationLevel >= EMEX_EXTRA_SMALL_5XX)
	{
		MemoryManager* mm = deviceHandle->getMemoryManager();
		EemMemoryAccess* ema = (EemMemoryAccess*)mm->getMemoryArea("EEM");

		cycleCounterControl = defaultMode;
		ema->writeEemRegister(CCNT0CTL, cycleCounterControl) && ema->sync();
	}
}
开发者ID:AlessonDavid,项目名称:libMSP430,代码行数:11,代码来源:CycleCounter.cpp

示例2: read

uint64_t CycleCounter::read()
{
	if (emulationLevel >= EMEX_EXTRA_SMALL_5XX)
	{ 
		MemoryManager* mm = deviceHandle->getMemoryManager();
		EemMemoryAccess* ema = (EemMemoryAccess*)mm->getMemoryArea("EEM");

		union CycleCount { struct { uint32_t low, high; }; uint64_t value; };
		CycleCount cycleCount;

		ema->readEemRegister(CCNT0L, &cycleCount.low) && ema->sync();
		ema->readEemRegister(CCNT0H, &cycleCount.high) && ema->sync();
		
		counterValue = 0;

		uint32_t factor = 1;
		uint32_t lsfr2hex[16] = {0x0, 0x1, 0x2, 0x7, 0x5, 0x3, 0x8, 0xb, 0xe, 0x6, 0x4, 0xa, 0xd, 0x9, 0xc, 0};
		for (int i = 0; i < 10; ++i)
		{
			counterValue += factor * lsfr2hex[(cycleCount.value & 0xf)];
			cycleCount.value >>= 4;
			factor *= 15;
		}	
	}
开发者ID:AlessonDavid,项目名称:libMSP430,代码行数:24,代码来源:CycleCounter.cpp

示例3: HalExecElement

bool DebugManagerV3::run (uint16_t controlMask, DebugEventTarget * cb, bool releaseJtag)
{
	MemoryManager* mm = this->parent->getMemoryManager();
	MemoryArea* cpu = mm->getMemoryArea("CPU"); 
	if (!cpu)
    {
		return false;
    }

	lpm5WakeupDetected = false;

	if(cb!=0)
	{
		cbx=cb;	
	}

	uint32_t pc, sr;
	cpu->read(0, &pc, 1);
	cpu->read(2, &sr, 1);

	if(mm->flushAll()==false)
	{
		return false;
	}
	
	cycleCounter_.reset();
	ConfigManager *cm = parent->getFetHandle()->getConfigManager();

	const uint16_t mdb = parent->getEmulationManager()->getSoftwareBreakpoints()->getSwbpManager()->getInstructionAt(pc);
	if (mdb != 0)
	{
		mdbPatchValue = mdb;
	}

	HalExecElement* el = new HalExecElement(this->parent->checkHalId(ID_RestoreContext_ReleaseJtag));
	this->parent->getWatchdogControl()->addParamsTo(el);
	el->appendInputData32(pc);
	el->appendInputData16(sr);
	el->appendInputData16(controlMask!=0? 0x0007: 0x0006);	// eem control bits 
	el->appendInputData16(mdbPatchValue);		// mdb
	el->appendInputData16(releaseJtag ? 1 : 0);
	el->appendInputData16(cm->ulpDebugEnabled() ? 1 : 0);

	mdbPatchValue = 0;

	HalExecCommand cmd;
	cmd.elements.push_back(el);

	if (!this->parent->send(cmd))
	{
		return false;
	}
	
	// handle lpmx5 polling
	if (releaseJtag)
	{
		pausePolling();
	}
	else
	{
		this->resumePolling();
	}	

	if (controlMask!=0 && !releaseJtag)
	{
		if (!activatePolling(controlMask))
		{
			return false;
		}
	}

	resetCycleCounterBeforeNextStep = true;

	return true;
}
开发者ID:robertinant,项目名称:MSPDebugStack_OS_Package,代码行数:75,代码来源:DebugManagerV3.cpp


注:本文中的MemoryManager::getMemoryArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。