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


C++ ROM_TimerIntClear函数代码示例

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


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

示例1: Timer0BIntHandler

//---- INT Handlers ----// 
void Timer0BIntHandler(void)
{
    //
    // Clear the timer interrupt flag.
    //
    ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMB_TIMEOUT);

    //
    // Update the periodic interrupt counter.
    //
    g_ui32Counter++;

    //
    // Once NUMBER_OF_INTS interrupts have been received, turn off the
    // TIMER0B interrupt.
    //
    if(g_ui32Counter == NUMBER_OF_INTS)
    {
        //
        // Disable the Timer0B interrupt.
        //
        ROM_IntDisable(INT_TIMER0B);

        //
        // Turn off Timer0B interrupt.
        //
        ROM_TimerIntDisable(TIMER0_BASE, TIMER_TIMB_TIMEOUT);

        //
        // Clear any pending interrupt flag.
        //
        ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
    }
    
}
开发者ID:gabriellemerritt,项目名称:spring2015,代码行数:36,代码来源:dymxl.c

示例2: Timer3IntHandler

//*****************************************************************************
//
// The interrupt handler for the fourth timer interrupt. (light)
//
//*****************************************************************************
void
Timer3IntHandler(void)
{
    //
    // Clear the timer interrupt.
    //
    ROM_TimerIntClear(TIMER3_BASE, TIMER_TIMA_TIMEOUT);



	// Get the timer value and reset it
	ROM_TimerDisable(TIMER5_BASE, TIMER_A);
	// Get the timer value
	Timer = ROM_TimerValueGet(TIMER5_BASE, TIMER_A);
	// Reset the timer value to 65000
	ROM_TimerLoadSet(TIMER5_BASE, TIMER_A, 65000); // Timer5
	ROM_TimerEnable(TIMER5_BASE, TIMER_A);

    //
    // Toggle the flag for the light timer.
    //
    HWREGBITW(&g_ui32InterruptFlags, 2) = 1;

    //
    // Update the interrupt status.
    //

}
开发者ID:keithlueneburg,项目名称:TCES430-projects,代码行数:33,代码来源:timers.c

示例3: Timer0IntHandler

//*****************************************************************************
//
// The interrupt handler for the real time clock interrupt.
//
//*****************************************************************************
void
Timer0IntHandler(void)
{
	//Real time clock interrupt, keep track of days, hours, minutes, seconds
    //
    // Clear the timer interrupt.
    //
    ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    //Increment Timer A Count
    TimerACount++;
    RTC_Seconds = (TimerACount / 10);
    RTC_Minutes = (RTC_Seconds / 60);
    RTC_Hours   = (RTC_Minutes / 60);
    RTC_Days    = RTC_Hours   / 24;

    HWREGBITW(&g_ui32PrintFlags, 0) = 1;

    /*//
    // Use the flags to Toggle the LED for this timer
    //
    GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, g_ui32Flags);*/

    //
    // Update the interrupt status.
    //

}
开发者ID:keithlueneburg,项目名称:TCES430-projects,代码行数:33,代码来源:timers.c

示例4: Timer0AIntHandler

void Timer0AIntHandler(void)
{ 
    ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    led_value ^= LED_BLUE;
    ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_BLUE, led_value);
}
开发者ID:kevinporetti,项目名称:embedded-software-s16,代码行数:7,代码来源:main_timer_interrupt.c

示例5: Timer4IntHandler

//*****************************************************************************
//
// The interrupt handler for timer 4.  This will be called whenever the timer
// count reaches the match value (0 in this example).
//
// TODO: Make sure you hook your ISR to the correct vector in the application
// startup file.
//
//*****************************************************************************
void
Timer4IntHandler(void)
{
    //
    // Clear the timer interrupt.
    //
    // TODO: Rework this for the timer you are using in your application.
    //
    ROM_TimerIntClear(TIMER4_BASE, TIMER_CAPA_MATCH);

    //
    // TODO: Do whatever your application needs to do when the relevant
    // number of edges have been counted.
    //
    ProcessInterrupt();

    //
    // The timer is automatically stopped when it reaches the match value
    // so re-enable it here.
    //
    // TODO: Whether you reenable the timer here or elsewhere will be up to
    // your particular application.
    //
    ROM_TimerEnable(TIMER4_BASE, TIMER_A);
}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:34,代码来源:edge_count.c

示例6: Timer0ISR

///
/// routine di servizio del timer0
void Timer0ISR(void){

    //
    // Clear the timer interrupt.
    //
    ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    //
    // Toggle the flag for the first timer.
    //
    ///HWREGBITW(&g_ui32Flags, 0) ^= 1;

    //PIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2);

    procCom = 1;
    tick++;
    //
    // Use the flags to Toggle the LED for this timer
    //
    //GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, g_ui32Flags << 1);

    //
    // Update the interrupt status on the display.
    //
}
开发者ID:itismattei,项目名称:controlPid,代码行数:27,代码来源:tiva_timer.c

示例7: Timer0IntHandler

void Timer0IntHandler(void){
	// Used to countdown from entered time

	// Clear the timer interrupt.
	ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

	// Check if time has been reached
	if(g_countdownTime == 0){
		ROM_IntMasterDisable();
		UARTprintf("Time's Up!\n\n");
		ROM_IntMasterEnable();
		ROM_TimerEnable(TIMER1_BASE, TIMER_A);
		ROM_TimerIntDisable(TIMER0_BASE, TIMER_A);
		return;
	}

	// Turn on LED
	ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_RED, LED_RED);
	ROM_TimerEnable(TIMER2_BASE, TIMER_A);

	// Update the interrupt status on the display.
	ROM_IntMasterDisable();
	UARTprintf("    %i\n",g_countdownTime);
	ROM_IntMasterEnable();

	// Decrement counter
	g_countdownTime--;
	
	// Turn off LED
	//ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_RED, 0);
}
开发者ID:chaitanya4b3,项目名称:Tiva-Test,代码行数:31,代码来源:timers.c

示例8: RGBBlinkIntHandler

//*****************************************************************************
//
//! Wide Timer interrupt to handle blinking effect of the RGB 
//!
//! This function is called by the hardware interrupt controller on a timeout
//! of the wide timer.  This function must be in the NVIC table in the startup
//! file.  When called will toggle the enable flag to turn on or off the entire
//! RGB unit.  This creates a blinking effect.  A wide timer is used since the 
//! blink is intended to be visible to the human eye and thus is expected to 
//! have a frequency between 15 and 0.1 hz. Currently blink duty is fixed at
//! 50%.
//!
//! \return None.
//
//*****************************************************************************
void
RGBBlinkIntHandler(void)
{
    static unsigned long ulFlags;


    //
    // Clear the timer interrupt.
    //
    ROM_TimerIntClear(WTIMER5_BASE, TIMER_TIMB_TIMEOUT);

    //
    // Toggle the flag for the blink timer.
    //
    ulFlags ^= 1;

    if(ulFlags)
    {
        RGBEnable();
    }
    else
    {
        RGBDisable();
    }

}
开发者ID:AlexGeControl,项目名称:tiva-c,代码行数:41,代码来源:rgb.c

示例9: Mode_WTimer3BISR

void Mode_WTimer3BISR(void){
	ROM_TimerIntClear(WTIMER3_BASE, TIMER_CAPB_EVENT);
	// Doc trang thai canh ngat
	if (GPIOPinRead(GPIO_PORTD_BASE,GPIO_PIN_3)&GPIO_PIN_3)
		ui32T_Edgeup_Mode = ROM_TimerValueGet(WTIMER3_BASE, TIMER_B);
	else
	{
		if (firstEdgeMode)
		{
			firstEdgeMode=0;
			return;
		}

		ui32T_Edgedown_Mode = ROM_TimerValueGet(WTIMER3_BASE, TIMER_B);

		i32DeltaT_Mode = (int32_t)(ui32T_Edgedown_Mode - ui32T_Edgeup_Mode);

		//				UARTPutn(UART0_BASE,i32DeltaT_SStop);
		//				UARTCharPut(UART0_BASE,'\n');

		//		if ((i32DeltaT_Mode<125000) && (i32DeltaT_Mode>115000))
		//			isAuto=true;
		//		else if ((i32DeltaT_Mode>135000) && (i32DeltaT_Mode<145000))
		//			isAuto=false;
	}
}
开发者ID:ndhuan,项目名称:AutomaticSprayingMachine,代码行数:26,代码来源:InterruptHandler.c

