⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pg_time.c

📁 一个移植到凌阳单片机spce061a上面的实时操作系统
💻 C
字号:
///////////////////////////////////////////////////////////////
//
//
//   PGOS : A Portable,Configable Embedded System Kernel
//
//             
//
//   This is an open source project under GPL lincence  
//
//        Version 0.9.0 ---- Development Snopshot
//
//   File name : pg_time.c : Time functions implemention  
//   History :
//
//          2005-07-24  First build by X.K. @ PGOS Team  
//          
/////////////////////////////////////////////////////////////////

#include "pgos.h"

#if  PG_TIME_SUPPORT  == 1

DWORD  pgos_time_sec ;
DWORD  pgos_time_min ;
DWORD  pgos_time_hour ;
DWORD  pgos_time_day ;


VOID    pgos_tim_clrtime( )
{
     pgos_time_sec = 0 ;
     pgos_time_min = 0 ;
     pgos_time_hour = 0;
     pgos_time_day = 0 ;
}

VOID    pgos_tim_process( )
{
     pgos_time_sec ++ ;
     if(  pgos_time_sec % 60 == 0 )
     {
         pgos_time_min ++ ;
	  if(  pgos_time_min % 60 == 0 )
	  {
	      pgos_time_hour ++ ;
	      if(  pgos_time_hour % 24 == 0 )
	      {
	           pgos_time_day ++ ;	           
	      }
	 }
    }
}


DWORD  pgos_tim_getsec( )
{
     return  pgos_time_sec ;
}

DWORD  pgos_tim_getmin(  )
{
    return pgos_time_min ;
}
DWORD  pgos_tim_gethour( )
{
    return pgos_time_hour ;
}
DWORD  pgos_tim_getday( )
{
    return pgos_time_day ;
}

#endif // TIME_SUPPORT

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -