__interrupt void TIMER0_A1_VECTOR_ISR(void)
{
	unsigned char ExitLpm = 0;
  
  /* callback when timer expires */
  switch(__even_in_range(TA0IV,0xE))
  {
  case 0: break;                  
  case 2: ExitLpm = pCrystalCallback1(); RemoveUser(1); break;
  case 4: ExitLpm = pCrystalCallback2(); RemoveUser(2); break;
  case 6: ExitLpm = pCrystalCallback3(); RemoveUser(3); break;                         
  case 8: ExitLpm = pCrystalCallback4(); RemoveUser(4); break;                         
  default: break;
  }
  
  if ( ExitLpm )
  {
    EXIT_LPM_ISR();  
  }
}
Ejemplo n.º 2
0
__interrupt void TIMER0_A1_VECTOR_ISR(void)
{
  unsigned char ExitLpm = 0;
  
  /* callback when timer expires */
  switch(__even_in_range(TA0IV,8))
  {
  /* remove the user first in case the callback is re-enabling this user */
  case 0: break;                  
  case 2: RemoveUser(1); ExitLpm = pCrystalCallback1(); break;
  case 4: RemoveUser(2); ExitLpm = pCrystalCallback2(); break;
  case 6: RemoveUser(3); ExitLpm = pCrystalCallback3(); break;
  case 8: RemoveUser(4); ExitLpm = pCrystalCallback4(); break;
  default: break;
  }
  
  if ( ExitLpm )
  {
    EXIT_LPM_ISR();  
  }
  
}