示例10: Timer0IntHandler

//*****************************************************************************
//
// The interrupt handler for the periodic timer interrupt.  When the uDMA
// channel is used, interrupts from the periodic timer are used as DMA
// requests, and this interrupt handler is invoked only at the end of all of
// the DMA transfers.
//
//*****************************************************************************
void
Timer0IntHandler(void)
{
    unsigned long ulStatus;

    //
    // Clear the timer interrupt.
    //
    ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    //
    // Read the uDMA channel status to verify it is done
    //
    ulStatus = uDMAChannelModeGet(UDMA_CHANNEL_TMR0A);
    if(ulStatus == UDMA_MODE_STOP)
    {
        //
        // Disable the periodic timer and set the done flag
        //
        ROM_TimerDisable(TIMER0_BASE, TIMER_A);
        g_bDoneFlag = 1;
    }

    //
    // Increment a counter to indicate the number of times this handler
    // was invoked
    //
    g_ulTimer0AIntCount++;
}
开发者ID:yangjunjiao,项目名称:Luminary-Micro-Library,代码行数:37,代码来源:udma_timer.c

示例11: Timer0IntHandler

//*****************************************************************************
//
// The interrupt handler for the first timer interrupt.
//
//*****************************************************************************
void
Timer0IntHandler(void)
{
    char cOne, cTwo;

    //
    // Clear the timer interrupt.
    //
    ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    //
    // Toggle the flag for the first timer.
    //
    HWREGBITW(&g_ui32Flags, 0) ^= 1;

    //
    // Use the flags to Toggle the LED for this timer
    //
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, g_ui32Flags << 1);

    //
    // Update the interrupt status on the display.
    //
    ROM_IntMasterDisable();
    cOne = HWREGBITW(&g_ui32Flags, 0) ? '1' : '0';
    cTwo = HWREGBITW(&g_ui32Flags, 1) ? '1' : '0';
    UARTprintf("\rT1: %c  T2: %c", cOne, cTwo);
    ROM_IntMasterEnable();
}
开发者ID:PhamVanNhi,项目名称:ECE5770,代码行数:34,代码来源:timers.c

示例12: TimerIntHandlerServos

// Triggered every SERVO_TIMER_RESOLUTION microseconds
void TimerIntHandlerServos(void) {
    // Clear the interrupt
    ROM_TimerIntClear(SERVO_TIMER, SERVO_TIMER_TRIGGER);
    
    // SERVO_TIMER_RESOLUTION microseconds have passed, increment each counter by that
    // to determine how long to set the pin high for
    g_pulseTime += SERVO_TIMER_RESOLUTION;

    if(g_pulseTime > SERVO_PERIOD) {
        g_pulseTime = 0;
    }

    // Loop through al servo configs and see if they need to be set low yet
    uint8_t i;
    for(i=0; i<SERVO_MAX_COUNT; i++) {
        servo_t *servo = &g_servos[i];
        
        if(servo->state & SERVO_STATE_ENABLED) {
            if(g_pulseTime >= servo->value) {
                // End of pulse, set low
                ROM_GPIOPinWrite(servo->port, servo->pin, 0);
            } else  {
                // Beginning of pulse, set high
                ROM_GPIOPinWrite(servo->port, servo->pin, servo->pin);
            }
        }
    }
}
开发者ID:mattwilliamson,项目名称:stellaris-launchpad-servo,代码行数:29,代码来源:servo.c

示例13: ROM_TimerIntClear

void ServoClass::ServoIntHandler(void)
{
	// Clear the timer interrupt.
	ROM_TimerIntClear(SERVO_TIMER, SERVO_TIMER_TRIGGER);

	// Get the pulse width value for the current servo from the array
	// if we have already serviced all servos (g_iServoNo = MAX_SERVO_NO)
	// then this value should be the 20ms period value
	unsigned long l_ulPulseWidth = g_ulTicksPerMicrosecond * g_ulServoPulse[g_iServoNo];

	// Re-Load the timer with the new pulse width count value
	ROM_TimerLoadSet(SERVO_TIMER, SERVO_TIMER_A, l_ulPulseWidth);

	// End the servo pulse set previously (if any)
	if(g_iServoNo > 0)  // If not the 1st Servo....
	{
		if (g_ulServoPins[g_iServoNo - 1] != INVALID_SERVO_PIN)
			digitalWrite(g_ulServoPins[g_iServoNo - 1], LOW);
	}

	// Set the current servo pin HIGH
	if(g_iServoNo < SERVOS_PER_TIMER)
	{
		if (g_ulServoPins[g_iServoNo] != INVALID_SERVO_PIN)
			digitalWrite(g_ulServoPins[g_iServoNo], HIGH);
		g_iServoNo++;  // Advance to next servo for processing next time
	}
	else
	{
		g_iServoNo = 0; // Start all over again
	}
}
开发者ID:Ryccoo,项目名称:quad_libraries,代码行数:32,代码来源:Servo.cpp

示例14: stagInterrupt

void stagInterrupt(void)
{
    g_stag.moveLegs();

    float a, b, c;

    for (int i = 0; i < 4; i++)
    {
        g_stag.getLeg(i, &a, &b, &c);

        /*
        puts("Leg ");
        puti(i+1);
        puts(" Value1: ");
        puti(servoPulseOffset[i*3] + a*angleToPulseFactor);
        puts(" Value2: ");
        puti(servoPulseOffset[i*3 + 1] + b*angleToPulseFactor);
        puts(" Value3: ");
        puti(servoPulseOffset[i*3 + 2] + c*angleToPulseFactor);
        putln();
        */

        servoWrite(legPins[i*3], servoPulseOffset[i*3] + a*angleToPulseFactor);
        servoWrite(legPins[i*3 + 1], servoPulseOffset[i*3 + 1] + b*angleToPulseFactor);
        servoWrite(legPins[i*3 + 2], servoPulseOffset[i*3 + 2] + c*angleToPulseFactor);
    }

    //putln();

    // Sensor feeds are sent from here

    ROM_TimerIntClear(WTIMER0_BASE, TIMER_TIMA_TIMEOUT);
}
开发者ID:hashbangproject,项目名称:Hashbot,代码行数:33,代码来源:main.cpp

示例15: SStop_WTimer2AISR

void SStop_WTimer2AISR(void){
	ROM_TimerIntClear(WTIMER2_BASE, TIMER_CAPA_EVENT);

	// Doc trang thai canh ngat
	if (GPIOPinRead(GPIO_PORTD_BASE,GPIO_PIN_0)&GPIO_PIN_0)
		ui32T_Edgeup_SStop = ROM_TimerValueGet(WTIMER2_BASE, TIMER_A);
	else
	{

		if (firstEdgeSStop)
		{
			firstEdgeSStop=0;
			return;
		}

		ui32T_Edgedown_SStop = ROM_TimerValueGet(WTIMER2_BASE, TIMER_A);

		i32DeltaT_SStop = (int32_t)(ui32T_Edgedown_SStop - ui32T_Edgeup_SStop);

		//				UARTPutn(UART0_BASE,i32DeltaT_SStop);
		//				UARTCharPut(UART0_BASE,'\n');

		if ((i32DeltaT_SStop<125000) && (i32DeltaT_SStop>115000))
			SSTOP_STOP;
		else if ((i32DeltaT_SStop>135000) && (i32DeltaT_SStop<145000) && isRunning)
			//both RF receiver and PC gui must start
			SSTOP_START;
	}
}
开发者ID:ndhuan,项目名称:AutomaticSprayingMachine,代码行数:29,代码来源:InterruptHandler.c


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