Ejemplo n.º 1
0
/**
 * @brief       Timer-1 IRQ
 *
 * @param       None
 *
 * @return      None
 *
 * @details     The TIMER1 default IRQ, declared in startup_Mini51.s.
 */
void TMR1_IRQHandler(void)
{
#if 1
    TIMER_ClearIntFlag(TIMER1);
#else
    if (TIMER_GetIntFlag(TIMER1) == 1)
    {
        /* Clear TIMER1 Timeout Interrupt Flag */
        TIMER_ClearIntFlag(TIMER1);
    }else
    if (TIMER_GetCaptureIntFlag(TIMER1) == 1)
    {
        /* Clear TIMER1 Capture Interrupt Flag */
        TIMER_ClearCaptureIntFlag(TIMER1);
    }
#endif
    g_au32TMRINTCount++;
    if( brightlight_level[g_level_change] >=g_au32TMRINTCount )
    {
      /* dark lcd */
      P54 =1;       
    } else {
        /* bright lcd */        
        P54 = 0;  
        if(g_au32TMRINTCount>=100)
        {
            g_au32TMRINTCount=0;      
        } 
    }
}
Ejemplo n.º 2
0
__myevic__ void TMR2_IRQHandler()
{
    if ( TIMER_GetIntFlag( TIMER2 ) )
    {
        TIMER_ClearIntFlag( TIMER2 );

        gFlags.tick_1khz = 1;
        gFlags.tick_us = 1;

        if ( !(++TMR2Counter % 10) )
        {
            gFlags.tick_100hz = 1;
        }

        if ( gFlags.playing_fb )
        {
            if ( (!(TMR2Counter % 16) && dfFBSpeed == 0)
                    || (!(TMR2Counter % 13) && dfFBSpeed == 1)
                    || (!(TMR2Counter % 10) && dfFBSpeed == 2) )
            {
                fbTickTimeouts();
            }
        }
    }
}
Ejemplo n.º 3
0
void TMR0_IRQHandler(void)
{
    // Clear wake up flag
    TIMER_ClearWakeupFlag(TIMER0);
    // Clear interrupt flag
    TIMER_ClearIntFlag(TIMER0);
}
Ejemplo n.º 4
0
/**
 * @brief       Timer0 IRQ
 *
 * @param       None
 *
 * @return      None
 *
 * @details     The Timer0 default IRQ, declared in startup_NUC029xEE.s.
 */
void TMR0_IRQHandler(void)
{
    /* Clear Timer0 time-out interrupt flag */
    TIMER_ClearIntFlag(TIMER0);

    g_au32TMRINTCount[0]++;
}
Ejemplo n.º 5
0
void TMR0_IRQHandler(void)
{

    // clear timer interrupt flag
    TIMER_ClearIntFlag(TIMER0);
	prvvTIMERExpiredISR();
}
Ejemplo n.º 6
0
static void tmr0_vec(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname));
    
    // NOTE: us_ticker_set_interrupt() may get called in us_ticker_irq_handler();
    us_ticker_irq_handler();
}
Ejemplo n.º 7
0
void TMR2_IRQHandler(void)
{
	if(TIMER_GetIntFlag(TIMER2) == 1) {
		/* Clear Timer2 time-out interrupt flag */
		TIMER_ClearIntFlag(TIMER2);
		u32Timer2Cnt+=10;
	}
}
Ejemplo n.º 8
0
static void tmr3_vec(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(timer3_modinit.modname));
    TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(timer3_modinit.modname));
    cd_major_minor_ms -= cd_minor_ms;
    if (cd_major_minor_ms > 0) {
        lp_ticker_arm_cd();
    }
}
Ejemplo n.º 9
0
/**
 * @brief       Timer2 IRQ
 *
 * @param       None
 *
 * @return      None
 *
 * @details     The Timer2 default IRQ, declared in startup_NUC029xDE.s.
 */
void TMR2_IRQHandler(void)
{
    if(TIMER_GetIntFlag(TIMER2) == 1)
    {
        /* Clear Timer2 time-out interrupt flag */
        TIMER_ClearIntFlag(TIMER2);

        g_au32TMRINTCount[2]++;
    }
}
Ejemplo n.º 10
0
/**
 * @brief       Timer1 IRQ
 *
 * @param       None
 *
 * @return      None
 *
 * @details     The Timer1 default IRQ, declared in startup_M051Series.s.
 */
