• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ debug_frmwrk_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main program body
 * @param[in]	None
 * @return 		None
 **********************************************************************/
void c_entry (void)
{
	EXTI_InitTypeDef EXTICfg;

	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	/* Initialize EXT pin and registers
	 * P2.10 as /EINT0
	 */
	PINSEL_ConfigPin(2,10,1);

	EXTI_Init();

	EXTICfg.EXTI_Line = EXTI_EINT0;
	/* edge sensitive */
	EXTICfg.EXTI_Mode = EXTI_MODE_EDGE_SENSITIVE;
	EXTICfg.EXTI_polarity = EXTI_POLARITY_LOW_ACTIVE_OR_FALLING_EDGE;
	EXTI_ClearEXTIFlag(EXTI_EINT0);
	EXTI_Config(&EXTICfg);

	NVIC_SetPriorityGrouping(4);
	NVIC_SetPriority(EINT0_IRQn, 0);
	NVIC_EnableIRQ(EINT0_IRQn);

	_DBG_("Press '1' to enter system in deep sleep mode.\n\r"\
		  "If you want to wake-up the system, press INT/WAKE-UP button.");
	while(_DG !='1')
	{
		_DBG_("I'm waiting...\n\r");
	}

	_DBG_("I'm sleeping...");
	// Enter target deep sleep mode
	CLKPWR_DeepSleep();
	SystemInit();
	debug_frmwrk_init();

	// MCU will be here after waking up
	_DBG_("\n\r-------- I'm wake up! -------- ");
	while (1);
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:56,代码来源:Pwr_DeepSleep.c


示例2: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main RIT program body
 * @param[in]	None
 * @return 		int
 **********************************************************************/
int c_entry (void) {

	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();
	 _DBG(menu);

	RIT_Init(LPC_RIT);
	/* Configure time_interval for RIT
	 * In this case: time_interval = 1000 ms = 1s
	 * So, RIT will generate interrupt each 1s
	 */
	RIT_TimerConfig(LPC_RIT,TIME_INTERVAL);

	_DBG("The time interval is: ");
	_DBD32(TIME_INTERVAL); _DBG_(" millisecond..");

#ifdef MCB_LPC_1768 /* Using LED2.2 for testing */
	//turn on LED2.2
	FIO_SetDir(2,(1<<2),1);
	FIO_SetValue(2,(1<<2));
#elif defined(IAR_LPC_1768) /* Using LED1 (P1.25 for testing */
	FIO_SetDir(1,(1<<25),1);
	FIO_ClearValue(1,(1<<25));
#endif
	NVIC_EnableIRQ(RIT_IRQn);

	while(1);
	return 1;
}
开发者ID:readermank,项目名称:kico_si5,代码行数:40,代码来源:rit_interrupt.c


示例3: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main CAN program body
 * @param[in]	none
 * @return 		int
 **********************************************************************/
int c_entry(void) { /* Main Program */
	PINSEL_CFG_Type PinCfg;

	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();
	print_menu();

	/* Pin configuration
	 * CAN1: select P0.0 as RD1. P0.1 as TD1
	 * CAN2: select P2.7 as RD2, P2.8 as RD2
	 */
	PinCfg.Funcnum = 1;
	PinCfg.OpenDrain = 0;
	PinCfg.Pinmode = 0;
	PinCfg.Pinnum = 0;
	PinCfg.Portnum = 0;
	PINSEL_ConfigPin(&PinCfg);
	PinCfg.Pinnum = 1;
	PINSEL_ConfigPin(&PinCfg);

	PinCfg.Pinnum = 7;
	PinCfg.Portnum = 2;
	PINSEL_ConfigPin(&PinCfg);
	PinCfg.Pinnum = 8;
	PINSEL_ConfigPin(&PinCfg);

	//Initialize CAN1 & CAN2
	CAN_Init(LPC_CAN1, 125000);
	CAN_Init(LPC_CAN2, 125000);

	//Enable Interrupt
	CAN_IRQCmd(LPC_CAN2, CANINT_RIE, ENABLE);

	//Enable CAN Interrupt
	NVIC_EnableIRQ(CAN_IRQn);

	_DBG_("CAN test Bypass Mode function...");
	_DBG_("Press '1' to initialize CAN message...");_DBG_("");
	while(_DG !='1');
	CAN_SetAFMode(LPC_CANAF,CAN_AccBP);
	CAN_InitMessage();
	PrintMessage(&TXMsg);
	_DBG_("Message ID and data will be increased continuously...");

	_DBG_("Press '2' to start CAN operation...");
	while(_DG !='2');

	/** To test Bypass Mode: we send infinite messages to CAN2 and check
	 * receive process via COM1
	 */
	CAN_SendMsg(LPC_CAN1, &TXMsg);

	while (1);
}
开发者ID:readermank,项目名称:kico_si5,代码行数:65,代码来源:can_test_bypass_mode.c


示例4: c_entry

/*********************************************************************//**
 * @brief       c_entry: Main ADC program body
 * @param[in]   None
 * @return      None
 **********************************************************************/
void c_entry(void)
{
    volatile uint32_t adc_value, tmp;
    uint8_t  quit;

    /* Initialize debug via UART0
     * – 115200bps
     * – 8 data bit
     * – No parity
     * – 1 stop bit
     * – No flow control
     */
    debug_frmwrk_init();

    // print welcome screen
    print_menu();

    /* Initialize ADC ----------------------------------------------------*/
    /*
     * Init ADC pin that currently is being used on the board
     */
    PINSEL_ConfigPin (BRD_ADC_PREPARED_CH_PORT, BRD_ADC_PREPARED_CH_PIN, BRD_ADC_PREPARED_CH_FUNC_NO);
    PINSEL_SetAnalogPinMode(BRD_ADC_PREPARED_CH_PORT,BRD_ADC_PREPARED_CH_PIN,ENABLE);

    /* Configuration for ADC :
     *  ADC conversion rate = 400Khz
     */
    ADC_Init(LPC_ADC, 400000);

    ADC_IntConfig(LPC_ADC, BRD_ADC_PREPARED_INTR, DISABLE);
    ADC_ChannelCmd(LPC_ADC, BRD_ADC_PREPARED_CHANNEL, ENABLE);

    while(1)
    {
        // Start conversion
        ADC_StartCmd(LPC_ADC, ADC_START_NOW);

        //Wait conversion complete
        while (!(ADC_ChannelGetStatus(LPC_ADC, BRD_ADC_PREPARED_CHANNEL, ADC_DATA_DONE)));

        adc_value = ADC_ChannelGetData(LPC_ADC, BRD_ADC_PREPARED_CHANNEL);

        //Display the result of conversion on the UART

        _DBG("ADC value on channel "); _DBD(BRD_ADC_PREPARED_CHANNEL);

        _DBG(" is: "); _DBD32(adc_value); _DBG_("");

        //delay
        for(tmp = 0; tmp < 1000000; tmp++);
        if(_DG_NONBLOCK(&quit) &&
            (quit == 'Q' || quit == 'q'))
            break;
    }
    _DBG_("Demo termination!!!");

    ADC_DeInit(LPC_ADC);

}
开发者ID:003900107,项目名称:realboard-lpc4088,代码行数:64,代码来源:Adc_Polling.c


示例5: main

/*******************************************************************************
* Function Name  : main
* Description    : Main program
* Input          : None
* Output         : None
* Return         : None
* Attention		 : None
*******************************************************************************/
int main(void)
{
    debug_frmwrk_init();
    EMC_NAND_Test();
	/* Infinite loop */
	while( 1 )
	{
	}
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:17,代码来源:main.c


示例6: prvSetupHardware

/** \brief  Sets up system hardware
 */
static void prvSetupHardware(void)
{
	/* Setup board including GPIOs and pin muxing */
	board_setup();
	led_set(0);

	/* Initialize debug output via serial port */
	debug_frmwrk_init();
}
开发者ID:10code,项目名称:lwip,代码行数:11,代码来源:ea1788_http_freertos.c


示例7: main

int main (void) {
    debug_frmwrk_init();
    _printf("Up and running!");

    while(true) {
        _printf("Still running...");
    }

    return  0;
}
开发者ID:peplin,项目名称:lpc17xx-starter,代码行数:10,代码来源:main.c


示例8: main

/*******************************************************************************
* Function Name  : main
* Description    : Main program
* Input          : None
* Output         : None
* Return         : None
* Attention		 : None
*******************************************************************************/
int main (void) {
	uint32_t n;
	uint32_t ret;

	SysTick_Config(SystemCoreClock / 1000);
	#ifdef CFG_SDCARD
  	/* Setup SD Card/FATFS */
  	SDInit();
	#endif
	debug_frmwrk_init();
	printf("\r\n hello");
	//for (n = 0; n < MSC_ImageSize; n++) {     /* Copy Initial Disk Image */
	//	Memory[n] = DiskImage[n];             /* from Flash to RAM */
	//}
	
	if(!KEY1_PIN)
	{
		UsbMode = 0;
		while(!KEY1_PIN);
		delay(100000);
		while(!KEY1_PIN);
		
	}
	if(UsbMode == 0){
		USB_Init();                               /* USB Initialization */
		USB_Connect(TRUE);                        /* USB Connect */
	}
	else{
		
	
	    Host_Init();               // Initialize the lpc17xx host controller                                    
	
		if( Host_EnumDev() == 0 )	/* Enumerate the device connected                                            */
	    {
		  printf("-- USB device detected OK \r\n");
	    }
	    else
	    {
	      printf("-- Please connect a USB device \r\n");
	      while( Host_EnumDev() == 0 );
	      printf("-- USB device connection detected \r\n");
		  Delay(0x00ffff);
	    }
	}

	while (1){
		if(!KEY1_PIN)
		{
			ret = Host_CtrlSend(0x40, 0x50, 0, 0, 0, NULL);
			printf("\r\n sent switch cmd,ret= %x ",ret);
			delay(100);
			NVIC_SystemReset();
		}
	}
}
开发者ID:cgha,项目名称:lpc1768-sd-usb-msc,代码行数:63,代码来源:main.c


示例9: c_entry

/*********************************************************************//**
 * @brief       c_entry: Main program body
 * @param[in]   None
 * @return      None
 **********************************************************************/
void c_entry (void)
{
    uint8_t* pDest =    (uint8_t*)VTOR_OFFSET;
    uint8_t* pSource = NULL;
    GPIO_Init();
    
    /* Initialize debug via UART0
     * – 115200bps
     * – 8 data bit
     * – No parity
     * – 1 stop bit
     * – No flow control
     */
    debug_frmwrk_init();

    // print welcome screen
    print_menu();

    GPIO_SetDir(BRD_LED_1_CONNECTED_PORT, BRD_LED_1_CONNECTED_MASK, 1);

    _DBG(" Remapping Vector Table at address: ");

    _DBH32(VTOR_OFFSET); _DBG_("");

    NVIC_SetVTOR(VTOR_OFFSET);

    /* Copy Vector Table from 0x00000000 to new address
     * In ROM mode: Vector Interrupt Table is initialized at 0x00000000
     * In RAM mode: Vector Interrupt Table is initialized at 0x10000000
     * Aligned: 256 words
     */


#ifdef __RAM_MODE__ //Run in RAM mode
  pSource =  (void*)0x10000000;
  memcpy(pDest,pSource , 256*4);
#else
  pSource = (void*)0x00000000;
  memcpy(pDest,pSource , 256*4);
#endif

    _DBG_(" If Vector Table remapping is successful, LED P2.10 will blink by using\n\r SysTick interrupt");
    //Initialize System Tick with 100ms time interval
    /* Input parameter for SysTick in range 0..174 ms */
    SYSTICK_InternalInit(100);

    //Enable System Tick interrupt
    SYSTICK_IntCmd(ENABLE);

    //Enable System Tick Counter
    SYSTICK_Cmd(ENABLE);

    while(1);

}
开发者ID:003900107,项目名称:realboard-lpc4088,代码行数:60,代码来源:Nvic_VectorTableRelocation.c


示例10: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main TIMER program body
 * @param[in]	None
 * @return 		int
 **********************************************************************/
int c_entry(void)
{
	PINSEL_CFG_Type PinCfg;

	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	//Config P1.26 as CAP0.0
	PinCfg.Funcnum = 3;
	PinCfg.OpenDrain = 0;
	PinCfg.Pinmode = 0;
	PinCfg.Portnum = 1;
	PinCfg.Pinnum = 26;
	PINSEL_ConfigPin(&PinCfg);

	// Initialize timer 0, prescale count time of 1000000uS = 1S
	TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_USVAL;
	TIM_ConfigStruct.PrescaleValue	= 1000000;

	// use channel 0, CAPn.0
	TIM_CaptureConfigStruct.CaptureChannel = 0;
	// Enable capture on CAPn.0 rising edge
	TIM_CaptureConfigStruct.RisingEdge = ENABLE;
	// Enable capture on CAPn.0 falling edge
	TIM_CaptureConfigStruct.FallingEdge = ENABLE;
	// Generate capture interrupt
	TIM_CaptureConfigStruct.IntOnCaption = ENABLE;


	// Set configuration for Tim_config and Tim_MatchConfig
	TIM_Init(LPC_TIM0, TIM_TIMER_MODE,&TIM_ConfigStruct);
	TIM_ConfigCapture(LPC_TIM0, &TIM_CaptureConfigStruct);
	TIM_ResetCounter(LPC_TIM0);


	/* preemption = 1, sub-priority = 1 */
	NVIC_SetPriority(TIMER0_IRQn, ((0x01<<3)|0x01));
	/* Enable interrupt for timer 0 */
	NVIC_EnableIRQ(TIMER0_IRQn);
	// To start timer 0
	TIM_Cmd(LPC_TIM0,ENABLE);

	while (1);
	return 1;
}
开发者ID:Frehner1,项目名称:CMSIS_LPC17xx,代码行数:59,代码来源:timer_capture.c


示例11: c_entry

/*********************************************************************//**
 * @brief	Main I2S program body
 **********************************************************************/
int c_entry (void) {                       /* Main Program  */
	RIT_CMP_VAL  value;
	PINSEL_CFG_Type PinCfg;

	// DeInit NVIC and SCBNVIC
	NVIC_DeInit();
	NVIC_SCBDeInit();

	/* Configure the NVIC Preemption Priority Bits:
	 * two (2) bits of preemption priority, six (6) bits of sub-priority.
	 * Since the Number of Bits used for Priority Levels is five (5), so the
	 * actual bit number of sub-priority is three (3)
	 */
	NVIC_SetPriorityGrouping(0x05);

	//  Set Vector table offset value
#if (__RAM_MODE__==1)
	NVIC_SetVTOR(0x10000000);
#else
	NVIC_SetVTOR(0x00000000);
#endif

	debug_frmwrk_init();
	 _DBG(menu);

	value.CMPVAL = 10000000;
	value.COUNTVAL = 0x00000000;
	value.MASKVAL = 0x00000000;
	RIT_Init(LPC_RIT);
	RIT_TimerConfig(LPC_RIT,&value);
	RIT_TimerClearCmd(LPC_RIT,ENABLE);

	_DBG("The value compare is: ");
	_DBD32(value.CMPVAL); _DBG_(" system tick");

	//Config P2.2 as GPO2.2
	PinCfg.Funcnum = 0;
	PinCfg.OpenDrain = 0;
	PinCfg.Pinmode = 0;
	PinCfg.Portnum = 2;
	PinCfg.Pinnum = 2;
	PINSEL_ConfigPin(&PinCfg);

	//turn on LED2.2
	GPIO_SetDir(2,(1<<2),1);
	GPIO_SetValue(2,(1<<2));

	NVIC_EnableIRQ(RIT_IRQn);

	while(1);
	return 1;
}
开发者ID:glocklueng,项目名称:micropendousx,代码行数:55,代码来源:rit_interrupt.c


示例12: c_entry

/**
 * @brief Main Program body
 */
int c_entry(void)
{
	PINSEL_CFG_Type PinCfg;
	uint32_t adc_value;

	/*
	 * Initialize debug via UART
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	/*
	 * Init ADC pin connect
	 * AD0.2 on P0.25
	 */
	PinCfg.Funcnum = 1;
	PinCfg.OpenDrain = 0;
	PinCfg.Pinmode = 0;
	PinCfg.Pinnum = 25;
	PinCfg.Portnum = 0;
	PINSEL_ConfigPin(&PinCfg);

	/* Configuration for ADC :
	 * 	Frequency at 1Mhz
	 *  ADC channel 2, no Interrupt
	 */
	ADC_Init(LPC_ADC, 1000000);
	ADC_IntConfig(LPC_ADC,ADC_ADINTEN2,DISABLE);
	ADC_ChannelCmd(LPC_ADC,ADC_CHANNEL_2,ENABLE);

	while(1)
	{
		// Start conversion
		ADC_StartCmd(LPC_ADC,ADC_START_NOW);
		//Wait conversion complete
		while (!(ADC_ChannelGetStatus(LPC_ADC,ADC_CHANNEL_2,ADC_DATA_DONE)));
		adc_value = ADC_ChannelGetData(LPC_ADC,ADC_CHANNEL_2);
		//Display the result of conversion on the UART0
		_DBG("ADC value on channel 2: ");
		_DBD32(adc_value);
		_DBG_("");
		//delay 1s
		Timer_Wait(1000);
	}
	ADC_DeInit(LPC_ADC);
	return 1;
}
开发者ID:glocklueng,项目名称:micropendousx,代码行数:52,代码来源:adc_polling_test.c


示例13: main

/*********************************************************************//**
 * @brief 			This function is the main function where the execution begins
 * @param[in]		None
 * @return 		    None
 **********************************************************************/
int main()
{
    int32_t  rc;
    uint32_t  numBlks, blkSize;	
		uint8_t buffer[30];
		UINT nun;
    uint8_t  inquiryResult[INQUIRY_LENGTH];
		FATFS fs;
	   FIL fsrc, fdst;
  
		const TCHAR  a=1;
  
		  SystemInit();
	  debug_frmwrk_init();
			print_menu();
		
    Host_Init();               /* Initialize the lpc17xx host controller                                    */

    PRINT_Log("Host Initialized\r\n");
    PRINT_Log("Connect a Mass Storage device\r\n");
    rc = Host_EnumDev();       /* Enumerate the device connected                                            */
		 PRINT_Log("Á¬½ÓÉ豸\r\n");
    if ((rc == USB_HOST_FUNC_OK) && (Host_GetDeviceType() == MASS_STORAGE_DEVICE))
			{
					
					PRINT_Log("Mass Storage device connected\r\n");

				rc = 	f_mount(&fs,"0:",1);  
				if(rc==0)
				{
					  rc = f_open(&fdst, "0:read.txt", FA_READ);
					if(rc==0)
					{
						PRINT_Log("open ok\r\n");
						f_read (&fdst,   buffer, 30, &nun );
						PRINT_Log(buffer);
						f_close(&fdst);
					}
				}
    
    } 
		else {
	    PRINT_Log("Not a Mass Storage device\n");							
        return (0);
    }


   return 0;
}
开发者ID:tongjingyu,项目名称:nxp-os,代码行数:54,代码来源:usbhost_main.c


示例14: c_entry

/*********************************************************************//**
 * @brief       c_entry: Main CAN program body
 * @param[in]   none
 * @return      none
 **********************************************************************/
void c_entry(void)
{
    /* Initialize debug via UART0
     * – 115200bps
     * – 8 data bit
     * – No parity
     * – 1 stop bit
     * – No flow control
     */
    debug_frmwrk_init();
    print_menu();

    /* Initialize CAN1 peripheral
     * Note: Self-test mode doesn't require pin selection
     */
    CAN_Init(_USING_CAN_NO, 125000);

    //Enable self-test mode
    CAN_ModeConfig(_USING_CAN_NO, CAN_SELFTEST_MODE, ENABLE);

    //Enable Interrupt
    CAN_IRQCmd(_USING_CAN_NO, CANINT_RIE, ENABLE);
    CAN_IRQCmd(_USING_CAN_NO, CANINT_TIE1, ENABLE);

    //Enable CAN Interrupt
    NVIC_EnableIRQ(CAN_IRQn);

    CAN_SetAFMode(CAN_ACC_BP);

    CAN_InitMessage();

    _DBG_("Transmitted buffer:");

    PrintMessage(&TXMsg);

    /** To test Bypass Mode: we send infinite messages to CAN2 and check
     * receive process via COM1
     */
    CAN_SendMsg(_USING_CAN_NO, &TXMsg);

#if (_USING_CAN_NO == CAN_1)
    LPC_CAN1->CMR |=(1<<4); //Self Reception Request
#else
    LPC_CAN2->CMR |=(1<<4);
#endif

    while (1);
}
开发者ID:003900107,项目名称:realboard-lpc4088,代码行数:53,代码来源:Can_Selftest.c


示例15: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main program body
 * @param[in]	None
 * @return 		int
 **********************************************************************/
int c_entry (void)
{
	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	/* In this example:
	 * Suppose that the RTC need periodically adjust after each 5 second.
	 * And the time counter need by incrementing the counter by 2 instead of 1
	 * We will observe timer counter after calibration via serial display
	 */
	// Init RTC module
	RTC_Init(LPC_RTC);

	/* Enable rtc (starts increase the tick counter and second counter register) */
	RTC_ResetClockTickCounter(LPC_RTC);
	RTC_Cmd(LPC_RTC, ENABLE);

	//Set current time = 0
	RTC_SetTime (LPC_RTC, RTC_TIMETYPE_SECOND, 0);

	/* Setting Timer calibration
	 * Calibration value =  5s;
	 * Direction = Forward calibration
	 * So after each 5s, calibration logic can periodically adjust the time counter by
	 * incrementing the counter by 2 instead of 1
	 */
	RTC_CalibConfig(LPC_RTC, 5, RTC_CALIB_DIR_FORWARD);
	RTC_CalibCounterCmd(LPC_RTC, ENABLE);

	/* Set the CIIR for second counter interrupt*/
	RTC_CntIncrIntConfig (LPC_RTC, RTC_TIMETYPE_SECOND, ENABLE);

    /* Enable RTC interrupt */
    NVIC_EnableIRQ(RTC_IRQn);

    /* Loop forever */
    while(1);
    return 1;
}
开发者ID:readermank,项目名称:kico_si5,代码行数:53,代码来源:rtc_calib.c


示例16: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main program body
 * @param[in]	None
 * @return 		int
 **********************************************************************/
int c_entry (void)
{

	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	/* Initialize and configure RTC */
	RTC_Init(LPC_RTC);

	RTC_ResetClockTickCounter(LPC_RTC);
	RTC_SetTime (LPC_RTC, RTC_TIMETYPE_SECOND, 0);

	/* Set alarm time = 5s.
	 * So, after each 5s, RTC will generate and wake-up system
	 * out of Deep PowerDown mode.
	 */
	RTC_SetAlarmTime (LPC_RTC, RTC_TIMETYPE_SECOND, 5);

	RTC_CntIncrIntConfig (LPC_RTC, RTC_TIMETYPE_SECOND, DISABLE);
	/* Set the AMR for 5s match alarm interrupt */
	RTC_AlarmIntConfig (LPC_RTC, RTC_TIMETYPE_SECOND, ENABLE);
	RTC_ClearIntPending(LPC_RTC, RTC_INT_ALARM);

	_DBG_("Press '1' to enter system in Deep PowerDown mode");
	while(_DG !='1');

	RTC_Cmd(LPC_RTC, ENABLE);
	NVIC_EnableIRQ(RTC_IRQn);

	_DBG_("Enter Deep PowerDown mode...");
	_DBG_("Wait 5s, RTC will wake-up system...\n\r");

	// Enter target power down mode
	CLKPWR_DeepPowerDown();

	while(1);
	return 1;
}
开发者ID:m3y54m,项目名称:32bitmicro,代码行数:52,代码来源:rtc_deeppwd.c


示例17: c_entry

int c_entry(void)
{
	// Init LED port
	LED_Init();

	/*
	 * Initialize debug via UART
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	// Read back TimeOut flag to determine previous timeout reset
	if (WDT_ReadTimeOutFlag()){
		_DBG_(info1);
		// Clear WDT TimeOut
		WDT_ClrTimeOutFlag();
	} else{
		_DBG_(info2);
	}

	// Initialize WDT, IRC OSC, interrupt mode, timeout = 2000000 microsecond
	WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);
	// Start watchdog with timeout given
	WDT_Start(WDT_TIMEOUT);

	// set timer 100 ms
	Timer_Wait(100);

	while (1){
		// Wait for 100 millisecond
		while ( !(TIM_GetIntStatus(LPC_TIM0,0)));
		TIM_ClearIntPending(LPC_TIM0,0);
		//turn on led
		FIO_ByteSetValue(2, 0, LED_PIN);

		// Wait for 100 millisecond
		while ( !(TIM_GetIntStatus(LPC_TIM0,0)));
		TIM_ClearIntPending(LPC_TIM0,0);
		//turn off led
		FIO_ByteClearValue(2, 0, LED_PIN);
	}

	return 0;
}
开发者ID:Lzyuan,项目名称:STE-LPC1768-,代码行数:46,代码来源:wdt_reset_test.c


示例18: c_entry

/*********************************************************************//**
 * @brief		c_entry: Main program body
 * @param[in]	None
 * @return 		int
 **********************************************************************/
int c_entry (void)
{
	/* Initialize debug via UART0
	 * – 115200bps
	 * – 8 data bit
	 * – No parity
	 * – 1 stop bit
	 * – No flow control
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	//Use P0.0 to test System Tick interrupt
	GPIO_SetDir(1, (1<<28), 1); //Set P0.0 as output

	_DBG("Remapping Vector Table at address: ");
	_DBH32(VTOR_OFFSET); _DBG_("");
	NVIC_SetVTOR(VTOR_OFFSET);

	/* Copy Vector Table from 0x00000000 to new address
	 * In ROM mode: Vector Interrupt Table is initialized at 0x00000000
	 * In RAM mode: Vector Interrupt Table is initialized at 0x10000000
	 * Aligned: 256 words
	 */

#if(__RAM_MODE__==0)//Run in ROM mode
	memcpy(VTOR_OFFSET, 0x00000000, 256*4);
#else
	memcpy(VTOR_OFFSET, 0x10000000, 256*4);
#endif

	_DBG_("If Vector Table remapping is successful, LED P1.28 will blink by using SysTick interrupt");
	//Initialize System Tick with 100ms time interval
	SYSTICK_InternalInit(100);
	//Enable System Tick interrupt
	SYSTICK_IntCmd(ENABLE);
	//Enable System Tick Counter
	SYSTICK_Cmd(ENABLE);

	while(1);
	return 1;
}
开发者ID:DesignByArie,项目名称:lpc17xx.cmsis.driver.library,代码行数:49,代码来源:vt_relocation.c


示例19: initialise

/**
 * Runs all the initialisations that are needed
 * Please put them in here.
 */
void initialise() {
  debug_frmwrk_init();
  setSensorSide(-1);
  trackingState = 0;
  timerCounter = 0;
  courseType = 0;
  initSerial();
  serialTest();
  initSensors();
  // Even tho this is a test it needs to run so that the serial is set up properly
  initTimers();
  //__enable_irq();
  if (DBG_LEVEL >= 1) {
	  _DBG_("MOUSE");
  }
 	mouseinitial();  
  if (DBG_LEVEL >= 1) {
	  _DBG_("I've completed"); 
	}

}
开发者ID:AJDurant,项目名称:haprrobot,代码行数:25,代码来源:haprrobot.c


示例20: c_entry

/*********************************************************************//**
 * @brief	Main 4-bit LCD porting with GPIO program body
 **********************************************************************/
int c_entry(void)
{
	// DeInit NVIC and SCBNVIC
	NVIC_DeInit();
	NVIC_SCBDeInit();

	/* Configure the NVIC Preemption Priority Bits:
	 * two (2) bits of preemption priority, six (6) bits of sub-priority.
	 * Since the Number of Bits used for Priority Levels is five (5), so the
	 * actual bit number of sub-priority is three (3)
	 */
	NVIC_SetPriorityGrouping(0x05);

	//  Set Vector table offset value
#if (__RAM_MODE__==1)
	NVIC_SetVTOR(0x10000000);
#else
	NVIC_SetVTOR(0x00000000);
#endif

	/* Initialize debug
	 */
	debug_frmwrk_init();

	// print welcome screen
	print_menu();

	/* LCD block section -------------------------------------------- */
	GLCD_Init();
//	LCD_cur_off();
	GLCD_Clear(White);

	/* Update LCD Module display text. */
	GLCD_DisplayString(0,0, lcd_text[0] );
	GLCD_DisplayString(1,2, lcd_text[1] );

    /* Loop forever */
    while(1);
    return 1;
}
开发者ID:Lzyuan,项目名称:STE-LPC1768-,代码行数:43,代码来源:lcdtest.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ debug_get_bool_option函数代码示例发布时间:2022-05-30
下一篇:
C++ debug_fatal函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap