diff options
author | tmk <hasu@tmk-kbd.com> | 2015-05-13 11:13:10 +0900 |
---|---|---|
committer | tmk <hasu@tmk-kbd.com> | 2015-05-13 11:13:10 +0900 |
commit | f1f2066657f4a0998adc016c95d7e541b436e09f (patch) | |
tree | d056cb656b538c4f3a3c205363e0070976655e2e /tmk_core/protocol/lufa/LUFA-git/Projects/TempDataLogger/Lib/FATFs/diskio.c | |
parent | 1c73e574f109a17566db99e399bdf86007488d2a (diff) | |
parent | f6d56675f9f981c5464f0ca7a1fbb0162154e8c5 (diff) | |
download | qmk_firmware-f1f2066657f4a0998adc016c95d7e541b436e09f.tar.gz qmk_firmware-f1f2066657f4a0998adc016c95d7e541b436e09f.zip |
Merge commit 'f6d56675f9f981c5464f0ca7a1fbb0162154e8c5'
Diffstat (limited to 'tmk_core/protocol/lufa/LUFA-git/Projects/TempDataLogger/Lib/FATFs/diskio.c')
m--------- | tmk_core/protocol/lufa/LUFA-git | 0 | ||||
-rw-r--r-- | tmk_core/protocol/lufa/LUFA-git/Projects/TempDataLogger/Lib/FATFs/diskio.c | 98 |
2 files changed, 98 insertions, 0 deletions
diff --git a/tmk_core/protocol/lufa/LUFA-git b/tmk_core/protocol/lufa/LUFA-git deleted file mode 160000 -Subproject b6c18b2a7c544653efbe12a1d4e8ba65e7d83c3 diff --git a/tmk_core/protocol/lufa/LUFA-git/Projects/TempDataLogger/Lib/FATFs/diskio.c b/tmk_core/protocol/lufa/LUFA-git/Projects/TempDataLogger/Lib/FATFs/diskio.c new file mode 100644 index 0000000000..8cc8cd4049 --- /dev/null +++ b/tmk_core/protocol/lufa/LUFA-git/Projects/TempDataLogger/Lib/FATFs/diskio.c @@ -0,0 +1,98 @@ +/*-----------------------------------------------------------------------*/ +/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */ +/*-----------------------------------------------------------------------*/ +/* This is a stub disk I/O module that acts as front end of the existing */ +/* disk I/O modules and attach it to FatFs module with common interface. */ +/*-----------------------------------------------------------------------*/ + +#include "diskio.h" + +/*-----------------------------------------------------------------------*/ +/* Initialize a Drive */ + +DSTATUS disk_initialize ( + BYTE drv /* Physical drive number (0..) */ +) +{ + return FR_OK; +} + + + +/*-----------------------------------------------------------------------*/ +/* Return Disk Status */ + +DSTATUS disk_status ( + BYTE drv /* Physical drive number (0..) */ +) +{ + return FR_OK; +} + + + +/*-----------------------------------------------------------------------*/ +/* Read Sector(s) */ + +DRESULT disk_read ( + BYTE drv, /* Physical drive number (0..) */ + BYTE *buff, /* Data buffer to store read data */ + DWORD sector, /* Sector address (LBA) */ + BYTE count /* Number of sectors to read (1..128) */ +) +{ + DataflashManager_ReadBlocks_RAM(sector, count, buff); + return RES_OK; +} + + + +/*-----------------------------------------------------------------------*/ +/* Write Sector(s) */ + +#if _READONLY == 0 +DRESULT disk_write ( + BYTE drv, /* Physical drive number (0..) */ + const BYTE *buff, /* Data to be written */ + DWORD sector, /* Sector address (LBA) */ + BYTE count /* Number of sectors to write (1..128) */ +) +{ + DataflashManager_WriteBlocks_RAM(sector, count, buff); + return RES_OK; +} +#endif /* _READONLY */ + + + +/*-----------------------------------------------------------------------*/ +/* Miscellaneous Functions */ + +DRESULT disk_ioctl ( + BYTE drv, /* Physical drive number (0..) */ + BYTE ctrl, /* Control code */ + void *buff /* Buffer to send/receive control data */ +) +{ + if (ctrl == CTRL_SYNC) + return RES_OK; + else + return RES_PARERR; +} + + +DWORD get_fattime (void) +{ + TimeDate_t CurrTimeDate; + + RTC_GetTimeDate(&CurrTimeDate); + + + 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); +} + |