diff --git a/ff_stdio.c b/ff_stdio.c index 0ea0791..f6317c0 100755 --- a/ff_stdio.c +++ b/ff_stdio.c @@ -1489,8 +1489,14 @@ int ff_findnext( FF_FindData_t * pxFindData ) pxFindData->xDirectoryEntry.xCreateTime.Hour = ( uint16_t ) xTimeStruct.tm_hour; /* Hour (0 - 23). */ pxFindData->xDirectoryEntry.xCreateTime.Minute = ( uint16_t ) xTimeStruct.tm_min; /* Min (0 - 59). */ pxFindData->xDirectoryEntry.xCreateTime.Second = ( uint16_t ) xTimeStruct.tm_sec; /* Second (0 - 59). */ - pxFindData->xDirectoryEntry.xModifiedTime = pxFindData->xDirectoryEntry.xCreateTime; /* Date and Time Modified. */ - pxFindData->xDirectoryEntry.xAccessedTime = pxFindData->xDirectoryEntry.xCreateTime; /* Date of Last Access. */ + /* Date and Time Modified. */ + memcpy( &( pxFindData->xDirectoryEntry.xModifiedTime ), + &( pxFindData->xDirectoryEntry.xCreateTime ), + sizeof( pxFindData->xDirectoryEntry.xModifiedTime ) ); + /* Date of Last Access. */ + memcpy( &( pxFindData->xDirectoryEntry.xAccessedTime ), + &( pxFindData->xDirectoryEntry.xCreateTime ), + sizeof( pxFindData->xDirectoryEntry.xAccessedTime ) ); } } #endif /* ffconfigTIME_SUPPORT */ diff --git a/include/ff_dir.h b/include/ff_dir.h index 39a6305..cffa5e6 100755 --- a/include/ff_dir.h +++ b/include/ff_dir.h @@ -64,6 +64,8 @@ typedef struct uint32_t ulAddrCurrentCluster; uint32_t ulDirCluster; uint16_t usCurrentItem; + /* Insert 2 bytes to make the next struct 32-bit aligned. */ + uint16_t usFillerBytes; /* End Book Keeping. */ #if ( ffconfigTIME_SUPPORT != 0 )