mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-12-16 01:44:30 +08:00
Add FAT SL code and demo project.
This commit is contained in:
5
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/ReadMe.url
Normal file
5
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/ReadMe.url
Normal file
@@ -0,0 +1,5 @@
|
||||
[InternetShortcut]
|
||||
URL=http://www.freertos.org/fat
|
||||
IDList=
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
102
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/api/api_mdriver.h
Normal file
102
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/api/api_mdriver.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _API_MDRIVER_H_
|
||||
#define _API_MDRIVER_H_
|
||||
|
||||
#include "../version/ver_mdriver.h"
|
||||
#if VER_MDRIVER_MAJOR != 1 || VER_MDRIVER_MINOR != 0
|
||||
#error Incompatible MDRIVER version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short number_of_cylinders;
|
||||
unsigned short sector_per_track;
|
||||
unsigned short number_of_heads;
|
||||
unsigned long number_of_sectors;
|
||||
unsigned char media_descriptor;
|
||||
|
||||
unsigned short bytes_per_sector;
|
||||
} F_PHY;
|
||||
|
||||
/* media descriptor to be set in getphy function */
|
||||
#define F_MEDIADESC_REMOVABLE 0xf0
|
||||
#define F_MEDIADESC_FIX 0xf8
|
||||
|
||||
/* return bitpattern for driver getphy function */
|
||||
#define F_ST_MISSING 0x00000001
|
||||
#define F_ST_CHANGED 0x00000002
|
||||
#define F_ST_WRPROTECT 0x00000004
|
||||
|
||||
/* Driver definitions */
|
||||
typedef struct F_DRIVER F_DRIVER;
|
||||
|
||||
typedef int ( *F_WRITESECTOR )( F_DRIVER * driver, void * data, unsigned long sector );
|
||||
typedef int ( *F_READSECTOR )( F_DRIVER * driver, void * data, unsigned long sector );
|
||||
typedef int ( *F_GETPHY )( F_DRIVER * driver, F_PHY * phy );
|
||||
typedef long ( *F_GETSTATUS )( F_DRIVER * driver );
|
||||
typedef void ( *F_RELEASE )( F_DRIVER * driver );
|
||||
|
||||
typedef struct F_DRIVER
|
||||
{
|
||||
unsigned long user_data; /* user defined data */
|
||||
void * user_ptr; /* user define pointer */
|
||||
|
||||
/* driver functions */
|
||||
F_WRITESECTOR writesector;
|
||||
F_READSECTOR readsector;
|
||||
F_GETPHY getphy;
|
||||
F_GETSTATUS getstatus;
|
||||
F_RELEASE release;
|
||||
} _F_DRIVER;
|
||||
|
||||
typedef F_DRIVER *( *F_DRIVERINIT )( unsigned long driver_param );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _API_MDRIVER_H_ */
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _API_MDRIVER_RAM_H_
|
||||
#define _API_MDRIVER_RAM_H_
|
||||
|
||||
#include "api_mdriver.h"
|
||||
|
||||
#include "../version/ver_mdriver_ram.h"
|
||||
#if VER_MDRIVER_RAM_MAJOR != 1 || VER_MDRIVER_RAM_MINOR != 2
|
||||
#error Incompatible MDRIVER_RAM version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define F_RAM_DRIVE0 0
|
||||
|
||||
enum
|
||||
{
|
||||
MDRIVER_RAM_NO_ERROR
|
||||
, MDRIVER_RAM_ERR_SECTOR = 101
|
||||
, MDRIVER_RAM_ERR_NOTAVAILABLE
|
||||
};
|
||||
|
||||
F_DRIVER * ram_initfunc ( unsigned long driver_param );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _API_MDRIVER_RAM_H_ */
|
||||
|
||||
479
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/api/fat_sl.h
Normal file
479
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/api/fat_sl.h
Normal file
@@ -0,0 +1,479 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _API_FAT_SL_H_
|
||||
#define _API_FAT_SL_H_
|
||||
|
||||
#include "config_fat_sl.h"
|
||||
|
||||
#include "../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define F_MAXNAME 8 /* 8 byte name */
|
||||
#define F_MAXEXT 3 /* 3 byte extension */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char path[F_MAXPATH]; /* /directory1/dir2/ */
|
||||
char filename[F_MAXNAME]; /* filename */
|
||||
char fileext[F_MAXEXT]; /* extension */
|
||||
} F_NAME;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long cluster;
|
||||
unsigned long sector;
|
||||
unsigned long sectorend;
|
||||
unsigned long pos;
|
||||
} F_POS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char filename[F_MAXPATH]; /*file name+ext*/
|
||||
char name[F_MAXNAME]; /*file name*/
|
||||
char ext[F_MAXEXT]; /*file extension*/
|
||||
unsigned char attr; /*attribute of the file*/
|
||||
|
||||
unsigned short ctime; /*creation time*/
|
||||
unsigned short cdate; /*creation date*/
|
||||
unsigned long cluster;
|
||||
|
||||
long filesize; /*length of file*/
|
||||
|
||||
F_NAME findfsname; /*find properties*/
|
||||
F_POS pos;
|
||||
} F_FIND;
|
||||
|
||||
/* definitions for ctime */
|
||||
#define F_CTIME_SEC_SHIFT 0
|
||||
#define F_CTIME_SEC_MASK 0x001f /*0-30 in 2seconds*/
|
||||
#define F_CTIME_MIN_SHIFT 5
|
||||
#define F_CTIME_MIN_MASK 0x07e0 /*0-59 */
|
||||
#define F_CTIME_HOUR_SHIFT 11
|
||||
#define F_CTIME_HOUR_MASK 0xf800 /*0-23*/
|
||||
|
||||
|
||||
/* definitions for cdate */
|
||||
#define F_CDATE_DAY_SHIFT 0
|
||||
#define F_CDATE_DAY_MASK 0x001f /*0-31*/
|
||||
#define F_CDATE_MONTH_SHIFT 5
|
||||
#define F_CDATE_MONTH_MASK 0x01e0 /*1-12*/
|
||||
#define F_CDATE_YEAR_SHIFT 9
|
||||
#define F_CDATE_YEAR_MASK 0xfe00 /*0-119 (1980+value)*/
|
||||
|
||||
#define F_ATTR_ARC 0x20
|
||||
#define F_ATTR_DIR 0x10
|
||||
#define F_ATTR_VOLUME 0x08
|
||||
#define F_ATTR_SYSTEM 0x04
|
||||
#define F_ATTR_HIDDEN 0x02
|
||||
#define F_ATTR_READONLY 0x01
|
||||
|
||||
#define F_CLUSTER_FREE ( (unsigned long)0x00000000 )
|
||||
#define F_CLUSTER_RESERVED ( (unsigned long)0x0ffffff0 )
|
||||
#define F_CLUSTER_BAD ( (unsigned long)0x0ffffff7 )
|
||||
#define F_CLUSTER_LAST ( (unsigned long)0x0ffffff8 )
|
||||
#define F_CLUSTER_LASTF32R ( (unsigned long)0x0fffffff )
|
||||
|
||||
#define F_ST_MISSING 0x00000001
|
||||
#define F_ST_CHANGED 0x00000002
|
||||
#define F_ST_WRPROTECT 0x00000004
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long abspos;
|
||||
unsigned long filesize;
|
||||
unsigned long startcluster;
|
||||
unsigned long prevcluster;
|
||||
unsigned long relpos;
|
||||
unsigned char modified;
|
||||
unsigned char mode;
|
||||
unsigned char _tdata[F_SECTOR_SIZE];
|
||||
F_POS pos;
|
||||
F_POS dirpos;
|
||||
#if F_FILE_CHANGED_EVENT
|
||||
char filename[F_MAXPATH]; /* filename with full path */
|
||||
#endif
|
||||
} F_FILE;
|
||||
|
||||
enum
|
||||
{
|
||||
F_UNKNOWN_MEDIA
|
||||
, F_FAT12_MEDIA
|
||||
, F_FAT16_MEDIA
|
||||
, F_FAT32_MEDIA
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/* 0 */
|
||||
F_NO_ERROR,
|
||||
|
||||
/* 1 */ F_ERR_RESERVED_1,
|
||||
|
||||
/* 2 */ F_ERR_NOTFORMATTED,
|
||||
|
||||
/* 3 */ F_ERR_INVALIDDIR,
|
||||
|
||||
/* 4 */ F_ERR_INVALIDNAME,
|
||||
|
||||
/* 5 */ F_ERR_NOTFOUND,
|
||||
|
||||
/* 6 */ F_ERR_DUPLICATED,
|
||||
|
||||
/* 7 */ F_ERR_NOMOREENTRY,
|
||||
|
||||
/* 8 */ F_ERR_NOTOPEN,
|
||||
|
||||
/* 9 */ F_ERR_EOF,
|
||||
|
||||
/* 10 */ F_ERR_RESERVED_2,
|
||||
|
||||
/* 11 */ F_ERR_NOTUSEABLE,
|
||||
|
||||
/* 12 */ F_ERR_LOCKED,
|
||||
|
||||
/* 13 */ F_ERR_ACCESSDENIED,
|
||||
|
||||
/* 14 */ F_ERR_NOTEMPTY,
|
||||
|
||||
/* 15 */ F_ERR_INITFUNC,
|
||||
|
||||
/* 16 */ F_ERR_CARDREMOVED,
|
||||
|
||||
/* 17 */ F_ERR_ONDRIVE,
|
||||
|
||||
/* 18 */ F_ERR_INVALIDSECTOR,
|
||||
|
||||
/* 19 */ F_ERR_READ,
|
||||
|
||||
/* 20 */ F_ERR_WRITE,
|
||||
|
||||
/* 21 */ F_ERR_INVALIDMEDIA,
|
||||
|
||||
/* 22 */ F_ERR_BUSY,
|
||||
|
||||
/* 23 */ F_ERR_WRITEPROTECT,
|
||||
|
||||
/* 24 */ F_ERR_INVFATTYPE,
|
||||
|
||||
/* 25 */ F_ERR_MEDIATOOSMALL,
|
||||
|
||||
/* 26 */ F_ERR_MEDIATOOLARGE,
|
||||
|
||||
/* 27 */ F_ERR_NOTSUPPSECTORSIZE
|
||||
|
||||
/* 28 */, F_ERR_ALLOCATION
|
||||
|
||||
#if F_FS_THREAD_AWARE == 1
|
||||
/* 29 */, F_ERR_OS = 29
|
||||
#endif /* F_FS_THREAD_AWARE */
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long total;
|
||||
unsigned long free;
|
||||
unsigned long used;
|
||||
unsigned long bad;
|
||||
|
||||
unsigned long total_high;
|
||||
unsigned long free_high;
|
||||
unsigned long used_high;
|
||||
unsigned long bad_high;
|
||||
} F_SPACE;
|
||||
|
||||
enum
|
||||
{
|
||||
F_SEEK_SET /*Beginning of file*/
|
||||
, F_SEEK_CUR /*Current position of file pointer*/
|
||||
, F_SEEK_END /*End of file*/
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* for file changed events
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifndef F_FILE_CHANGED_EVENT
|
||||
#define F_FILE_CHANGED_EVENT 0
|
||||
#endif
|
||||
|
||||
#if F_FILE_CHANGED_EVENT
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char action;
|
||||
unsigned char flags;
|
||||
unsigned char attr;
|
||||
unsigned short ctime;
|
||||
unsigned short cdate;
|
||||
unsigned long filesize;
|
||||
char filename[F_MAXPATH];
|
||||
} ST_FILE_CHANGED;
|
||||
|
||||
typedef void ( *F_FILE_CHANGED_EVENTFUNC )( ST_FILE_CHANGED * fc );
|
||||
|
||||
extern F_FILE_CHANGED_EVENTFUNC f_filechangedevent;
|
||||
|
||||
#define f_setfilechangedevent( filechangeevent ) f_filechangedevent = filechangeevent
|
||||
|
||||
/* flags */
|
||||
|
||||
#define FFLAGS_NONE 0x00000000
|
||||
|
||||
#define FFLAGS_FILE_NAME 0x00000001
|
||||
#define FFLAGS_DIR_NAME 0x00000002
|
||||
#define FFLAGS_NAME 0x00000003
|
||||
#define FFLAGS_ATTRIBUTES 0x00000004
|
||||
#define FFLAGS_SIZE 0x00000008
|
||||
#define FFLAGS_LAST_WRITE 0x00000010
|
||||
|
||||
/* actions */
|
||||
|
||||
#define FACTION_ADDED 0x00000001
|
||||
#define FACTION_REMOVED 0x00000002
|
||||
#define FACTION_MODIFIED 0x00000003
|
||||
|
||||
#endif /* if F_FILE_CHANGED_EVENT */
|
||||
|
||||
unsigned char fn_initvolume ( F_DRIVERINIT initfunc );
|
||||
unsigned char fn_delvolume ( void );
|
||||
|
||||
unsigned char fn_getfreespace ( F_SPACE * pspace );
|
||||
|
||||
unsigned char fn_chdir ( const char * dirname );
|
||||
unsigned char fn_mkdir ( const char * dirname );
|
||||
unsigned char fn_rmdir ( const char * dirname );
|
||||
|
||||
unsigned char fn_findfirst ( const char * filename, F_FIND * find );
|
||||
unsigned char fn_findnext ( F_FIND * find );
|
||||
|
||||
long fn_filelength ( const char * filename );
|
||||
|
||||
unsigned char fn_close ( F_FILE * filehandle );
|
||||
F_FILE * fn_open ( const char * filename, const char * mode );
|
||||
|
||||
long fn_read ( void * buf, long size, long _size_t, F_FILE * filehandle );
|
||||
|
||||
long fn_write ( const void * buf, long size, long _size_t, F_FILE * filehandle );
|
||||
|
||||
unsigned char fn_seek ( F_FILE * filehandle, long offset, unsigned char whence );
|
||||
|
||||
long fn_tell ( F_FILE * filehandle );
|
||||
int fn_getc ( F_FILE * filehandle );
|
||||
int fn_putc ( int ch, F_FILE * filehandle );
|
||||
unsigned char fn_rewind ( F_FILE * filehandle );
|
||||
unsigned char fn_eof ( F_FILE * filehandle );
|
||||
|
||||
unsigned char fn_delete ( const char * filename );
|
||||
|
||||
unsigned char fn_seteof ( F_FILE * );
|
||||
|
||||
F_FILE * fn_truncate ( const char *, long );
|
||||
|
||||
unsigned char fn_getcwd ( char * buffer, unsigned char maxlen, char root );
|
||||
|
||||
unsigned char fn_hardformat ( unsigned char fattype );
|
||||
unsigned char fn_format ( unsigned char fattype );
|
||||
|
||||
unsigned char fn_getserial ( unsigned long * );
|
||||
|
||||
|
||||
#if F_FS_THREAD_AWARE == 1
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "semphr.h"
|
||||
#ifndef FS_MUTEX_DEFINED
|
||||
extern xSemaphoreHandle fs_lock_semaphore;
|
||||
#endif /* FS_MUTEX_DEFINED */
|
||||
|
||||
unsigned char fn_init ( void );
|
||||
#define f_init fn_init
|
||||
#define f_initvolume fn_initvolume
|
||||
#define f_delvolume fn_delvolume
|
||||
|
||||
unsigned char fr_hardformat ( unsigned char fattype );
|
||||
#define f_hardformat( fattype ) fr_hardformat( fattype )
|
||||
#define f_format( fattype ) fr_hardformat( fattype )
|
||||
|
||||
unsigned char fr_getcwd ( char * buffer, unsigned char maxlen, char root );
|
||||
#define f_getcwd( buffer, maxlen ) fr_getcwd( buffer, maxlen, 1 )
|
||||
|
||||
unsigned char fr_getfreespace ( F_SPACE * pspace );
|
||||
#define f_getfreespace fr_getfreespace
|
||||
|
||||
|
||||
unsigned char fr_chdir ( const char * dirname );
|
||||
#define f_chdir( dirname ) fr_chdir( dirname )
|
||||
unsigned char fr_mkdir ( const char * dirname );
|
||||
#define f_mkdir( dirname ) fr_mkdir( dirname )
|
||||
unsigned char fr_rmdir ( const char * dirname );
|
||||
#define f_rmdir( dirname ) fr_rmdir( dirname )
|
||||
|
||||
unsigned char fr_findfirst ( const char * filename, F_FIND * find );
|
||||
unsigned char fr_findnext ( F_FIND * find );
|
||||
#define f_findfirst( filename, find ) fr_findfirst( filename, find )
|
||||
#define f_findnext( find ) fr_findnext( find )
|
||||
|
||||
long fr_filelength ( const char * filename );
|
||||
#define f_filelength( filename ) fr_filelength( filename )
|
||||
|
||||
unsigned char fr_close ( F_FILE * filehandle );
|
||||
F_FILE * fr_open ( const char * filename, const char * mode );
|
||||
|
||||
long fr_read ( void * buf, long size, long _size_t, F_FILE * filehandle );
|
||||
|
||||
unsigned char fr_getserial ( unsigned long * );
|
||||
#define f_getserial( serial ) fr_getserial( serial )
|
||||
|
||||
unsigned char fr_flush ( F_FILE * f );
|
||||
#define f_flush( filehandle ) fr_flush( filehandle )
|
||||
|
||||
long fr_write ( const void * buf, long size, long _size_t, F_FILE * filehandle );
|
||||
#define f_write( buf, size, _size_t, filehandle ) fr_write( buf, size, _size_t, filehandle )
|
||||
|
||||
unsigned char fr_seek ( F_FILE * filehandle, long offset, unsigned char whence );
|
||||
#define f_seek( filehandle, offset, whence ) fr_seek( filehandle, offset, whence )
|
||||
|
||||
long fr_tell ( F_FILE * filehandle );
|
||||
#define f_tell( filehandle ) fr_tell( filehandle )
|
||||
int fr_getc ( F_FILE * filehandle );
|
||||
#define f_getc( filehandle ) fr_getc( filehandle )
|
||||
int fr_putc ( int ch, F_FILE * filehandle );
|
||||
#define f_putc( ch, filehandle ) fr_putc( ch, filehandle )
|
||||
unsigned char fr_rewind ( F_FILE * filehandle );
|
||||
#define f_rewind( filehandle ) fr_rewind( filehandle )
|
||||
unsigned char fr_eof ( F_FILE * filehandle );
|
||||
#define f_eof( filehandle ) fr_eof( filehandle )
|
||||
|
||||
unsigned char fr_delete ( const char * filename );
|
||||
#define f_delete( filename ) fr_delete( filename )
|
||||
|
||||
unsigned char fr_seteof ( F_FILE * );
|
||||
#define f_seteof( file ) fr_seteof( file )
|
||||
|
||||
F_FILE * fr_truncate ( const char *, long );
|
||||
#define f_truncate( filename, filesize ) fr_truncate( filename, filesize )
|
||||
|
||||
#define f_close( filehandle ) fr_close( filehandle )
|
||||
#define f_open( filename, mode ) fr_open( filename, mode )
|
||||
#define f_read( buf, size, _size_t, filehandle ) fr_read( buf, size, _size_t, filehandle )
|
||||
|
||||
#else /* F_FS_THREAD_AWARE */
|
||||
|
||||
unsigned char fn_init ( void );
|
||||
#define f_init fn_init
|
||||
#define f_initvolume fn_initvolume
|
||||
#define f_delvolume fn_delvolume
|
||||
|
||||
#define f_hardformat( fattype ) fn_hardformat( fattype )
|
||||
#define f_format( fattype ) fn_hardformat( fattype )
|
||||
|
||||
#define f_getcwd( buffer, maxlen ) fn_getcwd( buffer, maxlen, 1 )
|
||||
|
||||
unsigned char fn_getfreespace ( F_SPACE * pspace );
|
||||
#define f_getfreespace fn_getfreespace
|
||||
|
||||
|
||||
unsigned char fn_chdir ( const char * dirname );
|
||||
#define f_chdir( dirname ) fn_chdir( dirname )
|
||||
unsigned char fn_mkdir ( const char * dirname );
|
||||
#define f_mkdir( dirname ) fn_mkdir( dirname )
|
||||
unsigned char fn_rmdir ( const char * dirname );
|
||||
#define f_rmdir( dirname ) fn_rmdir( dirname )
|
||||
|
||||
unsigned char fn_findfirst ( const char * filename, F_FIND * find );
|
||||
unsigned char fn_findnext ( F_FIND * find );
|
||||
#define f_findfirst( filename, find ) fn_findfirst( filename, find )
|
||||
#define f_findnext( find ) fn_findnext( find )
|
||||
|
||||
#define f_filelength( filename ) fn_filelength( filename )
|
||||
|
||||
#define f_getserial( serial ) fn_getserial( serial )
|
||||
|
||||
unsigned char fn_flush ( F_FILE * f );
|
||||
#define f_flush( filehandle ) fn_flush( filehandle )
|
||||
|
||||
#define f_write( buf, size, _size_t, filehandle ) fn_write( buf, size, _size_t, filehandle )
|
||||
|
||||
#define f_seek( filehandle, offset, whence ) fn_seek( filehandle, offset, whence )
|
||||
|
||||
long fn_tell ( F_FILE * filehandle );
|
||||
#define f_tell( filehandle ) fn_tell( filehandle )
|
||||
int fn_getc ( F_FILE * filehandle );
|
||||
#define f_getc( filehandle ) fn_getc( filehandle )
|
||||
int fn_putc ( int ch, F_FILE * filehandle );
|
||||
#define f_putc( ch, filehandle ) fn_putc( ch, filehandle )
|
||||
unsigned char fn_rewind ( F_FILE * filehandle );
|
||||
#define f_rewind( filehandle ) fn_rewind( filehandle )
|
||||
unsigned char fn_eof ( F_FILE * filehandle );
|
||||
#define f_eof( filehandle ) fn_eof( filehandle )
|
||||
|
||||
unsigned char fn_delete ( const char * filename );
|
||||
#define f_delete( filename ) fn_delete( filename )
|
||||
|
||||
unsigned char fn_seteof ( F_FILE * );
|
||||
#define f_seteof( file ) fn_seteof( file )
|
||||
|
||||
F_FILE * fn_truncate ( const char *, long );
|
||||
#define f_truncate( filename, filesize ) fn_truncate( filename, filesize )
|
||||
|
||||
#define f_close( filehandle ) fn_close( filehandle )
|
||||
#define f_open( filename, mode ) fn_open( filename, mode )
|
||||
#define f_read( buf, size, _size_t, filehandle ) fn_read( buf, size, _size_t, filehandle )
|
||||
|
||||
#endif /* F_FS_THREAD_AWARE */
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* end of fat_sl.h
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*_API_FAT_SL_H_*/
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_FAT_SL_H
|
||||
#define _CONFIG_FAT_SL_H
|
||||
|
||||
#include "../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#include "../api/api_mdriver.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**
|
||||
** FAT SL user settings
|
||||
**
|
||||
**************************************************************************/
|
||||
#define F_SECTOR_SIZE 512u /* Disk sector size. */
|
||||
#define F_FS_THREAD_AWARE 1 /* Set to one if the file system will be access from more than one task. */
|
||||
#define F_MAXPATH 64 /* Maximum length a file name (including its full path) can be. */
|
||||
#define F_MAX_LOCK_WAIT_TICKS 20 /* The maximum number of RTOS ticks to wait when attempting to obtain a lock on the file system when F_FS_THREAD_AWARE is set to 1. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CONFIG_FAT_SL_H */
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_MDRIVER_RAM_H_
|
||||
#define _CONFIG_MDRIVER_RAM_H_
|
||||
|
||||
#include "../version/ver_mdriver_ram.h"
|
||||
#if VER_MDRIVER_RAM_MAJOR != 1 || VER_MDRIVER_RAM_MINOR != 2
|
||||
#error Incompatible MDRIVER_RAM version number!
|
||||
#endif
|
||||
|
||||
#define MDRIVER_RAM_SECTOR_SIZE 512 /* Sector size */
|
||||
|
||||
#define MDRIVER_RAM_VOLUME0_SIZE (128 * 1024) /* defintion for size of ramdrive0 */
|
||||
|
||||
#define MDRIVER_MEM_LONG_ACCESS 1 /* set this value to 1 if 32bit access available */
|
||||
|
||||
#endif /* ifndef _CONFIG_MDRIVER_RAM_H_ */
|
||||
|
||||
1219
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/dir.c
Normal file
1219
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/dir.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __DIR_H
|
||||
#define __DIR_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#define NTRES_LOW 0x08 /*lower case name*/
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char name[F_MAXNAME]; /* 8+3 */
|
||||
unsigned char ext[F_MAXEXT];
|
||||
unsigned char attr; /* 00ADVSHR */
|
||||
|
||||
unsigned char ntres; /* FAT32 only */
|
||||
unsigned char crttimetenth; /* FAT32 only */
|
||||
unsigned char crttime[2]; /* FAT32 only */
|
||||
unsigned char crtdate[2]; /* FAT32 only */
|
||||
unsigned char lastaccessdate[2]; /* FAT32 only */
|
||||
|
||||
unsigned char clusterhi[2]; /* FAT32 only */
|
||||
unsigned char ctime[2];
|
||||
unsigned char cdate[2];
|
||||
unsigned char clusterlo[2]; /* fat12,fat16,fat32 */
|
||||
unsigned char filesize[4];
|
||||
} F_DIRENTRY;
|
||||
|
||||
|
||||
unsigned char _f_getdirsector ( unsigned long );
|
||||
unsigned char _f_findfilewc ( char *, char *, F_POS *, F_DIRENTRY * *, unsigned char );
|
||||
unsigned char _f_findpath ( F_NAME *, F_POS * );
|
||||
unsigned long _f_getdecluster ( F_DIRENTRY * );
|
||||
|
||||
unsigned char _f_writedirsector ( void );
|
||||
void _f_setdecluster ( F_DIRENTRY *, unsigned long );
|
||||
unsigned char _f_addentry ( F_NAME *, F_POS *, F_DIRENTRY * * );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __DIR_H */
|
||||
216
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/drv.c
Normal file
216
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/drv.c
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../api/fat_sl.h"
|
||||
#include "../../psp/include/psp_string.h"
|
||||
|
||||
#include "drv.h"
|
||||
#include "util.h"
|
||||
#include "volume.h"
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
F_DRIVER * mdrv = NULL; /* driver structure */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_checkstatus
|
||||
*
|
||||
* checking a volume driver status, if media is removed or has been changed
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* error code or zero if successful
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char _f_checkstatus ( void )
|
||||
{
|
||||
if ( mdrv->getstatus != NULL )
|
||||
{
|
||||
if ( mdrv->getstatus( mdrv ) & ( F_ST_MISSING | F_ST_CHANGED ) )
|
||||
{
|
||||
gl_volume.state = F_STATE_NEEDMOUNT; /*card has been removed;*/
|
||||
return F_ERR_CARDREMOVED;
|
||||
}
|
||||
}
|
||||
|
||||
return F_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_writesector
|
||||
*
|
||||
* write sector data on a volume, it calls low level driver function, it
|
||||
* writes a complete sector
|
||||
*
|
||||
* INPUTS
|
||||
* sector - which physical sector
|
||||
*
|
||||
* RETURNS
|
||||
* error code or zero if successful
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char _f_writeglsector ( unsigned long sector )
|
||||
{
|
||||
unsigned char retry;
|
||||
|
||||
if ( mdrv->writesector == NULL )
|
||||
{
|
||||
gl_volume.state = F_STATE_NEEDMOUNT; /*no write function*/
|
||||
return F_ERR_ACCESSDENIED;
|
||||
}
|
||||
|
||||
if ( sector == (unsigned long)-1 )
|
||||
{
|
||||
if ( gl_file.modified )
|
||||
{
|
||||
sector = gl_file.pos.sector;
|
||||
}
|
||||
else
|
||||
{
|
||||
sector = gl_volume.actsector;
|
||||
}
|
||||
}
|
||||
|
||||
if ( sector != (unsigned long)-1 )
|
||||
{
|
||||
if ( mdrv->getstatus != NULL )
|
||||
{
|
||||
unsigned int status;
|
||||
|
||||
status = mdrv->getstatus( mdrv );
|
||||
|
||||
if ( status & ( F_ST_MISSING | F_ST_CHANGED ) )
|
||||
{
|
||||
gl_volume.state = F_STATE_NEEDMOUNT; /*card has been removed;*/
|
||||
return F_ERR_CARDREMOVED;
|
||||
}
|
||||
|
||||
if ( status & ( F_ST_WRPROTECT ) )
|
||||
{
|
||||
gl_volume.state = F_STATE_NEEDMOUNT; /*card has been removed;*/
|
||||
return F_ERR_WRITEPROTECT;
|
||||
}
|
||||
}
|
||||
|
||||
gl_volume.modified = 0;
|
||||
gl_file.modified = 0;
|
||||
gl_volume.actsector = sector;
|
||||
for ( retry = 3 ; retry ; retry-- )
|
||||
{
|
||||
int mdrv_ret;
|
||||
mdrv_ret = mdrv->writesector( mdrv, (unsigned char *)gl_sector, sector );
|
||||
if ( !mdrv_ret )
|
||||
{
|
||||
return F_NO_ERROR;
|
||||
}
|
||||
|
||||
if ( mdrv_ret == -1 )
|
||||
{
|
||||
gl_volume.state = F_STATE_NEEDMOUNT; /*card has been removed;*/
|
||||
return F_ERR_CARDREMOVED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return F_ERR_ONDRIVE;
|
||||
} /* _f_writeglsector */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_readsector
|
||||
*
|
||||
* read sector data from a volume, it calls low level driver function, it
|
||||
* reads a complete sector
|
||||
*
|
||||
* INPUTS
|
||||
* sector - which physical sector is read
|
||||
*
|
||||
* RETURNS
|
||||
* error code or zero if successful
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char _f_readglsector ( unsigned long sector )
|
||||
{
|
||||
unsigned char retry;
|
||||
unsigned char ret;
|
||||
|
||||
if ( sector == gl_volume.actsector )
|
||||
{
|
||||
return F_NO_ERROR;
|
||||
}
|
||||
|
||||
if ( gl_volume.modified || gl_file.modified )
|
||||
{
|
||||
ret = _f_writeglsector( (unsigned long)-1 );
|
||||
if ( ret )
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ( retry = 3 ; retry ; retry-- )
|
||||
{
|
||||
int mdrv_ret;
|
||||
mdrv_ret = mdrv->readsector( mdrv, (unsigned char *)gl_sector, sector );
|
||||
if ( !mdrv_ret )
|
||||
{
|
||||
gl_volume.actsector = sector;
|
||||
return F_NO_ERROR;
|
||||
}
|
||||
|
||||
if ( mdrv_ret == -1 )
|
||||
{
|
||||
gl_volume.state = F_STATE_NEEDMOUNT; /*card has been removed;*/
|
||||
return F_ERR_CARDREMOVED;
|
||||
}
|
||||
}
|
||||
|
||||
gl_volume.actsector = (unsigned long)-1;
|
||||
return F_ERR_ONDRIVE;
|
||||
} /* _f_readglsector */
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __DRV_H
|
||||
#define __DRV_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern F_DRIVER * mdrv; /* driver structure */
|
||||
|
||||
unsigned char _f_checkstatus ( void );
|
||||
unsigned char _f_readglsector ( unsigned long );
|
||||
unsigned char _f_writeglsector ( unsigned long );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __DRV_H */
|
||||
642
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/f_lock.c
Normal file
642
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/f_lock.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _F_RTOS_H
|
||||
#define _F_RTOS_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
unsigned char fr_init ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef _F_RTOS_H */
|
||||
|
||||
598
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/fat.c
Normal file
598
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/fat.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __FAT_H
|
||||
#define __FAT_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
unsigned char _f_getfatsector ( unsigned long );
|
||||
unsigned char _f_getclustervalue ( unsigned long, unsigned long * );
|
||||
void _f_clustertopos ( unsigned long, F_POS * );
|
||||
unsigned char _f_getcurrsector ( void );
|
||||
|
||||
unsigned char _f_writefatsector ( void );
|
||||
unsigned char _f_setclustervalue ( unsigned long, unsigned long );
|
||||
unsigned char _f_alloccluster ( unsigned long * );
|
||||
unsigned char _f_removechain ( unsigned long );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __FAT_H */
|
||||
1492
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/file.c
Normal file
1492
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/file.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __FILE_H
|
||||
#define __FILE_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define F_FILE_CLOSE 0x00
|
||||
#define F_FILE_RD 0x01
|
||||
#define F_FILE_WR 0x02
|
||||
#define F_FILE_A 0x04
|
||||
#define F_FILE_RDP 0x08
|
||||
#define F_FILE_WRP 0x10
|
||||
#define F_FILE_AP 0x20
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __FILE_H */
|
||||
320
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/util.c
Normal file
320
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/util.c
Normal file
@@ -0,0 +1,320 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../api/fat_sl.h"
|
||||
#include "../../psp/include/psp_rtc.h"
|
||||
#include "dir.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_getword
|
||||
*
|
||||
* get a word 16bit number from a memory (it uses LITTLE ENDIAN mode always)
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* ptr - pointer where data is
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* word number
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned short _f_getword ( void * ptr )
|
||||
{
|
||||
unsigned char * sptr = (unsigned char *)ptr;
|
||||
unsigned short ret;
|
||||
|
||||
ret = (unsigned short)( sptr[1] & 0xff );
|
||||
ret <<= 8;
|
||||
ret |= ( sptr[0] & 0xff );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_setword
|
||||
*
|
||||
* set a word 16bit number into a memory (it uses LITTLE ENDIAN mode always)
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* ptr - where to store data
|
||||
* num - 16 bit number to store
|
||||
*
|
||||
***************************************************************************/
|
||||
void _f_setword ( void * ptr, unsigned short num )
|
||||
{
|
||||
unsigned char * sptr = (unsigned char *)ptr;
|
||||
|
||||
sptr[1] = (unsigned char)( num >> 8 );
|
||||
sptr[0] = (unsigned char)( num );
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_getlong
|
||||
*
|
||||
* get a long 32bit number from a memory (it uses LITTLE ENDIAN mode always)
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* ptr - pointer where data is
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* long number
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned long _f_getlong ( void * ptr )
|
||||
{
|
||||
unsigned char * sptr = (unsigned char *)ptr;
|
||||
unsigned long ret;
|
||||
|
||||
ret = (unsigned long)( sptr[3] & 0xff );
|
||||
ret <<= 8;
|
||||
ret |= ( sptr[2] & 0xff );
|
||||
ret <<= 8;
|
||||
ret |= ( sptr[1] & 0xff );
|
||||
ret <<= 8;
|
||||
ret |= ( sptr[0] & 0xff );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_setlong
|
||||
*
|
||||
* set a long 32bit number into a memory (it uses LITTLE ENDIAN mode always)
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* ptr - where to store data
|
||||
* num - 32 bit number to store
|
||||
*
|
||||
***************************************************************************/
|
||||
void _f_setlong ( void * ptr, unsigned long num )
|
||||
{
|
||||
unsigned char * sptr = (unsigned char *)ptr;
|
||||
|
||||
sptr[3] = (unsigned char)( num >> 24 );
|
||||
sptr[2] = (unsigned char)( num >> 16 );
|
||||
sptr[1] = (unsigned char)( num >> 8 );
|
||||
sptr[0] = (unsigned char)( num );
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _setcharzero
|
||||
*
|
||||
* fills with zero charater to memory
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* num - number of characters
|
||||
* ptr - where to store data
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* last write position
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char * _setcharzero ( int num, unsigned char * ptr )
|
||||
{
|
||||
while ( num-- )
|
||||
{
|
||||
*ptr++ = 0;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _setchar
|
||||
*
|
||||
* copy a charater string to memory
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* array - original code what to copy
|
||||
* num - number of characters
|
||||
* ptr - where to store data
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* last write position
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char * _setchar ( const unsigned char * array, int num, unsigned char * ptr )
|
||||
{
|
||||
if ( !array )
|
||||
{
|
||||
return _setcharzero( num, ptr );
|
||||
}
|
||||
|
||||
while ( num-- )
|
||||
{
|
||||
*ptr++ = *array++;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _setword
|
||||
*
|
||||
* store a 16bit word into memory
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* num - 16bit number to store
|
||||
* ptr - where to store data
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* last write position
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char * _setword ( unsigned short num, unsigned char * ptr )
|
||||
{
|
||||
_f_setword( ptr, num );
|
||||
return ptr + 2;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _setlong
|
||||
*
|
||||
* store a 32bit long number into memory
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* num - 32bit number to store
|
||||
* ptr - where to store data
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* last write position
|
||||
*
|
||||
***************************************************************************/
|
||||
unsigned char * _setlong ( unsigned long num, unsigned char * ptr )
|
||||
{
|
||||
_f_setlong( ptr, num );
|
||||
return ptr + 4;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* _f_toupper
|
||||
*
|
||||
* convert a string into lower case
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* s - input string to convert
|
||||
*
|
||||
***************************************************************************/
|
||||
char _f_toupper ( char ch )
|
||||
{
|
||||
if ( ( ch >= 'a' ) && ( ch <= 'z' ) )
|
||||
{
|
||||
return (char)( ch - 'a' + 'A' );
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* f_igettimedate
|
||||
*
|
||||
* INPUTS
|
||||
* time - pointer to time variable
|
||||
* date - pointer to date variable
|
||||
* OUTPUTS
|
||||
* time - current time
|
||||
* date - current date
|
||||
*
|
||||
* RETURNS
|
||||
* none
|
||||
*
|
||||
***************************************************************************/
|
||||
void f_igettimedate ( unsigned short * time, unsigned short * date )
|
||||
{
|
||||
t_psp_timedate s_timedate;
|
||||
|
||||
psp_getcurrenttimedate( &s_timedate );
|
||||
|
||||
*time = ( ( (uint16_t)s_timedate.hour << F_CTIME_HOUR_SHIFT ) & F_CTIME_HOUR_MASK )
|
||||
| ( ( (uint16_t)s_timedate.min << F_CTIME_MIN_SHIFT ) & F_CTIME_MIN_MASK )
|
||||
| ( ( ( (uint16_t)s_timedate.sec >> 1 ) << F_CTIME_SEC_SHIFT ) & F_CTIME_SEC_MASK );
|
||||
|
||||
*date = ( ( ( s_timedate.year - 1980 ) << F_CDATE_YEAR_SHIFT ) & F_CDATE_YEAR_MASK )
|
||||
| ( ( (uint16_t)s_timedate.month << F_CDATE_MONTH_SHIFT ) & F_CDATE_MONTH_MASK )
|
||||
| ( ( (uint16_t)s_timedate.day << F_CDATE_DAY_SHIFT ) & F_CDATE_DAY_MASK );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __UTIL_H
|
||||
#define __UTIL_H
|
||||
|
||||
#include "util_sfn.h"
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void f_igettimedate ( unsigned short * time, unsigned short * date );
|
||||
|
||||
unsigned short _f_getword ( void * );
|
||||
unsigned long _f_getlong ( void * );
|
||||
char _f_toupper ( char );
|
||||
void _f_memset ( void *, unsigned char, int );
|
||||
void _f_memcpy ( void *, void *, int );
|
||||
|
||||
void _f_setword ( void *, unsigned short );
|
||||
void _f_setlong ( void *, unsigned long );
|
||||
unsigned char * _setcharzero ( int, unsigned char * );
|
||||
unsigned char * _setchar ( const unsigned char *, int, unsigned char * );
|
||||
unsigned char * _setword ( unsigned short, unsigned char * );
|
||||
unsigned char * _setlong ( unsigned long, unsigned char * );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __UTIL_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __UTIL_SFN_H
|
||||
#define __UTIL_SFN_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
unsigned char _f_checknamewc ( const char *, const char * );
|
||||
unsigned char _f_checkname ( char *, char * );
|
||||
|
||||
unsigned char _f_setnameext ( char *, char *, char * );
|
||||
unsigned char _f_setfsname ( const char *, F_NAME * );
|
||||
int _f_createfullname ( char * buffer, int buffersize, char * path, char * filename, char * fileext );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __UTIL_SFN_H */
|
||||
939
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/volume.c
Normal file
939
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/volume.c
Normal file
File diff suppressed because it is too large
Load Diff
113
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/volume.h
Normal file
113
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/common/volume.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __VOLUME_H
|
||||
#define __VOLUME_H
|
||||
|
||||
#include "config_fat_sl.h"
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char sector_per_cluster;
|
||||
unsigned char number_of_FATs;
|
||||
unsigned char media_descriptor;
|
||||
unsigned long rootcluster;
|
||||
unsigned long sector_per_FAT;
|
||||
unsigned long sector_per_FAT32;
|
||||
unsigned long serial_number;
|
||||
} F_BOOTRECORD;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long sector; /*start sector*/
|
||||
unsigned long num; /*number of sectors*/
|
||||
} F_SECTOR;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char state;
|
||||
F_BOOTRECORD bootrecord;
|
||||
F_SECTOR firstfat;
|
||||
F_SECTOR root;
|
||||
F_SECTOR _tdata;
|
||||
|
||||
unsigned long actsector;
|
||||
unsigned long fatsector;
|
||||
|
||||
unsigned long lastalloccluster;
|
||||
unsigned char modified;
|
||||
char cwd[F_MAXPATH]; /*current working folder in this volume*/
|
||||
unsigned char mediatype;
|
||||
unsigned long maxcluster;
|
||||
} F_VOLUME;
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
/* 0 */
|
||||
F_STATE_NONE,
|
||||
|
||||
/* 1 */ F_STATE_NEEDMOUNT,
|
||||
|
||||
/* 2 */ F_STATE_WORKING
|
||||
};
|
||||
|
||||
|
||||
extern F_VOLUME gl_volume;
|
||||
extern F_FILE gl_file;
|
||||
extern char gl_sector[F_SECTOR_SIZE]; /* actual sector */
|
||||
|
||||
unsigned char _f_getvolume ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __VOLUME_H */
|
||||
2752
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/test/test.c
Normal file
2752
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/test/test.c
Normal file
File diff suppressed because it is too large
Load Diff
116
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/test/test.h
Normal file
116
FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT-SL/fat_sl/test/test.h
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TEST_H
|
||||
#define __TEST_H
|
||||
|
||||
#include "../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3 || VER_FAT_SL_MINOR != 2
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Maximum size for seek test.
|
||||
** Options: 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768
|
||||
*/
|
||||
#define F_MAX_SEEK_TEST 16384
|
||||
|
||||
|
||||
/*
|
||||
** Defines media type for testing.
|
||||
** Options: F_FAT12_MEDIA, F_FAT16_MEDIA
|
||||
*/
|
||||
#define F_FAT_TYPE F_FAT12_MEDIA
|
||||
|
||||
|
||||
/*
|
||||
** Start filesystem test.
|
||||
** Parameter:
|
||||
** 0 - run all the tests
|
||||
**
|
||||
** 2 - directory
|
||||
** 3 - find
|
||||
**
|
||||
** 5* - seek 128
|
||||
** 6* - seek 256
|
||||
** 7* - seek 512
|
||||
** 8* - seek 1024
|
||||
** 9* - seek 2048
|
||||
** 10*- seek 4096
|
||||
** 11*- seek 8192
|
||||
** 12*- seek 16384
|
||||
** 13*- seek 32768
|
||||
** 14 - open
|
||||
** 15 - append
|
||||
** 16 - write
|
||||
** 17 - dots
|
||||
** 18 - rit
|
||||
** *Note that only seek tests allowed by F_MAX_SEEK_TEST are executed.
|
||||
**
|
||||
** The following defines are required for the specific test:
|
||||
** 1 1 1 1 1 1 1 1 1
|
||||
** 2 3 5 6 7 8 9 0 1 2 3 4 5 6 7 8
|
||||
** F_CHDIR x x - - - - - - - - - - x - x -
|
||||
** F_MKDIR x x - - - - - - - - - - - - x -
|
||||
** F_RMDIR x x - - - - - - - - - - x - x -
|
||||
** F_DELETE x x x x x x x x x x x x x x x x
|
||||
** F_FILELENGTH - - x x x x x x x x x x x x - -
|
||||
** F_FINDING x x - - - - - - - - - - x - - -
|
||||
** F_TELL - - x x x x x x x x x x x x - x
|
||||
** F_REWIND - - - - - - - - - - - x - - - -
|
||||
** F_EOF - - x x x x x x x x x - - x - -
|
||||
** F_SEEK - - x x x x x x x x x - x x - x
|
||||
** F_WRITE - - x x x x x x x x x x x x - x
|
||||
** F_WRITING x x x x x x x x x x x x x x x x
|
||||
** F_DIRECTORIES x x - - - - - - - - - - x - x -
|
||||
** F_CHECKNAME x - - - - - - - - - - - - - x -
|
||||
*/
|
||||
void f_dotest ( unsigned char );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef __TEST_H */
|
||||
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../api/api_mdriver_ram.h"
|
||||
#include "config_mdriver_ram.h"
|
||||
#include "../../psp/include/psp_string.h"
|
||||
|
||||
#include "../../version/ver_mdriver_ram.h"
|
||||
#if VER_MDRIVER_RAM_MAJOR != 1 || VER_MDRIVER_RAM_MINOR != 2
|
||||
#error Incompatible MDRIVER_RAM version number!
|
||||
#endif
|
||||
|
||||
|
||||
char ramdrv0[MDRIVER_RAM_VOLUME0_SIZE];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char * ramdrv;
|
||||
unsigned long maxsector;
|
||||
int use;
|
||||
F_DRIVER * driver;
|
||||
} t_RamDrv;
|
||||
|
||||
static F_DRIVER t_drivers[1];
|
||||
|
||||
static t_RamDrv RamDrv[1] =
|
||||
{
|
||||
{ ramdrv0, ( MDRIVER_RAM_VOLUME0_SIZE / MDRIVER_RAM_SECTOR_SIZE ), 0, &t_drivers[0] }
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Read one sector
|
||||
***************************************************************************/
|
||||
static int ram_readsector ( F_DRIVER * driver, void * data, unsigned long sector )
|
||||
{
|
||||
long len;
|
||||
char * d = (char *)data;
|
||||
char * s;
|
||||
t_RamDrv * p = (t_RamDrv *)( driver->user_ptr );
|
||||
|
||||
if ( sector >= p->maxsector )
|
||||
{
|
||||
return MDRIVER_RAM_ERR_SECTOR;
|
||||
}
|
||||
|
||||
s = p->ramdrv;
|
||||
s += sector * MDRIVER_RAM_SECTOR_SIZE;
|
||||
len = MDRIVER_RAM_SECTOR_SIZE;
|
||||
|
||||
#if MDRIVER_MEM_LONG_ACCESS
|
||||
if ( ( !( len & 3 ) ) && ( !( ( (long)d ) & 3 ) ) && ( !( ( (long)s ) & 3 ) ) )
|
||||
{
|
||||
long * dd = (long *)d;
|
||||
long * ss = (long *)s;
|
||||
len >>= 2;
|
||||
while ( len-- )
|
||||
{
|
||||
*dd++ = *ss++;
|
||||
}
|
||||
|
||||
return MDRIVER_RAM_NO_ERROR;
|
||||
}
|
||||
|
||||
#endif /* if MDRIVER_MEM_LONG_ACCESS */
|
||||
|
||||
while ( len-- )
|
||||
{
|
||||
*d++ = *s++;
|
||||
}
|
||||
|
||||
return MDRIVER_RAM_NO_ERROR;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Write one sector
|
||||
***************************************************************************/
|
||||
static int ram_writesector ( F_DRIVER * driver, void * data, unsigned long sector )
|
||||
{
|
||||
long len;
|
||||
char * s = (char *)data;
|
||||
char * d;
|
||||
t_RamDrv * p = (t_RamDrv *)( driver->user_ptr );
|
||||
|
||||
if ( sector >= p->maxsector )
|
||||
{
|
||||
return MDRIVER_RAM_ERR_SECTOR;
|
||||
}
|
||||
|
||||
d = p->ramdrv;
|
||||
d += sector * MDRIVER_RAM_SECTOR_SIZE;
|
||||
len = MDRIVER_RAM_SECTOR_SIZE;
|
||||
|
||||
#if MDRIVER_MEM_LONG_ACCESS
|
||||
if ( ( !( len & 3 ) ) && ( !( ( (long)d ) & 3 ) ) && ( !( ( (long)s ) & 3 ) ) )
|
||||
{
|
||||
long * dd = (long *)d;
|
||||
long * ss = (long *)s;
|
||||
len >>= 2;
|
||||
while ( len-- )
|
||||
{
|
||||
*dd++ = *ss++;
|
||||
}
|
||||
|
||||
return MDRIVER_RAM_NO_ERROR;
|
||||
}
|
||||
|
||||
#endif /* if MDRIVER_MEM_LONG_ACCESS */
|
||||
|
||||
while ( len-- )
|
||||
{
|
||||
*d++ = *s++;
|
||||
}
|
||||
|
||||
return MDRIVER_RAM_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* ram_getphy
|
||||
*
|
||||
* determinate ramdrive physicals
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* driver - driver structure
|
||||
* phy - this structure has to be filled with physical information
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* error code or zero if successful
|
||||
*
|
||||
***************************************************************************/
|
||||
static int ram_getphy ( F_DRIVER * driver, F_PHY * phy )
|
||||
{
|
||||
t_RamDrv * p = (t_RamDrv *)( driver->user_ptr );
|
||||
|
||||
phy->number_of_sectors = p->maxsector;
|
||||
phy->bytes_per_sector = MDRIVER_RAM_SECTOR_SIZE;
|
||||
|
||||
return MDRIVER_RAM_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* ram_release
|
||||
*
|
||||
* Releases a drive
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* driver_param - driver parameter
|
||||
*
|
||||
***************************************************************************/
|
||||
static void ram_release ( F_DRIVER * driver )
|
||||
{
|
||||
t_RamDrv * p = (t_RamDrv *)( driver->user_ptr );
|
||||
|
||||
if ( p == RamDrv )
|
||||
{
|
||||
p->use = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* ram_initfunc
|
||||
*
|
||||
* this init function has to be passed for highlevel to initiate the
|
||||
* driver functions
|
||||
*
|
||||
* INPUTS
|
||||
*
|
||||
* driver_param - driver parameter
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* driver structure pointer
|
||||
*
|
||||
***************************************************************************/
|
||||
F_DRIVER * ram_initfunc ( unsigned long driver_param )
|
||||
{
|
||||
t_RamDrv * p;
|
||||
|
||||
p = RamDrv + driver_param;
|
||||
|
||||
if ( p != RamDrv )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( p->use )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
(void)psp_memset( p->driver, 0, sizeof( F_DRIVER ) );
|
||||
|
||||
p->driver->readsector = ram_readsector;
|
||||
p->driver->writesector = ram_writesector;
|
||||
p->driver->getphy = ram_getphy;
|
||||
p->driver->release = ram_release;
|
||||
p->driver->user_ptr = p;
|
||||
|
||||
p->use = 1;
|
||||
|
||||
return p->driver;
|
||||
} /* ram_initfunc */
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PSP_RTC_H
|
||||
#define _PSP_RTC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../../version/ver_psp_rtc.h"
|
||||
#if VER_PSP_RTC_MAJOR != 1
|
||||
#error "VER_PSP_RTC_MAJOR invalid"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t sec;
|
||||
uint8_t min;
|
||||
uint8_t hour;
|
||||
uint8_t day;
|
||||
uint8_t month;
|
||||
uint16_t year;
|
||||
} t_psp_timedate;
|
||||
|
||||
void psp_getcurrenttimedate ( t_psp_timedate * p_timedate );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _PSP_RTC_H */
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PSP_STRING_H_
|
||||
#define _PSP_STRING_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../version/ver_psp_string.h"
|
||||
#if VER_PSP_STRING_MAJOR != 1 || VER_PSP_STRING_MINOR != 4
|
||||
#error Incompatible PSP_STRING version number!
|
||||
#endif
|
||||
|
||||
#define psp_memcpy( d, s, l ) memcpy( ( d ), ( s ), (size_t)( l ) )
|
||||
#define psp_memmove( d, s, l ) memmove( ( d ), ( s ), (size_t)( l ) )
|
||||
#define psp_memset( d, c, l ) memset( ( d ), ( c ), (size_t)( l ) )
|
||||
#define psp_memcmp( s1, s2, l ) memcmp( ( s1 ), ( s2 ), (size_t)( l ) )
|
||||
#define psp_strnlen( s, l ) strnlen( ( s ), ( size_t )( l ) )
|
||||
#define psp_strncat( d, s, l ) strncat( ( d ), ( s ), (size_t)( l ) )
|
||||
#define psp_strncpy( d, s, l ) strncpy( ( d ), ( s ), (size_t)( l ) )
|
||||
#define psp_strncmp( s1, s2, l ) strncmp( ( s1 ), ( s2 ), (size_t)( l ) )
|
||||
|
||||
#endif /* ifndef _PSP_STRING_H_ */
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "psp_test.h"
|
||||
#include "config_fat_sl.h"
|
||||
#include "config_mdriver_ram.h"
|
||||
#include "../../../api/fat_sl.h"
|
||||
#include "../../../api/api_mdriver_ram.h"
|
||||
|
||||
#include "../../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
#include "../../../version/ver_psp_fat_sl.h"
|
||||
#if VER_PSP_FAT_FAT_SL_MAJOR != 1 || VER_PSP_FAT_FAT_SL_MINOR != 1
|
||||
#error Incompatible PSP_FAT_FAT_SL version number!
|
||||
#endif
|
||||
|
||||
uint8_t all_tests_passed = 1u;
|
||||
|
||||
/* Use to display text (printf). */
|
||||
void _f_dump ( char * s )
|
||||
{
|
||||
printf( "%s\r\n", s );
|
||||
}
|
||||
|
||||
/* Use to display test result (printf). */
|
||||
uint8_t _f_result ( uint8_t testnum, uint32_t result )
|
||||
{
|
||||
(void)testnum;
|
||||
if ( result == 0 )
|
||||
{
|
||||
printf( "Passed\r\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "FAILED! Error code: %u\r\n", result );
|
||||
all_tests_passed = 0u;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Use to build file system (mount). */
|
||||
uint8_t _f_poweron ( void )
|
||||
{
|
||||
f_delvolume();
|
||||
return f_initvolume( ram_initfunc );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PSP_FAT_FAT_SL_H
|
||||
#define _PSP_FAT_FAT_SL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../../../psp/include/psp_string.h"
|
||||
|
||||
#include "../../../version/ver_fat_sl.h"
|
||||
#if VER_FAT_SL_MAJOR != 3
|
||||
#error Incompatible FAT_SL version number!
|
||||
#endif
|
||||
#include "../../../version/ver_psp_fat_sl.h"
|
||||
#if VER_PSP_FAT_FAT_SL_MAJOR != 1 || VER_PSP_FAT_FAT_SL_MINOR != 1
|
||||
#error Incompatible PSP_FAT_FAT_SL version number!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint8_t all_tests_passed;
|
||||
|
||||
/* Use to display text (printf). */
|
||||
void _f_dump ( char * s );
|
||||
|
||||
/* Use to display test result (printf). */
|
||||
uint8_t _f_result ( uint8_t testnum, uint32_t result );
|
||||
|
||||
/* Use to build file system (mount). */
|
||||
uint8_t _f_poweron ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _PSP_FAT_FAT_SL_H */
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "../../include/psp_rtc.h"
|
||||
|
||||
#include "../../../version/ver_psp_rtc.h"
|
||||
#if VER_PSP_RTC_MAJOR != 1
|
||||
#error "VER_PSP_RTC_MAJOR invalid"
|
||||
#endif
|
||||
#if VER_PSP_RTC_MINOR != 0
|
||||
#error "VER_PSP_RTC_MINOR invalid"
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* psp_getcurrenttimedate
|
||||
*
|
||||
* Need to be ported depending on system, it retreives the
|
||||
* current time and date.
|
||||
* Please take care of correct roll-over handling.
|
||||
* Roll-over problem is to read a date at 23.59.59 and then reading time at
|
||||
* 00:00.00.
|
||||
*
|
||||
* INPUT
|
||||
*
|
||||
* p_timedate - pointer where to store time and date
|
||||
*
|
||||
***************************************************************************/
|
||||
void psp_getcurrenttimedate ( t_psp_timedate * p_timedate )
|
||||
{
|
||||
if ( p_timedate != NULL )
|
||||
{
|
||||
p_timedate->sec = 0;
|
||||
p_timedate->min = 0;
|
||||
p_timedate->hour = 12u;
|
||||
|
||||
p_timedate->day = 1u;
|
||||
p_timedate->month = 1u;
|
||||
p_timedate->year = 1980u;
|
||||
}
|
||||
} /* psp_getcurrenttimedate */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VER_FAT_SL_H
|
||||
#define _VER_FAT_SL_H
|
||||
|
||||
#define VER_FAT_SL_MAJOR 3
|
||||
#define VER_FAT_SL_MINOR 2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VER_MDRIVER_H
|
||||
#define _VER_MDRIVER_H
|
||||
|
||||
#define VER_MDRIVER_MAJOR 1
|
||||
#define VER_MDRIVER_MINOR 0
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VER_MDRIVER_RAM_H
|
||||
#define _VER_MDRIVER_RAM_H
|
||||
|
||||
#define VER_MDRIVER_RAM_MAJOR 1
|
||||
#define VER_MDRIVER_RAM_MINOR 2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VER_PSP_FAT_FAT_SL_H
|
||||
#define _VER_PSP_FAT_FAT_SL_H
|
||||
|
||||
#define VER_PSP_FAT_FAT_SL_MAJOR 1
|
||||
#define VER_PSP_FAT_FAT_SL_MINOR 1
|
||||
|
||||
#endif /* _VER_PSP_FAT_FAT_SL_H */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VER_PSP_RTC_H
|
||||
#define _VER_PSP_RTC_H
|
||||
|
||||
#define VER_PSP_RTC_MAJOR 1
|
||||
#define VER_PSP_RTC_MINOR 0
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FreeRTOS+FAT FS V1.0.0 (C) 2013 HCC Embedded
|
||||
*
|
||||
* The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
|
||||
* terms.
|
||||
*
|
||||
* FreeRTOS+FAT SL uses a dual license model that allows the software to be used
|
||||
* under a pure GPL open source license (as opposed to the modified GPL licence
|
||||
* under which FreeRTOS is distributed) or a commercial license. Details of
|
||||
* both license options follow:
|
||||
*
|
||||
* - Open source licensing -
|
||||
* FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
|
||||
* distributed without charge provided the user adheres to version two of the
|
||||
* GNU General Public License (GPL) and does not remove the copyright notice or
|
||||
* this text. The GPL V2 text is available on the gnu.org web site, and on the
|
||||
* following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
|
||||
*
|
||||
* - Commercial licensing -
|
||||
* Businesses and individuals who for commercial or other reasons cannot comply
|
||||
* with the terms of the GPL V2 license must obtain a commercial license before
|
||||
* incorporating FreeRTOS+FAT SL into proprietary software for distribution in
|
||||
* any form. Commercial licenses can be purchased from
|
||||
* http://shop.freertos.org/fat_sl and do not require any source files to be
|
||||
* changed.
|
||||
*
|
||||
* FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
|
||||
* cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
|
||||
* is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
|
||||
* conditions and terms, be they implied, expressed, or statutory.
|
||||
*
|
||||
* http://www.FreeRTOS.org
|
||||
* http://www.FreeRTOS.org/FreeRTOS-Plus
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VER_PSP_STRING_H
|
||||
#define _VER_PSP_STRING_H
|
||||
|
||||
#define VER_PSP_STRING_MAJOR 1
|
||||
#define VER_PSP_STRING_MINOR 4
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user