aboutsummaryrefslogtreecommitdiff
path: root/Projects/TempDataLogger/Lib/FATFs
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-01-13 19:14:38 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-01-13 19:14:38 +0000
commita866a8d602ffdb16222c08474bd9ac6ca590e964 (patch)
tree935e14ff32b504be415faa5f7e61aa6489797352 /Projects/TempDataLogger/Lib/FATFs
parent2f7a46b407efd4af639b728ea430a6b3f74d7e36 (diff)
Changed TempDataLogger project's DS1307 driver to simplify the function interface and prevent a possible race condition.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1631 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects/TempDataLogger/Lib/FATFs')
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/diskio.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/Projects/TempDataLogger/Lib/FATFs/diskio.c b/Projects/TempDataLogger/Lib/FATFs/diskio.c
index c1815128..40068773 100644
--- a/Projects/TempDataLogger/Lib/FATFs/diskio.c
+++ b/Projects/TempDataLogger/Lib/FATFs/diskio.c
@@ -83,18 +83,16 @@ DRESULT disk_ioctl (
DWORD get_fattime (void)
{
- uint8_t Day, Month, Year;
- uint8_t Hour, Minute, Second;
+ TimeDate_t CurrTimeDate;
- DS1307_GetDate(&Day, &Month, &Year);
- DS1307_GetTime(&Hour, &Minute, &Second);
+ DS1307_GetTimeDate(&CurrTimeDate);
- return ((DWORD)(20 + Year) << 25) |
- ((DWORD)Month << 21) |
- ((DWORD)Day << 16) |
- ((DWORD)Hour << 11) |
- ((DWORD)Minute << 5) |
- (((DWORD)Second >> 1) << 0);
+ return ((DWORD)(20 + CurrTimeDate.Year) << 25) |
+ ((DWORD)CurrTimeDate.Month << 21) |
+ ((DWORD)CurrTimeDate.Day << 16) |
+ ((DWORD)CurrTimeDate.Hour << 11) |
+ ((DWORD)CurrTimeDate.Minute << 5) |
+ (((DWORD)CurrTimeDate.Second >> 1) << 0);
}