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


C++ DEBUGSTR函数代码示例

本文整理汇总了C++中DEBUGSTR函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUGSTR函数的具体用法?C++ DEBUGSTR怎么用?C++ DEBUGSTR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: adcrom_config

/* Configure ADC ROM Driver and pripheral */
static int adcrom_config(void)
{
	ADC_CFG_T cfg = {
		ADC_SEQ_A_CONFIG,
		ADC_SEQ_B_CONFIG,
		ADC_CONFIG,
		0	/* Divider will be calculated during run time */
	};

	cfg.clkDiv = 0xFF;

	/* Configure the ADC */
	ROM_ADC_Configure(hADC, &cfg);

	/* Calibrate the ADC */
	if (ROM_ADC_Calibrate(hADC, Chip_Clock_GetSystemClockRate()) != LPC_OK) {
		DEBUGSTR("ERROR: Calibrating ADC\r\n");
		while (1) {}
	}
	DEBUGSTR("ADC Initialized and Calibrated successfully!\r\n");

	/* Channel configurations */
	ROM_ADC_ConfigureCh(hADC, 0, ADC_CH_THRES_DATA | ADC_CH_THRES_SEL1 | ADC_CH_THRES_CROSSING);
	ROM_ADC_ConfigureCh(hADC, 1, ADC_CH_THRES_DATA);

	return 0;
}
开发者ID:JamesHinnant,项目名称:osp,代码行数:28,代码来源:adc_int.c

示例2: IPC_initMsgQueue

/* Function to initialize the IPC message queue */
void IPC_initMsgQueue(void *data, int size, int count)
{
	struct ipc_queue *qrd;

	/* Sanity Check */
	if (!size || !count || !data) {
		DEBUGSTR("ERROR:IPC Queue size invalid parameters\r\n");
		while (1) {}
	}

	/* Check if size is a power of 2 */
	if (count & (count - 1)) {
		DEBUGSTR("ERROR:IPC Queue size not power of 2\r\n");
		while (1) {	/* BUG: Size must always be power of 2 */
		}
	}
	qrd   = &q_ipc[CPUID_CURR];
	memset(qrd, 0, sizeof(*qrd));
	qrd->count = count;
	qrd->size = size;
	qrd->data = data;
	qrd->valid = QUEUE_MAGIC_VALID;
	if (!IPC_EventHandler) {
		IPC_EventHandler = IPC_EventHandler_sa;
	}
}
开发者ID:dlang9159,项目名称:MCU_Test_MCore,代码行数:27,代码来源:ipc_msg.c

示例3: PMC_Get_Wakeup_option

/*****************************************************************************
 * Private functions
 ****************************************************************************/
static void PMC_Get_Wakeup_option(uint8_t *Wakeup_rtc)
{
	FlagStatus exitflag;
	uint8_t buffer = 0xFF;

	DEBUGSTR(menu1);

	exitflag = RESET;
	while (exitflag == RESET) {

		/* Get user input */
		buffer = DEBUGIN();

		if ((buffer == 'W') || (buffer == 'w')) {
			DEBUGSTR("WAKEUP0 pin selected \r\n");
			*Wakeup_rtc = 0;
			exitflag = SET;
		}

		if ((buffer == 'R') || (buffer == 'r')) {
			DEBUGSTR("RTC Alarm selected \r\n");
			*Wakeup_rtc = 1;
			exitflag = SET;
		}
	}
}
开发者ID:fcladera,项目名称:ciaa_lpcopen_bare,代码行数:29,代码来源:pmc_states.c

示例4: DoneHooksReg

void DoneHooksReg()
{
#ifdef HOOKS_USE_VIRT_REGISTRY
#ifdef _DEBUG
	//WARNING!!! OutputDebugString must NOT be used from ConEmuHk::DllMain(DLL_PROCESS_DETACH). See Issue 465
	DEBUGSTR(L"ConEmuHk: Deinitializing registry virtualization!\n");
#endif
	if (gpRegKeyHooks)
	{
		free(gpRegKeyHooks);
		gpRegKeyHooks = NULL;
	}
	CloseRootKeys();
	if (gpRegKeyStore)
	{
		gpRegKeyStore->Free();
		free(gpRegKeyStore);
		gpRegKeyStore = NULL;
	}
#ifdef _DEBUG
	//WARNING!!! OutputDebugString must NOT be used from ConEmuHk::DllMain(DLL_PROCESS_DETACH). See Issue 465
	DEBUGSTR(L"ConEmuHk: Registry virtualization deinitialized!\n");
#endif
#endif
}
开发者ID:EricSB,项目名称:ConEmu,代码行数:25,代码来源:RegHooks.cpp

示例5: TaperDegreesToDistance

/*
 *  FUNCTION: TaperDegreesToDistance
 *
 *  PARAMETERS:		p 	-- Pointer to Menu
 *
 *  USES GLOBALS:
 *
 *  DESCRIPTION:		Convert the full angle degrees to inch/foot of diameter.
 *
 *
 *  RETURNS: 
 *
 */
int8 
TaperDegreesToDistance(TMENU_DATA * p) {
	// Convert the included angle in degrees to inch/inch of diameter.
	p->Data.FloatValue = tan((p->Data.FloatValue)/2 * RADIANS_PER_DEGREE)*2;
	// Then check if metric measurements are wanted.
	if (p->Dependancy != (uint8)0) {	//
		DEBUGSTR("To Metric Var is dependant on %02X\n",p->Dependancy );
		// First get menu from FLASH into data structure
	  	memcpypgm2ram(
			(void *)&d, 
			(MEM_MODEL rom void *)&MenuData[p->Dependancy], 
 			sizeof(TMENU_DATA)
			);
		// Then test the flag.
		if (GetFlagVar(&d)) {	// If the metric flag is set convert the value to metric.
			DEBUGSTR("Convert to Metric\n");
			p->Data.FloatValue *= 25.4;	
			return('m');
		}
		else
			return('"');	
	}
	else
		return(' ');
}
开发者ID:speters,项目名称:ELS---Electronic-Leadscrew,代码行数:38,代码来源:MenuScript.c

示例6: Print_Val

/* Using printf might cause text section overflow */
static void Print_Val(const char *str, uint32_t val)
{
	char buf[9];
	int ret;
	buf[8] = 0;
	DEBUGSTR(str);
	ret = Hex2Str(buf, val);
	DEBUGSTR(&buf[8 - ret]);
	DEBUGSTR("\r\n");
}
开发者ID:Magicoe,项目名称:LPC820,代码行数:11,代码来源:main_spi_sm_int.c

示例7: InitHooksReg

bool InitHooksReg()
{
	bool lbRc = false;
#ifdef HOOKS_USE_VIRT_REGISTRY
	CESERVER_CONSOLE_MAPPING_HDR* pInfo = GetConMap();
	if (!pInfo || !(pInfo->isHookRegistry&1) || !*pInfo->sHiveFileName)
		return false;

	DEBUGSTR(L"ConEmuHk: Preparing for registry virtualization\n");

	HookItem HooksRegistry[] =
	{
		/* ************************ */
		{(void*)OnRegCloseKey,		"RegCloseKey",		advapi32},
		{(void*)OnRegCreateKeyA,	"RegCreateKeyA",	advapi32},
		{(void*)OnRegCreateKeyW,	"RegCreateKeyW",	advapi32},
		{(void*)OnRegCreateKeyExA,	"RegCreateKeyExA",	advapi32},
		{(void*)OnRegCreateKeyExW,	"RegCreateKeyExW",	advapi32},
		{(void*)OnRegOpenKeyA,		"RegOpenKeyA",		advapi32},
		{(void*)OnRegOpenKeyW,		"RegOpenKeyW",		advapi32},
		{(void*)OnRegOpenKeyExA,	"RegOpenKeyExA",	advapi32},
		{(void*)OnRegOpenKeyExW,	"RegOpenKeyExW",	advapi32},
		{(void*)OnRegDeleteKeyA,	"RegDeleteKeyA",	advapi32},
		{(void*)OnRegDeleteKeyW,	"RegDeleteKeyW",	advapi32},
		/* ************************ */
		{(void*)OnRegConnectRegistryA,	"RegConnectRegistryA",	advapi32},
		{(void*)OnRegConnectRegistryW,	"RegConnectRegistryW",	advapi32},
		/* ************************ */
		{0}
	};
	lbRc = (InitHooks(HooksRegistry) >= 0);

	if (lbRc)
	{
		PrepareHookedKeyList();
		DEBUGSTR(L"ConEmuHk: Registry virtualization prepared\n");
		// Если advapi32.dll уже загружена - можно сразу дернуть экспорты
		if (ghAdvapi32)
		{
			RegOpenKeyEx_f = (RegOpenKeyEx_t)GetProcAddress(ghAdvapi32, "RegOpenKeyExW");
			RegCreateKeyEx_f = (RegCreateKeyEx_t)GetProcAddress(ghAdvapi32, "RegCreateKeyExW");
			RegCloseKey_f = (RegCloseKey_t)GetProcAddress(ghAdvapi32, "RegCloseKey");
		}
	}
	else
	{
		DEBUGSTR(L"ConEmuHk: Registry virtualization failed!\n");
	}
	
#else
	lbRc = true;
#endif
	return lbRc;
}
开发者ID:EricSB,项目名称:ConEmu,代码行数:54,代码来源:RegHooks.cpp

示例8: main

 /**
 * @brief	Main entry point
 * @return	Nothing
 */
int main(void)
{
	SPIFIobj *obj = &spifi_obj;
	uint32_t spifi_clk_mhz;
	SPIFIopers opers;
	int ret;
	spifi_rom_init(spifi);
	
	/* Initialize the board & LEDs for error indication */
	Board_Init();
	
	/* Since this code runs from SPIFI no special initialization required here */
	prepare_write_data(data_buffer, sizeof(data_buffer));

	spifi_clk_mhz = Chip_Clock_GetRate(CLK_MX_SPIFI) / 1000000;
	
	/* Typical time tCS is 20 ns min, we give 200 ns to be on safer side */
	if (spifi_init(obj, spifi_clk_mhz / 5, S_RCVCLK | S_FULLCLK, spifi_clk_mhz)) {
		DEBUGSTR("Error initializing SPIFI interface!\r\n");
		Board_LED_Set(1, 1);
		goto end_prog;
	}
	
	/* Prepare the operations structure */
	memset(&opers, 0, sizeof(SPIFIopers));
	opers.dest = (char *) SPIFI_WRITE_SECTOR_OFFSET;
	opers.length = sizeof(data_buffer);
	/* opers.options = S_VERIFY_PROG; */
	
	/* NOTE: All interrupts must be disabled before calling program as
	 * any triggered interrupts might attempt to run a code from SPIFI area
	 */
	ret = spifi_program(obj, (char *) data_buffer, &opers);
	if (ret) {
		DEBUGOUT("Error 0x%x: Programming of data buffer to SPIFI Failed!\r\n", ret);
		Board_LED_Set(1, 1);
		goto end_prog;
	}
	DEBUGSTR("SPIFI Programming successful!\r\n");

	if (verify_spifi_data((uint8_t *) SPIFI_WRITE_SECTOR_ADDRESS, sizeof(data_buffer))) {
		DEBUGSTR("Error verifying the SPIFI data\r\n");
		Board_LED_Set(1, 1);
		goto end_prog;
	}
	Board_LED_Set(0, 1);
	DEBUGSTR("SPIFI Data verified!\r\n");

end_prog:
	while(1) {__WFI();}
}
开发者ID:edarring,项目名称:lpcopen,代码行数:55,代码来源:main.c

示例9: showTime

/* Show RTC time in UT format */
static void showTime(uint32_t rtcCount)
{
	struct tm currTime;

#ifdef USE_CASCTIME
	char tempBuff[256];
#endif

	ConvertRtcTime(rtcCount, &currTime);

#ifdef USE_CASCTIME
	DEBUGOUT(asctime_r(&currTime, tempBuff));

#else
	DEBUGOUT("Raw RTC tick value = %u\r\n", rtcCount);

	/* Todays date */
	DEBUGOUT("DATE: %02d:%02d:%04d\r\n", currTime.tm_mon + 1,
			 currTime.tm_mday, (currTime.tm_year + TM_YEAR_BASE));

	/* Current time */
	DEBUGOUT("TIME: %02d:%02d:%02d\r\n", currTime.tm_hour, currTime.tm_min, currTime.tm_sec);

	/* Day of week and year */
	DEBUGOUT("tm_wday = %01d, tm_yday = %03d\r\n", currTime.tm_wday,
			 currTime.tm_yday);
#endif

	DEBUGSTR("\r\n");
}
开发者ID:sensorplatforms,项目名称:osp,代码行数:31,代码来源:rtcut.c

示例10: main

/**
 * @brief	main routine for ADC example
 * @return	Function should not exit
 */
int main(void)
{
	uint16_t dataADC;
	int j;

	SystemCoreClockUpdate();
	Board_Init();
	Init_ADC_PinMux();
	DEBUGSTR("ADC Demo\r\n");

	/* ADC Init */
	Chip_ADC_Init(LPC_ADC, &ADCSetup);
	Chip_ADC_EnableChannel(LPC_ADC, ADC_CH0, ENABLE);

	while (1) {
		/* Start A/D conversion */
		Chip_ADC_SetStartMode(LPC_ADC, ADC_START_NOW, ADC_TRIGGERMODE_RISING);

		/* Waiting for A/D conversion complete */
		while (Chip_ADC_ReadStatus(LPC_ADC, ADC_CH0, ADC_DR_DONE_STAT) != SET) {}

		/* Read ADC value */
		Chip_ADC_ReadValue(LPC_ADC, ADC_CH0, &dataADC);

		/* Print ADC value */
		DEBUGOUT("ADC value is 0x%x\r\n", dataADC);

		/* Delay */
		j = 500000;
		while (j--) {}
	}

	/* Should not run to here */
	return 0;
}
开发者ID:Andriiy,项目名称:Circuit-Boards,代码行数:39,代码来源:adc_11xx.c

示例11: main

/**
 * @brief	MRT example main function
 * @return	Status (This function will not return)
 */
int main(void)
{
	int mrtch;

	/* Generic Initialization */
	SystemCoreClockUpdate();
	Board_Init();

	DEBUGSTR("LPC15xx MRT Example \r\n");

	/* MRT Initialization and disable all timers */
	Chip_MRT_Init();
	for (mrtch = 0; mrtch < MRT_CHANNELS_NUM; mrtch++) {
		Chip_MRT_SetDisabled(Chip_MRT_GetRegPtr(mrtch));
	}

	/* Enable the interrupt for the MRT */
	NVIC_EnableIRQ(MRT_IRQn);

	/* Enable timers 0 and 1 in repeat mode with different rates */
	setupMRT(0, MRT_MODE_REPEAT, 2);/* 2Hz rate */
	setupMRT(1, MRT_MODE_REPEAT, 5);/* 5Hz rate */

	/* Enable timer 2 in single one mode with the interrupt restarting the
	   timer */
	setupMRT(2, MRT_MODE_ONESHOT, 7);	/* Will fire in 1/7 seconds */

	/* All processing and MRT reset in the interrupt handler */
	while (1) {
		__WFI();
	}

	return 0;
}
开发者ID:frankzzcn,项目名称:M2_SE_RTOS_Project,代码行数:38,代码来源:mrt.c

示例12: SafeCloseHandle

void CConEmuPipe::Close()
{
	SafeCloseHandle(mh_Pipe);
	SafeFree(pIn);
	SafeFree(pOut);
	DEBUGSTR(L"Pipe::Close()\n");
}
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:7,代码来源:ConEmuPipe.cpp

示例13: Inject

// Find the name of the DLL and inject it.
BOOL Inject( LPPROCESS_INFORMATION ppi )
{
  DWORD len;
  WCHAR dll[MAX_PATH];
  int	type;

#if (MYDEBUG > 0)
  if (GetModuleFileNameEx( ppi->hProcess, NULL, dll, lenof(dll) ))
    DEBUGSTR( L"%s", dll );
#endif
  type = ProcessType( ppi );
  if (type == 0)
    return FALSE;

  len = GetModuleFileName( NULL, dll, lenof(dll) );
  while (dll[len-1] != '\\')
    --len;
#ifdef _WIN64
  wsprintf( dll + len, L"ANSI%d.dll", type );
  if (type == 32)
    InjectDLL32( ppi, dll );
  else
    InjectDLL64( ppi, dll );
#else
  wcscpy( dll + len, L"ANSI32.dll" );
  InjectDLL32( ppi, dll );
#endif
  return TRUE;
}
开发者ID:kmkkmk,项目名称:app,代码行数:30,代码来源:ansicon.c

示例14: MyCreateProcessW

BOOL WINAPI MyCreateProcessW( LPCWSTR lpApplicationName,
			      LPWSTR lpCommandLine,
			      LPSECURITY_ATTRIBUTES lpThreadAttributes,
			      LPSECURITY_ATTRIBUTES lpProcessAttributes,
			      BOOL bInheritHandles,
			      DWORD dwCreationFlags,
			      LPVOID lpEnvironment,
			      LPCWSTR lpCurrentDirectory,
			      LPSTARTUPINFOW lpStartupInfo,
			      LPPROCESS_INFORMATION lpProcessInformation )
{
  PROCESS_INFORMATION pi;

  if (!CreateProcessW( lpApplicationName,
		       lpCommandLine,
		       lpThreadAttributes,
		       lpProcessAttributes,
		       bInheritHandles,
		       dwCreationFlags | CREATE_SUSPENDED,
		       lpEnvironment,
		       lpCurrentDirectory,
		       lpStartupInfo,
		       &pi ))
    return FALSE;

  DEBUGSTR( L"CreateProcessW: \"%s\", \"%s\"",
	    (lpApplicationName == NULL) ? L"" : lpApplicationName,
	    (lpCommandLine == NULL) ? L"" : lpCommandLine );
  Inject( &pi, lpProcessInformation, dwCreationFlags );

  return TRUE;
}
开发者ID:aliking,项目名称:ansicon,代码行数:32,代码来源:ANSI.c

示例15: initCGIs

/** Initialize the CGI environment
 *	This function registers the pairs of file's name and CGI function for the HTTPD server
 * @returns nothing*/
void initCGIs( void) {

	http_set_cgi_handlers(cgi_handlers, (sizeof (cgi_handlers) / sizeof (tCGI) ) );

	DEBUGSTR("httpCGIHandlers registered...............[OK]\r\n");

	return;
}
开发者ID:patriciobos,项目名称:TpFinal-workspace,代码行数:11,代码来源:http_cgi.c


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