diff options
author | James Buren <braewoods+rb@braewoods.net> | 2021-07-03 00:19:58 +0000 |
---|---|---|
committer | James Buren <braewoods+rb@braewoods.net> | 2021-07-03 00:19:58 +0000 |
commit | c9f2308a1d4401ceefaac47b1ea851530d07e47d (patch) | |
tree | 81f75a26707bd8583f5117a7a0febba894787996 /firmware/drivers/fat.c | |
parent | d1a92aafff55defefcb8cf8f4b045701325088b2 (diff) | |
download | rockbox-c9f2308a1d4401ceefaac47b1ea851530d07e47d.tar.gz rockbox-c9f2308a1d4401ceefaac47b1ea851530d07e47d.zip |
fat: move fattime_mktime to timefuncs
This moves the time conversion function to timefuncs since it has
uses on ports that don't use the FAT driver. This function has no
dependency on the FAT driver as it is so this should not cause any
issues. To reflect this separation the function was renamed to
dostime_mktime since it is really for DOS timestamps. The places
where it was used have also been updated.
Change-Id: Id98b1448d5c6fcda286846e1d2c736db682bfb52
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r-- | firmware/drivers/fat.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index 337e29a1bc..cc9735d0f7 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c | |||
@@ -2954,20 +2954,6 @@ void fat_empty_fat_direntry(struct fat_direntry *entry) | |||
2954 | entry->firstcluster = 0; | 2954 | entry->firstcluster = 0; |
2955 | } | 2955 | } |
2956 | 2956 | ||
2957 | time_t fattime_mktime(uint16_t fatdate, uint16_t fattime) | ||
2958 | { | ||
2959 | /* this knows our mktime() only uses these struct tm fields */ | ||
2960 | struct tm tm; | ||
2961 | tm.tm_sec = ((fattime ) & 0x1f) * 2; | ||
2962 | tm.tm_min = ((fattime >> 5) & 0x3f); | ||
2963 | tm.tm_hour = ((fattime >> 11) ); | ||
2964 | tm.tm_mday = ((fatdate ) & 0x1f); | ||
2965 | tm.tm_mon = ((fatdate >> 5) & 0x0f) - 1; | ||
2966 | tm.tm_year = ((fatdate >> 9) ) + 80; | ||
2967 | |||
2968 | return mktime(&tm); | ||
2969 | } | ||
2970 | |||
2971 | void fat_init(void) | 2957 | void fat_init(void) |
2972 | { | 2958 | { |
2973 | dc_lock_cache(); | 2959 | dc_lock_cache(); |