Skip to content

Commit

Permalink
update to MLA release (FILEIO v1.05)
Browse files Browse the repository at this point in the history
• Speed improvement when searching for free cluster to create new file. By starting at the last successfully found cluster
rather than the start of the drive.
• Fixes issue of writing after seeking causing trailing 0s in the file.
• Fixes error in DirectoryRemove failing to correctly delete folder when folder contains previously deleted folders/files.
• Fixes issue where a file marked with 8.3 designator not recognized as 8.3 file.
• Speed improvements for the seek function.
• Fixes issue where some drives may not mount successfully.
• Fixes issue where format request may not happen successfully.
  • Loading branch information
davidflowers committed Nov 29, 2018
1 parent cbe56de commit baf91a7
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 191 deletions.
Binary file removed doc/help_mla_fileio.jar
Binary file not shown.
Binary file modified doc/help_mla_fileio.pdf
Binary file not shown.
32 changes: 14 additions & 18 deletions drivers/internal_flash/internal_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,13 @@ uint8_t FILEIO_InternalFlash_SectorWrite(void* config, uint32_t sector_addr, uin
//Write the data
#if defined(__XC8)
TABLAT = *p++;
#asm
tblwtpostinc
#endasm
sectorCounter++;
#elif defined(__18CXX)
TABLAT = *p++;
_asm tblwtpostinc _endasm
#if defined(__CLANG__)
asm("tblwtpostinc");
#else
#asm
tblwtpostinc
#endasm
#endif
sectorCounter++;
#endif

Expand All @@ -629,22 +629,18 @@ uint8_t FILEIO_InternalFlash_SectorWrite(void* config, uint32_t sector_addr, uin
//Now commit/write the block of data from the programming latches into the flash memory
#if defined(__XC8)
// Start the write process: for PIC18, first need to reposition tblptr back into memory block that we want to write to.
#asm
tblrdpostdec
#endasm
#if defined(__CLANG__)
asm("tblrdpostdec");
#else
#asm
tblrdpostdec
#endasm
#endif

// Write flash memory, enable write control.
EECON1 = 0x84;
UnlockAndActivate(NVM_UNLOCK_KEY);
TBLPTR++;
#elif defined(__18CXX)
// Start the write process: for PIC18, first need to reposition tblptr back into memory block that we want to write to.
_asm tblrdpostdec _endasm

// Write flash memory, enable write control.
EECON1 = 0x84;
UnlockAndActivate(NVM_UNLOCK_KEY);
TBLPTR++;
#endif
}//while(i-- > 0)
}//if(foundDifference == true)
Expand Down
2 changes: 1 addition & 1 deletion drivers/sd_spi/sd_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ please contact [email protected]
#include <stdint.h>
#include <stdbool.h>

#include <fileio_media.h>
#include "fileio_media.h"

/*****************************************************************************/
/* Custom structures and definitions */
Expand Down
14 changes: 7 additions & 7 deletions inc/fileio.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ please contact [email protected]
#include "fileio_config.h"
#include "system.h"

#include <fileio_media.h>
#include "fileio_media.h"


/*******************************************************************/
Expand Down Expand Up @@ -404,9 +404,9 @@ typedef union
{
struct
{
uint16_t day : 5; // Day (1-31)
uint16_t month : 4; // Month (1-12)
uint16_t year : 7; // Year (number of years since 1980)
unsigned day : 5; // Day (1-31)
unsigned month : 4; // Month (1-12)
unsigned year : 7; // Year (number of years since 1980)
} bitfield;
uint16_t value;
} FILEIO_DATE;
Expand All @@ -416,9 +416,9 @@ typedef union
{
struct
{
uint16_t secondsDiv2 : 5; // (Seconds / 2) ( 1-30)
uint16_t minutes : 6; // Minutes ( 1-60)
uint16_t hours : 5; // Hours (1-24)
unsigned secondsDiv2 : 5; // (Seconds / 2) ( 1-30)
unsigned minutes : 6; // Minutes ( 1-60)
unsigned hours : 5; // Hours (1-24)
} bitfield;
uint16_t value;
} FILEIO_TIME;
Expand Down
Loading

0 comments on commit baf91a7

Please sign in to comment.