void TMR1_IRQHandler(void)
{
    if(TIMER_GetIntFlag(TIMER1) == 1)
    {
        /* Clear Timer1 time-out interrupt flag */
        TIMER_ClearIntFlag(TIMER1);

        g_au32TMRINTCount[1]++;
    }
}
//---------------------------------------------------------------------------------------------------------
// Timer1 interrupt handler                                                 
//---------------------------------------------------------------------------------------------------------
void TMR1_IRQHandler()
{
	TIMER_ClearIntFlag(TIMER1);
	
	TRIGGER_KEY_DEBOUNCE();
	MATRIX_KEY_DEBOUNCE();
	TOUCH_KEY_PRESS_COUNT();
	
	ULTRAIO_OUTCURVETMR1();
}
Ejemplo n.º 12
0
/**
 * @brief       Timer3 IRQ
 *
 * @param       None
 *
 * @return      None
 *
 * @details     The Timer3 default IRQ, declared in startup_NUC029xDE.s.
 */
void TMR3_IRQHandler(void)
{
    if(TIMER_GetIntFlag(TIMER3) == 1)
    {
        /* Clear Timer3 time-out interrupt flag */
        TIMER_ClearIntFlag(TIMER3);

        g_au32TMRINTCount[3]++;
    }
}
Ejemplo n.º 13
0
void TMR1_IRQHandler(void)
{
    /* Clear Timer1 time-out interrupt flag */
    TIMER_ClearIntFlag(TIMER1);

    ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
        _setMuxAddress(g_muxAddress);
        //stop mux ADC C discharge
        IO::enableFuncADC(IO::getADCChannel(MUX0_Z_D_PIN));
    }
}
Ejemplo n.º 14
0
static void tmr1_vec(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(timer1hires_modinit.modname));
    cd_major_minor_us = (cd_major_minor_us > cd_minor_us) ? (cd_major_minor_us - cd_minor_us) : 0;
    if (cd_major_minor_us == 0) {
        // NOTE: us_ticker_set_interrupt() may get called in us_ticker_irq_handler();
        us_ticker_irq_handler();
    }
    else {
        us_ticker_arm_cd();
    }
}
Ejemplo n.º 15
0
__myevic__ void TMR0_IRQHandler()
{
    if ( TIMER_GetIntFlag( TIMER0 ) )
    {
        TIMER_ClearIntFlag( TIMER0 );

        ++TMR0Counter;

        if ( WarmUpCounter )
            --WarmUpCounter;
    }
}
Ejemplo n.º 16
0
static void tmr3_vec(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(timer3_modinit.modname));
    TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(timer3_modinit.modname));
    cd_major_minor_clks = (cd_major_minor_clks > cd_minor_clks) ? (cd_major_minor_clks - cd_minor_clks) : 0;
    if (cd_major_minor_clks == 0) {
        // NOTE: lp_ticker_set_interrupt() may get called in lp_ticker_irq_handler();
        lp_ticker_irq_handler();
    } else {
        lp_ticker_arm_cd();
    }
}
Ejemplo n.º 17
0
__myevic__ void TMR1_IRQHandler()
{
    if ( TIMER_GetIntFlag( TIMER1 ) )
    {
        TIMER_ClearIntFlag( TIMER1 );

        gFlags.tick_5khz = 1;
        ++TMR1Counter;

        if ( gFlags.led_on )
        {
            LEDControl();
        }
    }
}
Ejemplo n.º 18
0
/*---------------------------------------------------------------------------------------------------------*/
void TMR3_IRQHandler(void)
{
	// clear Timer0 interrupt flag
	TIMER_ClearIntFlag(TIMER3);
	
	if(IR_Tx_stage==TRANSFER_START)
	{
		if(IR_bit_state==1)
		{
			// Enable PWM0 CH2 output
			PWM_DisableOutput(PWM0, PWM_CH_3_MASK);
			//Initial Timer0 to periodic mode with 222Hz(4.5ms)
			TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, START_TRAN_SECOND);
			TIMER_EnableInt(TIMER3);
			TIMER_Start(TIMER3);
			IR_bit_state=0;
			IR_Tx_stage=TRANSFER_CONT;
		}
	}
	else if(IR_Tx_stage==TRANSFER_CONT)
	{
		if(IR_TX_Byten<4)
		{
			IR_TranDATA();
		}
		else
		{
			if(IRTx_StopFlag==0)
			{
				PWM_EnableOutput(PWM0, PWM_CH_3_MASK);
				//Initial Timer0 to periodic mode with 1786Hz(560us)
				TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, TRAN_BIT_ZERO);
				TIMER_EnableInt(TIMER3);
				TIMER_Start(TIMER3);
				IRTx_StopFlag=1;
			}
			else if(IRTx_StopFlag==1)
			{
				PWM_DisableOutput(PWM0, PWM_CH_3_MASK);
				IR_TX_Bitn=0;
				IR_TX_Byten=0;
				IR_Tx_stage=TRANSFER_START;
				IRTx_StopFlag	=	0;
				IR_TxExecuteFLAG=0;
			}
		}
	}
}
Ejemplo n.º 19
0
/**
 * @brief       Timer0 IRQ
 *
 * @param       None
 *
 * @return      None
 *
 * @details     The Timer0 default IRQ, declared in startup_NUC029xEE.s.
 */
void TMR0_IRQHandler(void)
{
    if(TIMER_GetIntFlag(TIMER0) == 1) {
        /* Clear Timer0 time-out interrupt flag */
        TIMER_ClearIntFlag(TIMER0);

        g_au32TMRINTCount[0]++;
    }

    if(TIMER_GetWakeupFlag(TIMER0) == 1) {
        /* Clear Timer0 wake-up flag */
        TIMER_ClearWakeupFlag(TIMER0);

        g_u8IsTMR0WakeupFlag = 1;
    }
}
Ejemplo n.º 20
0
/*---------------------------------------------------------------------------------------------------------*/
void TMR1_IRQHandler(void)
{
    if(TIMER_GetIntFlag(TIMER1) == 1)
    {
        /* Clear Timer0 time-out interrupt flag */
        TIMER_ClearIntFlag(TIMER1);
				TMR1INTCount++;
    }

    if(TIMER_GetWakeupFlag(TIMER1) == 1)
    {
        /* Clear Timer0 wake-up flag */
        TIMER_ClearWakeupFlag(TIMER1);
				//printf("I'm awake by TMR.\n");
    }
}
Ejemplo n.º 21
0
__myevic__ void TMR3_IRQHandler()
{
    if ( TIMER_GetIntFlag( TIMER3 ) )
    {
        TIMER_ClearIntFlag( TIMER3 );

        gFlags.tick_10hz = 1;

        if ( !gFlags.has_x32 )
        {
            ClockCorrection += 1000;
        }

        if ( !(++TMR3Counter & 1) )
            gFlags.tick_5hz = 1;

        if ( !(TMR3Counter % 5) )
            gFlags.tick_2hz = 1;

        if ( !(TMR3Counter % 10) )
            gFlags.tick_1hz = 1;
    }
}
Ejemplo n.º 22
0
void us_ticker_clear_interrupt(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname));
}
Ejemplo n.º 23
0
static void tmr0_vec(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(timer0hires_modinit.modname));
    counter_major ++;
}
Ejemplo n.º 24
0
void us_ticker_clear_interrupt(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(timer1hires_modinit.modname));
}
Ejemplo n.º 25
0
	void TMR1_IRQHandler(void) { 
		TIMER_ClearIntFlag(TIMER1);
		if(TimerFuncPtr[1])	TimerFuncPtr[1](); 		
	}
Ejemplo n.º 26
0
static void tmr2_vec(void)
{
    TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
    TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
    counter_major ++;
}
Ejemplo n.º 27
0
	void TMR3_IRQHandler(void) { 
		TIMER_ClearIntFlag(TIMER3);
		if(TimerFuncPtr[3])	TimerFuncPtr[3](); 	
	}	
Ejemplo n.º 28
0
	void TMR2_IRQHandler(void) { 
		TIMER_ClearIntFlag(TIMER2);
		if(TimerFuncPtr[2])	TimerFuncPtr[2](); 
	}	
