Exemple #1
0
inline result_t TimerM_Timer_fired(uint8_t arg_0xa3482e0){
  unsigned char result;
  switch (arg_0xa3482e0) {
    case 0:
      ServiceTimerFired(0);
      break;
    case 1:
	  ServiceTimerFired(1);
	  break;
    case 2:
	  ServiceTimerFired(2);
	  break;
    case 3: 
//mytimer_fired();
	break; 
    case 10:
      HPLCC2420InterruptM_FIFOTimer_fired();
	  break;
    case 11:
      HPLCC2420InterruptM_CCATimer_fired();
	  break;

    case 15:
	  mytimer_fired();
	  break; 
    default:
      result = TimerM_Timer_default_fired(arg_0xa3482e0);
    }
  return SUCCESS;
}
Exemple #2
0
//This function is called from the particular implementation!
//This function also contains platform related defintions 
//0, 1, 2, AND 10, 11 are reserved. User is suggested to start with id 20. 
inline result_t GenericTimerFired(uint8_t id)
{


    unsigned char result;
    
    //0, 1, 2 for threads
    switch (id)
    {
    case 0:
        ServiceTimerFired(0);
        break;
    case 1:
        ServiceTimerFired(1);
         break;
    case 2:
        ServiceTimerFired(2);
        break;
    case 3:
        ServiceTimerFired(3);
        break;
    case 4:
        ServiceTimerFired(4);
        break;
    case 5:
        ServiceTimerFired(5);
        break;
    case 6:
        ServiceTimerFired(6);
        break;
    case 7:
        ServiceTimerFired(7);
        break;
    case 9:

#ifdef PLATFORM_CPU_MEASURE
        
		cpucounter_history[loop++] = cpucounter; 
		cpucounter = 0; 
		if (loop == 20)
		loop = 0; 
             
        
#endif


        break;
#if defined(PLATFORM_AVR) && defined(RADIO_CC2420)
    case 10:
        hplcc2420interruptm_FIFOTimer_fired();
        break;
    case 11:
        hplcc2420interruptm_CCATimer_fired();
        break;
#endif
   case 12:
        #ifdef ENERGY_SHARE_SCHEDULING
        
         {energy_manager_increase_round();   
		  postTask(thread_task, 9);  
           
         }  
        #endif 		
			
		
	   break;  	  
    
	case 13:
        #ifdef TRACE_MEMORY_CONTENTS
          memoryReportTimerFired();
        #endif 
		
	    break; 
		
	case 14:
	    #ifdef TRACE_ENABLE
		 reportTrace();
		#endif 
		
		#ifdef BASE_MODE		
		restoreRadioState();
		#endif
	    
		break; 
		
	case 15:
	
		
		break; 	
		
	case 16:
	    
		#ifdef TRACE_MEMORY_CONTENTS
		  AMStandard_releaseLock();
		  lib_radio_set_channel(21); 
		 #endif 
		break;
		
		
    default:
        timercallbackinvoke(id);
        result = SUCCESS;
    }
    return SUCCESS;
}