예제 #1
0
파일: tarefas.c 프로젝트: monkaco/BRTOS
void System_Time(void)
{
   // task setup
   INT16U i = 0;

   OSResetTime();
   Init_Calendar();

   // task main loop
   for (;;)
   {
      #if (WATCHDOG == 1)
        __RESET_WATCHDOG();
      #endif

      DelayTask(10);
      i++;

      if (i >= 100)
      {
        i = 0;
        OSUpdateUptime();
        OSUpdateCalendar();
      }
   }
}
예제 #2
0
void System_Time(void)
{
   // task setup
   INT8U i = 0;
   INT8U cnt = 0;
   
   OSResetTime();
  
   // task main loop
   for (;;)
   {
      #if (WATCHDOG == 1)
        __RESET_WATCHDOG();
      #endif
      
      DelayTask(10);
      i++;
      
      VerifyNeighbourhoodLastIDTimeout();
      
      if (i >= 100)
      {
        OSUpdateUptime();
        i = 0;
      }
   }
}
예제 #3
0
파일: tasks.c 프로젝트: andrecurvello/demos
void System_Time(void)
{
   // task setup
   INT8U i = 0;
   OSResetTime();   
  
   /* task main loop */
   for (;;)
   {
      #if (WATCHDOG == 1)
        wdt_reset();
      #endif
      (void)DelayTask(10);
      i++;
      if (i >= 100)
      {
        OSUpdateUptime();
        i = 0;
      }
   }
}
예제 #4
0
void System_Time(void)
{
   // task setup
   INT8U i = 0;
   OSResetTime(&Hora); 
   OSResetDate(&Data);  
  
   /* task main loop */
   for (;;)
   {
      #if (WATCHDOG == 1)
        __asm
        CLRWDT
        __endasm;
      #endif
      (void)DelayTask(10);
      i++;
      if (i >= 100)
      {
        OSUpdateUptime(&Hora,&Data);
        i = 0;
      }
   }
}
예제 #5
0
파일: tasks.c 프로젝트: barriquello/uFSM_OS
void System_Time(void)
{
	// task setup
	INT16U milis = 0;
	INT16U segundos = 0;

	OSResetTime();

	led_onboard_init();
	
	led_onboard_on();
	
	#if RTC_PRESENTE
		while(Init_Calendar() == FALSE)
		{
			DelayTask(10);
			#if (WATCHDOG == 1)
				__RESET_WATCHDOG();
			#endif			
		}
	#endif	
	
	led_onboard_off();

	// task main loop
	for (;;)
	{
		#if (WATCHDOG == 1)
			__RESET_WATCHDOG();
		#endif     

		DelayTask(10);
		milis += 10;
		
		if (milis >= 1000)
		{
			milis = 0;
			
			OSUpdateUptime();
			OSUpdateCalendar();
			
			segundos++;
			if (segundos == 3600)
			{
				segundos = 0;
				
				#if RTC_PRESENTE				
					Resync_calendar();  // resync with RTC every 3600s = 60min = 1h
				#endif				
				
			}
		}

		///////////////////////////////////////////////////
		///   FatFS Timer Handler                       ///
		///////////////////////////////////////////////////
		disk_timerproc();
		///////////////////////////////////////////////////        
	}

}