Enhance TemperatureDatalogger project -- add RTC capabilities so that data is logged along with the current time and date. Make logging interval configurable, set by a C# PC host application.
This commit is contained in:
parent
03ee87b35a
commit
dd995683ea
24 changed files with 1147 additions and 83 deletions
|
@ -83,5 +83,17 @@ DRESULT disk_ioctl (
|
|||
|
||||
DWORD get_fattime (void)
|
||||
{
|
||||
return (1UL << 25) | (1UL << 21) | (1UL << 16) | (1UL << 11) | (1UL << 5) | (1UL << 0);
|
||||
uint8_t Day, Month, Year;
|
||||
uint8_t Hour, Minute, Second;
|
||||
|
||||
DS1307_GetDate(&Day, &Month, &Year);
|
||||
DS1307_GetTime(&Hour, &Minute, &Second);
|
||||
|
||||
|
||||
return ((DWORD)(20 + Year) << 25) |
|
||||
((DWORD)Month << 21) |
|
||||
((DWORD)Day << 16) |
|
||||
((DWORD)Hour << 11) |
|
||||
((DWORD)Minute << 5) |
|
||||
(((DWORD)Second >> 1) << 0);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
/ 3: f_lseek is removed in addition to level 2. */
|
||||
|
||||
|
||||
#define _USE_STRFUNC 1 /* 0, 1 or 2 */
|
||||
#define _USE_STRFUNC 0 /* 0, 1 or 2 */
|
||||
/* To enable string functions, set _USE_STRFUNC to 1 or 2. */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue