📄 fs_time.c
字号:
/*----------------------------------------------------------------------------
* R T L - F l a s h F i l e S y s t e m
*----------------------------------------------------------------------------
* Name: FS_TIME.C
* Purpose: File System Time Support Functions
* Rev.: V3.22
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2008 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include <RTL.h>
/*----------------------------------------------------------------------------
* FS Time Functions
*----------------------------------------------------------------------------
* Required functions for File System Time Support
* - U32 fs_get_time ()
* - U32 fs_get_date ()
*---------------------------------------------------------------------------*/
/*--------------------------- fs_get_time -----------------------------------*/
U32 fs_get_time (void) {
/* Return Current Time for FAT File Time stamp. */
U32 h,m,s,time;
/* Modify here, add a system call to read RTC. */
/* Hours: 0 - 23 */
/* Minutes: 0 - 59 */
/* Seconds: 0 - 59 */
h = 12;
m = 0;
s = 0;
time = (h << 16) | (m << 8) | s;
return (time);
}
/*--------------------------- fs_get_date -----------------------------------*/
U32 fs_get_date (void) {
/* Return Current Date for FAT File Time stamp. */
U32 d,m,y,date;
/* Modify here, add a system call to read RTC. */
/* Day: 1 - 31 */
/* Month: 1 - 12 */
/* Year: 1980 - 2107 */
d = 1;
m = 1;
y = 2008;
date = (y << 16) | (m << 8) | d;
return (date);
}
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -