Example #1
0
/**************************************************************************//**
 * @brief TIMER0_IRQHandler
 * Interrupt Service Routine TIMER0 Interrupt Line
 *****************************************************************************/
void TIMER2_IRQHandler(void)
{ 
  	uint32_t compareValue;
  
  	/* Clear flag for TIMER0 overflow interrupt */
  	TIMER_IntClear(TIMER2, TIMER_IF_OF);
  	
  	TIMER_CompareBufSet(TIMER2, 0, TIMER_CaptureGet(TIMER2, 0));
  	TIMER_CompareBufSet(TIMER2, 1, TIMER_CaptureGet(TIMER2, 1));
}
Example #2
0
/***************************************************************************//**
 * @brief
 *   RxTimer, Timer0 IRQHandler.
 ******************************************************************************/
void TIMER0_IRQHandler(void)
{
	uint32_t irqFlags;

  irqFlags = TIMER_IntGet(HIJACK_RX_TIMER);
  TIMER_IntClear(HIJACK_RX_TIMER, irqFlags);
	
 	if (TIMER_IF_CC0 & irqFlags)
  {
		cur_stamp = TIMER_CaptureGet(HIJACK_RX_TIMER, 0);

		/* Check what transition it was. */
    if(ACMP0->STATUS & ACMP_STATUS_ACMPOUT)
    {
    	cur_edge = rising;
			//BSP_LedSet( 0 );
      GPIO_PinOutSet(gpioPortD, 5);
			//Debug_Print( "%d ", cur_stamp ) ;
    }
    else
    {
    	cur_edge = falling;
			//BSP_LedClear( 0 );
      GPIO_PinOutClear(gpioPortD, 5);
			//Debug_Print( "%d ", cur_stamp ) ;
    }
		decode_machine();
  }
}
Example #3
0
/***************************************************************************//**
 * @brief
 *   RxTimer, Timer0 IRQHandler.
 ******************************************************************************/
void TIMER0_IRQHandler(void)
{
  uint32_t irqFlags;

  irqFlags = TIMER_IntGet(HIJACK_RX_TIMER);
  TIMER_IntClear(HIJACK_RX_TIMER, irqFlags);

  if (TIMER_IF_CC1 & irqFlags)
  {
	cur_stamp = TIMER_CaptureGet(HIJACK_RX_TIMER, 1);
	TIMER_CounterSet(HIJACK_RX_TIMER, 0);	
	edge_occur = true;
	/* Check what transition it was. */
    if (GPIO_PinInGet(HIJACK_RX_GPIO_PORT, HIJACK_RX_GPIO_PIN))
    {
       	cur_edge = rising;
		BSP_LedSet( 0 );
    }
    else
    {
      	cur_edge = falling;
	 	BSP_LedClear( 0 );
    }
  }
}
Example #4
0
void TIMER_IRQHandler( void )
{
  uint32_t flags;

  flags = TIMER_IntGet( TIMER );

  if ( flags & TIMER_IF_CC0 )
  {
    TIMER_IntClear( TIMER, TIMER_IFC_CC0 );
    TIMER_CompareSet( TIMER, 0, TIMER_CaptureGet( TIMER, 0 ) + ticksPrMs );
    TimerTick();
  }
}
Example #5
0
float pwmout_read(pwmout_t *obj)
{
    return pwmout_calculate_duty(TIMER_CaptureGet(PWM_TIMER, obj->channel), TIMER_TopGet(PWM_TIMER));
}