Ejemplo n.º 29
0
/*---------------------------------------------------------------------------------------------------------*/
void TMR3_IRQHandler(void)
{
    uint8_t LearnedDataByten;							//LearnedDataByten transfered from IR_Tx_LearnedDataByten
    // clear Timer0 interrupt flag
    TIMER_ClearIntFlag(TIMER3);

    if(IR_Tx_stage==TRANSFER_START && IR_bit_state==1)
    {
        // Enable PWM0 CH2 output
        PWM_DisableOutput(PWM0, PWM_CH_3_MASK);
        //Initial Timer0 to periodic mode with 222Hz(4.5ms)
        TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, START_TRAN_SECOND);
        TIMER_EnableInt(TIMER3);
        TIMER_Start(TIMER3);
        IR_bit_state=0;
        IR_Tx_stage=TRANSFER_CONT;
    }
    else if(IR_Tx_stage==TRANSFER_CONT)
    {
        if(IR_LearnedFlag==0)
        {
            if(IR_TX_Byten<4)
            {
                IR_TranDATA();
            }
            else
            {
                if(IRTx_StopFlag==0)
                {
                    PWM_EnableOutput(PWM0, PWM_CH_3_MASK);
                    //Initial Timer0 to periodic mode with 1786Hz(560us)
                    TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, TRAN_BIT_ZERO);
                    TIMER_EnableInt(TIMER3);
                    TIMER_Start(TIMER3);
                    IRTx_StopFlag=1;
                }
                else if(IRTx_StopFlag==1)
                {
                    PWM_DisableOutput(PWM0, PWM_CH_3_MASK);
                    IR_TX_Bitn = 0;
                    IR_TX_Byten = 0;
                    IR_Tx_stage=TRANSFER_START;
                    IRTx_StopFlag = 0;
                    IR_TxExecuteFLAG = 0;
                }
            }
        }
        else if(IR_LearnedFlag==1)
        {
            if(IRTx_StopFlag==1)
            {
                PWM_DisableOutput(PWM0, PWM_CH_3_MASK);
                IR_Tx_stage=TRANSFER_START;
                IR_TX_Bitn=0;
                IR_byte_state = 0;
                IRTx_StopFlag	=	0;
                IR_TxExecuteFLAG = 0;
            }
            else if(IR_TX_Bitn%2==0)
            {
                LearnedDataByten = IR_Tx_LearnedDataByten*2+IR_byte_state;
                PWM_EnableOutput(PWM0, PWM_CH_3_MASK);
                if(IR_LearnedData[LearnedDataByten] & (1 << (IR_LearnedDataLeng[IR_Tx_LearnedDataByten]/2 - IR_TX_Bitn - 1)))//IR_TX_Bitn*2
                    //Initial Timer0 to periodic mode with 1786Hz(560us)
                    TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, IR_FallingMaxFreq);
                else
                    TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, IR_FallingMinFreq);
                TIMER_EnableInt(TIMER3);
                TIMER_Start(TIMER3);
                IR_TX_Bitn++;
            }
            else if(IR_TX_Bitn%2==1)
            {
                LearnedDataByten = IR_Tx_LearnedDataByten*2+IR_byte_state;
                PWM_DisableOutput(PWM0, PWM_CH_3_MASK);
                if(IR_LearnedData[LearnedDataByten] & (1 << (IR_LearnedDataLeng[IR_Tx_LearnedDataByten]/2-IR_TX_Bitn-1)))//IR_TX_Bitn*2
                    //Initial Timer0 to periodic mode with 1786Hz(560us)
                    TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, IR_RisingMaxFreq);
                else
                    TIMER_Open(TIMER3, TIMER_ONESHOT_MODE, IR_RisingMinFreq);
                TIMER_EnableInt(TIMER3);
                TIMER_Start(TIMER3);
                IR_TX_Bitn++;
            }
            if(IR_TX_Bitn==32 && IR_byte_state == 0)
            {
                IR_TX_Bitn=0;
                IR_byte_state=1;
            }
            else if((IR_TX_Bitn+31==IR_LearnedDataLeng[IR_Tx_LearnedDataByten]) && (IR_byte_state == 1))
            {
                IRTx_StopFlag = 1;
            }
        }
    }
}
Ejemplo n.º 30
0
	void TMR0_IRQHandler(void) { 
		TIMER_ClearIntFlag(TIMER0);
		if(TimerFuncPtr[0])	TimerFuncPtr[0]();
	}