aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/TemperatureDataLogger/Lib/FATFs
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-01-24 11:13:23 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-01-24 11:13:23 +0000
commitdd995683ea1f233b79724d524a9a3dbcdc171d30 (patch)
tree9488b6e69cc9457fade5c7d4050a8941ac6da836 /Projects/TemperatureDataLogger/Lib/FATFs
parent03ee87b35abdb8b92e8b55ec040fa943f9a6786c (diff)
downloadlufa-dd995683ea1f233b79724d524a9a3dbcdc171d30.tar.gz
lufa-dd995683ea1f233b79724d524a9a3dbcdc171d30.tar.bz2
lufa-dd995683ea1f233b79724d524a9a3dbcdc171d30.zip
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.
Diffstat (limited to 'Projects/TemperatureDataLogger/Lib/FATFs')
-rw-r--r--Projects/TemperatureDataLogger/Lib/FATFs/diskio.c14
-rw-r--r--Projects/TemperatureDataLogger/Lib/FATFs/ffconf.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/Projects/TemperatureDataLogger/Lib/FATFs/diskio.c b/Projects/TemperatureDataLogger/Lib/FATFs/diskio.c
index e6be68734..0c0083bac 100644
--- a/Projects/TemperatureDataLogger/Lib/FATFs/diskio.c
+++ b/Projects/TemperatureDataLogger/Lib/FATFs/diskio.c
@@ -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);
}
diff --git a/Projects/TemperatureDataLogger/Lib/FATFs/ffconf.h b/Projects/TemperatureDataLogger/Lib/FATFs/ffconf.h
index 18510157d..9b414e979 100644
--- a/Projects/TemperatureDataLogger/Lib/FATFs/ffconf.h
+++ b/Projects/TemperatureDataLogger/Lib/FATFs/ffconf.h
@@ -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. */