PFsFatFormatter::format(partVol, fat_type, sectorBuffer, &Serialx);
PFsExFatFormatter::format(partVol, sectorBuffer, &Serial);
That's up next. Have a few errands to run today.Do we now have the ability to insert/append an ExFat partition?
@mjs513 - pushed up changes to MTP and MSC to build with current stuff... have not tested yet
m_capacityMB = (m_sectorCount + SECTORS_PER_MB - 1)/SECTORS_PER_MB;
Sounds good.
Will try to test some later today.... Maybe about time again to merge back into @wwaston master branch?
Yeah - think we made enough changes that its time to merge again. Still can't figure out whats going on with FAT and used space.
Teensy EXT4 file system testing
parent_blockdev = 536872984
ext4_mbr
mscInit()
<<< msReadBlocks(0 1 200)
ext4_mbr_scan:
mbr_entry 0:
offeset: 0x100000, 1MB
size: 0x3b9b00000, 15259MB
mbr_entry 1:
offeset: 0x3b9c00000, 15260MB
size: 0x37aa00000, 14250MB
mbr_entry 2:
empty/unknown
mbr_entry 3:
empty/unknown
mbr_scan() Passed
Lwext4 is an excellent choice for SD/MMC card, USB flash drive or any other wear
leveled memory types. However it is not good for raw flash devices.
#define FS_FILE_SUPPORT_DATES 1
... (File class)
#ifdef FS_FILE_SUPPORT_DATES
// These will all return false as only some FS support it.
virtual bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime) {
return (f) ? f->getAccessDateTime(pdate, ptime) : false;
}
virtual bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime) {
return (f) ? f->getCreateDateTime(pdate, ptime) : false;
}
virtual bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime){
return (f) ? f->getModifyDateTime(pdate, ptime) : false;
}
virtual bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second){return false;}
#endif
#ifdef FS_FILE_SUPPORT_DATES
// These will all return false as only some FS support it.
virtual bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime) {
return sdfatfile.getAccessDateTime(pdate, ptime);
}
virtual bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime) {
return sdfatfile.getCreateDateTime(pdate, ptime);
}
virtual bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime) {
return sdfatfile.getModifyDateTime(pdate, ptime);
}
virtual bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second) {
return sdfatfile.timestamp(flags, year, month, day, hour, minute, second);
}
#endif
#ifdef FS_FILE_SUPPORT_DATES
// These will all return false as only some FS support it.
virtual bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime) {
return mscfatfile.getAccessDateTime(pdate, ptime);
}
virtual bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime) {
return mscfatfile.getCreateDateTime(pdate, ptime);
}
virtual bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime) {
return mscfatfile.getModifyDateTime(pdate, ptime);
}
virtual bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second) {
//return mscfatfile.timestamp(year, month, day, hour, minute, second);
return false;
}
#endif
#ifdef FS_FILE_SUPPORT_DATES
// These will all return false as only some FS support it.
virtual bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime){
*pdate = 0; *ptime = 0; return false;
}
virtual bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime){
*pdate = 0; *ptime = 0; return false;
}
virtual bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime){
*pdate = 0; *ptime = 0; return false;
}
virtual bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second){return false;}
#endif
Only found that yesterday after you posted about date-time in LFS. I did just look to see if the custom attribute stuff was merged and it looks like it was but haven't tried it yet. Been distracted with the MicroMod board.KurtE said:@mjs513 - That link looks interesting. Have you tried the stuff in it to see, how hard it might be to have a modify date? Also is his stuff already in LittleFS, I know that the issue you linked to was linked to by another issue/PR which looks like parts of stuff were merged.
// Returns the size of the attribute, or a negative error code on failure.
// Note, the returned size is the size of the attribute on disk, irrespective
// of the size of the buffer. This can be used to dynamically allocate a buffer
// or check for existance.
lflfs_ssize_t lfs_getattr(lfs_t *lfs, const char *path,
uint8_t type, void *buffer, lfs_size_t size);
// Set custom attributes
//
// Custom attributes are uniquely identified by an 8-bit type and limited
// to LFS_ATTR_MAX bytes. If an attribute is not found, it will be
// implicitly created.
//
// Returns a negative error code on failure.
int lfs_setattr(lfs_t *lfs, const char *path,
uint8_t type, const void *buffer, lfs_size_t size);
DATA:100c(SEND_OBJECT_INFO)l: 168 T:31 : 0 3000 5222 3000 0
SendObjectInfo: 131073 4294967295 20005220: 0 3000 0 5222 3000 0 0 0 d8 f2 18 0 0 0 0 : halloween.jpg
Read DateTime string: 20210402T102729.0
>> date: 5282 2021 4 2
>> time: 536e 10 27 29
Created: 5282 536e
Read DateTime string: 20041101T215234.0
>> date: 3161 2004 11 1
>> time: ae91 21 52 34
Modified: 3161 ae91
CMD: 100c(SEND_OBJECT_INFO)l: 20 T:190 : 20001 ffffffff
DATA:100c(SEND_OBJECT_INFO)l: 176 T:190 : 0 3000 60109 3000 0
SendObjectInfo: 131073 4294967295 20005220: 0 3000 0 60109 3000 0 0 0 568 35c 18 0 0 0 0 : T4.1-Cardlike.jpg
Read DateTime string: [COLOR="#FF0000"]20210403T062400.0[/COLOR]
>> date: 5283 2021 4 3
>> time: 3300 6 24 0
Created: 5283 3300
Read DateTime string: [COLOR="#FF0000"]20210124T062334.0[/COLOR]
>> date: 5238 2021 1 24
>> time: 32f1 6 23 34
Modified: 5238 32f1
RESP:2001(RSP:OK)l: 24 T:190 : 20001 ffffffff 2b
CMD: 100d(SEND_OBJECT)l: 12 T:191
MTPD::SendObject: len:393481
# USB Packets: 768 total: 16 avg ms: 0 max: 1
# Write: 49 total:208 avg ms: 4 max: 65
>>>Total Time: 234403
#ifdef FS_FILE_SUPPORT_DATES
// These will all return false as only some FS support it.
virtual bool getAccessDateTime(uint16_t* pdate, uint16_t* ptime) {
return (f) ? f->getAccessDateTime(pdate, ptime) : false;
}
virtual bool getCreateDateTime(uint16_t* pdate, uint16_t* ptime) {
return (f) ? f->getCreateDateTime(pdate, ptime) : false;
}
virtual bool getModifyDateTime(uint16_t* pdate, uint16_t* ptime) {
return (f) ? f->getModifyDateTime(pdate, ptime) : false;
}
virtual bool timestamp(uint8_t flags, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second) {
return (f) ? f->timestamp(flags, year, month, day, hour, minute, second) : false;
}
#endif