Commit a900b225 authored by Xavier Piroux's avatar Xavier Piroux Committed by Matthieu Cattin

sw : cpying roject freertos_blink_fat as a copy of freertos_blink + integration of FAT-SL

now it doesn't produce a valid binary (compliation is ok but file is too big)
parent 0ce5a56e
####################################################################
# Makefile #
####################################################################
.SUFFIXES: # ignore builtin rules
.PHONY: all debug release clean
####################################################################
# Definitions #
####################################################################
DEVICE = EFM32GG330F1024
PROJECTNAME = freertos_blink
# Name of interface configuration file used by OpenOCD
OOCD_IFACE ?= stlink-v2-1
OBJ_DIR = build
EXE_DIR = exe
LST_DIR = lst
####################################################################
# Definitions of toolchain. #
# You might need to do changes to match your system setup #
####################################################################
# Change path to the tools according to your system configuration
# DO NOT add trailing whitespace chars, they do matter !
WINDOWSCS ?= GNU Tools ARM Embedded\4.7 2012q4
LINUXCS ?= /usr
RMDIRS := rm -rf
RMFILES := rm -rf
ALLFILES := /*.*
NULLDEVICE := /dev/null
SHELLNAMES := $(ComSpec)$(COMSPEC)
# Try autodetecting the environment
ifeq ($(SHELLNAMES),)
# Assume we are making on a Linux platform
TOOLDIR := $(LINUXCS)
else
QUOTE :="
ifneq ($(COMSPEC),)
# Assume we are making on a mingw/msys/cygwin platform running on Windows
# This is a convenient place to override TOOLDIR, DO NOT add trailing
# whitespace chars, they do matter !
TOOLDIR := $(PROGRAMFILES)/$(WINDOWSCS)
ifeq ($(findstring cygdrive,$(shell set)),)
# We were not on a cygwin platform
NULLDEVICE := NUL
endif
else
# Assume we are making on a Windows platform
# This is a convenient place to override TOOLDIR, DO NOT add trailing
# whitespace chars, they do matter !
SHELL := $(SHELLNAMES)
TOOLDIR := $(ProgramFiles)/$(WINDOWSCS)
RMDIRS := rd /s /q
RMFILES := del /s /q
ALLFILES := \*.*
NULLDEVICE := NUL
endif
endif
# Create directories and do a clean which is compatible with parallell make
$(shell mkdir $(OBJ_DIR)>$(NULLDEVICE) 2>&1)
$(shell mkdir $(EXE_DIR)>$(NULLDEVICE) 2>&1)
$(shell mkdir $(LST_DIR)>$(NULLDEVICE) 2>&1)
ifeq (clean,$(findstring clean, $(MAKECMDGOALS)))
ifneq ($(filter $(MAKECMDGOALS),all debug release),)
$(shell $(RMFILES) $(OBJ_DIR)$(ALLFILES)>$(NULLDEVICE) 2>&1)
$(shell $(RMFILES) $(EXE_DIR)$(ALLFILES)>$(NULLDEVICE) 2>&1)
$(shell $(RMFILES) $(LST_DIR)$(ALLFILES)>$(NULLDEVICE) 2>&1)
endif
endif
CC = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-gcc$(QUOTE)
LD = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-ld$(QUOTE)
AR = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-ar$(QUOTE)
OBJCOPY = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-objcopy$(QUOTE)
DUMP = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-objdump$(QUOTE)
SIZE = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-size$(QUOTE)
####################################################################
# Flags #
####################################################################
# -MMD : Don't generate dependencies on system header files.
# -MP : Add phony targets, useful when a h-file is removed from a project.
# -MF : Specify a file to write the dependencies to.
DEPFLAGS = -MMD -MP -MF $(@:.o=.d)
#
# Add -Wa,-ahld=$(LST_DIR)/$(@F:.o=.lst) to CFLAGS to produce assembly list files
#
override CFLAGS += -D$(DEVICE) -Wall -Wextra -mcpu=cortex-m3 -mthumb \
-mfix-cortex-m3-ldrd -ffunction-sections \
-fdata-sections -fomit-frame-pointer -DGCC_ARMCM3 -DDEBUG_EFM \
$(DEPFLAGS)
override ASMFLAGS += -x assembler-with-cpp -D$(DEVICE) -Wall -Wextra -mcpu=cortex-m3 -mthumb
#
# NOTE: The -Wl,--gc-sections flag may interfere with debugging using gdb.
#
override LDFLAGS += -Xlinker -Map=$(LST_DIR)/$(PROJECTNAME).map -mcpu=cortex-m3 \
-mthumb -T../../../common/Device/EnergyMicro/EFM32GG/Source/GCC/efm32gg.ld \
-Wl,--gc-sections
LIBS = -Wl,--start-group -lgcc -lc -lnosys -Wl,--end-group
INCLUDEPATHS += \
-I../src \
-I../../../common/CMSIS/Include \
-I../../../common/Device/EnergyMicro/EFM32GG/Include \
-I../../../common/emlib/inc \
-I../../../common/emdrv/sleep/inc \
-I../kits/common/bsp \
-I../src \
-I../reptile/FreeRTOS/Source/include \
-I../reptile/FreeRTOS/Source/portable/GCC/ARM_CM3 \
-I../kits/EFM32GG_STK3700/config
####################################################################
# Files #
####################################################################
C_SRC += \
../../../common/Device/EnergyMicro/EFM32GG/Source/system_efm32gg.c \
../../../common/emlib/src/em_assert.c \
../../../common/emlib/src/em_burtc.c \
../../../common/emlib/src/em_cmu.c \
../../../common/emlib/src/em_emu.c \
../../../common/emlib/src/em_gpio.c \
../../../common/emlib/src/em_int.c \
../../../common/emlib/src/em_rmu.c \
../../../common/emlib/src/em_rtc.c \
../../../common/emlib/src/em_system.c \
../../../common/emdrv/sleep/src/sleep.c \
../reptile/FreeRTOS/Source/timers.c \
../reptile/FreeRTOS/Source/tasks.c \
../reptile/FreeRTOS/Source/queue.c \
../reptile/FreeRTOS/Source/list.c \
../reptile/FreeRTOS/Source/croutine.c \
../reptile/FreeRTOS/Source/portable/MemMang/heap_1.c \
../reptile/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c \
../src/main.c \
../src/low_power_tick_management.c
s_SRC +=
S_SRC += \
../../../common/Device/EnergyMicro/EFM32GG/Source/GCC/startup_efm32gg.S
####################################################################
# FAT files #
####################################################################
C_SRC += \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/dir.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/f_lock.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/drv.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/util.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/fat.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/util_sfn.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/file.c \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/volume.c \
../reptile/FreeRTOS-Plus-FAT-SL/psp/target/rtc/psp_rtc.c
C_SRC += \
../reptile/FreeRTOS-Plus-FAT-SL/media-drv/ram/ramdrv_f.c #TODO: use our implementation for the driver of SD card.
C_SRC += \
../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/test/test.c \
../reptile/FreeRTOS-Plus-FAT-SL/psp/target/fat_sl/psp_test_xavier.c #TODO: we should not use this psp_test.c because it use printf() to simulate
INCLUDEPATHS += \
-I../reptile/FreeRTOS-Plus-FAT-SL/config/ \
-I../reptile/FreeRTOS-Plus-FAT-SL/fat_sl/common/ \
-I../reptile/FreeRTOS-Plus-FAT-SL/version/
####################################################################
# Rules #
####################################################################
C_FILES = $(notdir $(C_SRC) )
S_FILES = $(notdir $(S_SRC) $(s_SRC) )
#make list of source paths, sort also removes duplicates
C_PATHS = $(sort $(dir $(C_SRC) ) )
S_PATHS = $(sort $(dir $(S_SRC) $(s_SRC) ) )
C_OBJS = $(addprefix $(OBJ_DIR)/, $(C_FILES:.c=.o))
S_OBJS = $(if $(S_SRC), $(addprefix $(OBJ_DIR)/, $(S_FILES:.S=.o)))
s_OBJS = $(if $(s_SRC), $(addprefix $(OBJ_DIR)/, $(S_FILES:.s=.o)))
C_DEPS = $(addprefix $(OBJ_DIR)/, $(C_FILES:.c=.d))
OBJS = $(C_OBJS) $(S_OBJS) $(s_OBJS)
vpath %.c $(C_PATHS)
vpath %.s $(S_PATHS)
vpath %.S $(S_PATHS)
# Default build is debug build
all: debug
debug: CFLAGS += -DDEBUG -O0 -g
debug: $(EXE_DIR)/$(PROJECTNAME).bin
release: CFLAGS += -DNDEBUG -O3
release: $(EXE_DIR)/$(PROJECTNAME).bin
# Create objects from C SRC files
$(OBJ_DIR)/%.o: %.c
@echo "Building file: $<"
$(CC) $(CFLAGS) $(INCLUDEPATHS) -c -o $@ $<
# Assemble .s/.S files
$(OBJ_DIR)/%.o: %.s
@echo "Assembling $<"
$(CC) $(ASMFLAGS) $(INCLUDEPATHS) -c -o $@ $<
$(OBJ_DIR)/%.o: %.S
@echo "Assembling $<"
$(CC) $(ASMFLAGS) $(INCLUDEPATHS) -c -o $@ $<
# Link
$(EXE_DIR)/$(PROJECTNAME).out: $(OBJS)
@echo "Linking target: $@"
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(EXE_DIR)/$(PROJECTNAME).out
# Create binary file
$(EXE_DIR)/$(PROJECTNAME).bin: $(EXE_DIR)/$(PROJECTNAME).out
@echo "Creating binary file"
$(OBJCOPY) -O binary $(EXE_DIR)/$(PROJECTNAME).out $(EXE_DIR)/$(PROJECTNAME).bin
# Uncomment next line to produce assembly listing of entire program
# $(DUMP) -h -S -C $(EXE_DIR)/$(PROJECTNAME).out>$(LST_DIR)/$(PROJECTNAME)out.lst
# Uncomment next line to produce code footprint
$(SIZE) $<
clean:
ifeq ($(filter $(MAKECMDGOALS),all debug release),)
$(RMDIRS) $(OBJ_DIR) $(LST_DIR) $(EXE_DIR)
endif
flash: $(EXE_DIR)/$(PROJECTNAME).bin
openocd -s ../../../common/openocd -f interface/$(OOCD_IFACE).cfg -f init.cfg -c "program $(EXE_DIR)/$(PROJECTNAME).bin 0 verify reset"
# include auto-generated dependency files (explicit rules)
ifneq (clean,$(findstring clean, $(MAKECMDGOALS)))
-include $(C_DEPS)
endif
####################################################################
# Makefile #
####################################################################
.SUFFIXES: # ignore builtin rules
.PHONY: all debug release clean
####################################################################
# Definitions #
####################################################################
DEVICE = EFM32GG330F1024
PROJECTNAME = freertos_blink
OBJ_DIR = build
EXE_DIR = exe
LST_DIR = lst
####################################################################
# Definitions of toolchain. #
# You might need to do changes to match your system setup #
####################################################################
# Change path to the tools according to your system configuration
# DO NOT add trailing whitespace chars, they do matter !
WINDOWSCS ?= GNU Tools ARM Embedded\4.7 2012q4
LINUXCS ?= /opt/gcc-arm-none-eabi-4_8-2014q1
RMDIRS := rm -rf
RMFILES := rm -rf
ALLFILES := /*.*
NULLDEVICE := /dev/null
SHELLNAMES := $(ComSpec)$(COMSPEC)
# Try autodetecting the environment
ifeq ($(SHELLNAMES),)
# Assume we are making on a Linux platform
TOOLDIR := $(LINUXCS)
else
QUOTE :="
ifneq ($(COMSPEC),)
# Assume we are making on a mingw/msys/cygwin platform running on Windows
# This is a convenient place to override TOOLDIR, DO NOT add trailing
# whitespace chars, they do matter !
TOOLDIR := $(PROGRAMFILES)/$(WINDOWSCS)
ifeq ($(findstring cygdrive,$(shell set)),)
# We were not on a cygwin platform
NULLDEVICE := NUL
endif
else
# Assume we are making on a Windows platform
# This is a convenient place to override TOOLDIR, DO NOT add trailing
# whitespace chars, they do matter !
SHELL := $(SHELLNAMES)
TOOLDIR := $(ProgramFiles)/$(WINDOWSCS)
RMDIRS := rd /s /q
RMFILES := del /s /q
ALLFILES := \*.*
NULLDEVICE := NUL
endif
endif
# Create directories and do a clean which is compatible with parallell make
$(shell mkdir $(OBJ_DIR)>$(NULLDEVICE) 2>&1)
$(shell mkdir $(EXE_DIR)>$(NULLDEVICE) 2>&1)
$(shell mkdir $(LST_DIR)>$(NULLDEVICE) 2>&1)
ifeq (clean,$(findstring clean, $(MAKECMDGOALS)))
ifneq ($(filter $(MAKECMDGOALS),all debug release),)
$(shell $(RMFILES) $(OBJ_DIR)$(ALLFILES)>$(NULLDEVICE) 2>&1)
$(shell $(RMFILES) $(EXE_DIR)$(ALLFILES)>$(NULLDEVICE) 2>&1)
$(shell $(RMFILES) $(LST_DIR)$(ALLFILES)>$(NULLDEVICE) 2>&1)
endif
endif
CC = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-gcc$(QUOTE)
LD = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-ld$(QUOTE)
AR = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-ar$(QUOTE)
OBJCOPY = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-objcopy$(QUOTE)
DUMP = $(QUOTE)$(TOOLDIR)/bin/arm-none-eabi-objdump$(QUOTE)
####################################################################
# Flags #
####################################################################
# -MMD : Don't generate dependencies on system header files.
# -MP : Add phony targets, useful when a h-file is removed from a project.
# -MF : Specify a file to write the dependencies to.
DEPFLAGS = -MMD -MP -MF $(@:.o=.d)
#
# Add -Wa,-ahld=$(LST_DIR)/$(@F:.o=.lst) to CFLAGS to produce assembly list files
#
override CFLAGS += -D$(DEVICE) -Wall -Wextra -mcpu=cortex-m3 -mthumb \
-mfix-cortex-m3-ldrd -ffunction-sections \
-fdata-sections -fomit-frame-pointer -DGCC_ARMCM3 -DDEBUG_EFM \
$(DEPFLAGS)
override ASMFLAGS += -x assembler-with-cpp -D$(DEVICE) -Wall -Wextra -mcpu=cortex-m3 -mthumb
#
# NOTE: The -Wl,--gc-sections flag may interfere with debugging using gdb.
#
override LDFLAGS += -Xlinker -Map=$(LST_DIR)/$(PROJECTNAME).map -mcpu=cortex-m3 \
-mthumb -T../Device/EnergyMicro/EFM32GG/Source/GCC/efm32gg.ld \
-Wl,--gc-sections
LIBS = -Wl,--start-group -lgcc -lc -lnosys -Wl,--end-group
INCLUDEPATHS += \
-I../src \
-I../CMSIS/Include \
-I../Device/EnergyMicro/EFM32GG/Include \
-I../emlib/inc \
-I../emdrv/sleep/inc \
-I../kits/common/bsp \
-I../src \
-I../reptile/FreeRTOS/Source/include \
-I../reptile/FreeRTOS/Source/portable/GCC/ARM_CM3 \
-I../kits/EFM32GG_STK3700/config
####################################################################
# Files #
####################################################################
C_SRC += \
../Device/EnergyMicro/EFM32GG/Source/system_efm32gg.c \
../kits/common/bsp/bsp_trace.c \
../kits/common/bsp/bsp_stk_leds.c \
../emlib/src/em_assert.c \
../emlib/src/em_burtc.c \
../emlib/src/em_cmu.c \
../emlib/src/em_emu.c \
../emlib/src/em_gpio.c \
../emlib/src/em_int.c \
../emlib/src/em_rmu.c \
../emlib/src/em_rtc.c \
../emlib/src/em_system.c \
../emdrv/sleep/src/sleep.c \
../reptile/FreeRTOS/Source/timers.c \
../reptile/FreeRTOS/Source/tasks.c \
../reptile/FreeRTOS/Source/queue.c \
../reptile/FreeRTOS/Source/list.c \
../reptile/FreeRTOS/Source/croutine.c \
../reptile/FreeRTOS/Source/portable/MemMang/heap_1.c \
../reptile/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c \
../src/main.c \
../src/low_power_tick_management.c
s_SRC +=
S_SRC += \
../Device/EnergyMicro/EFM32GG/Source/GCC/startup_efm32gg.S
####################################################################
# Rules #
####################################################################
C_FILES = $(notdir $(C_SRC) )
S_FILES = $(notdir $(S_SRC) $(s_SRC) )
#make list of source paths, sort also removes duplicates
C_PATHS = $(sort $(dir $(C_SRC) ) )
S_PATHS = $(sort $(dir $(S_SRC) $(s_SRC) ) )
C_OBJS = $(addprefix $(OBJ_DIR)/, $(C_FILES:.c=.o))
S_OBJS = $(if $(S_SRC), $(addprefix $(OBJ_DIR)/, $(S_FILES:.S=.o)))
s_OBJS = $(if $(s_SRC), $(addprefix $(OBJ_DIR)/, $(S_FILES:.s=.o)))
C_DEPS = $(addprefix $(OBJ_DIR)/, $(C_FILES:.c=.d))
OBJS = $(C_OBJS) $(S_OBJS) $(s_OBJS)
vpath %.c $(C_PATHS)
vpath %.s $(S_PATHS)
vpath %.S $(S_PATHS)
# Default build is debug build
all: debug
debug: CFLAGS += -DDEBUG -O0 -g
debug: $(EXE_DIR)/$(PROJECTNAME).bin
release: CFLAGS += -DNDEBUG -O3
release: $(EXE_DIR)/$(PROJECTNAME).bin
# Create objects from C SRC files
$(OBJ_DIR)/%.o: %.c
@echo "Building file: $<"
$(CC) $(CFLAGS) $(INCLUDEPATHS) -c -o $@ $<
# Assemble .s/.S files
$(OBJ_DIR)/%.o: %.s
@echo "Assembling $<"
$(CC) $(ASMFLAGS) $(INCLUDEPATHS) -c -o $@ $<
$(OBJ_DIR)/%.o: %.S
@echo "Assembling $<"
$(CC) $(ASMFLAGS) $(INCLUDEPATHS) -c -o $@ $<
# Link
$(EXE_DIR)/$(PROJECTNAME).out: $(OBJS)
@echo "Linking target: $@"
$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(EXE_DIR)/$(PROJECTNAME).out
# Create binary file
$(EXE_DIR)/$(PROJECTNAME).bin: $(EXE_DIR)/$(PROJECTNAME).out
@echo "Creating binary file"
$(OBJCOPY) -O binary $(EXE_DIR)/$(PROJECTNAME).out $(EXE_DIR)/$(PROJECTNAME).bin
# Uncomment next line to produce assembly listing of entire program
# $(DUMP) -h -S -C $(EXE_DIR)/$(PROJECTNAME).out>$(LST_DIR)/$(PROJECTNAME)out.lst
clean:
ifeq ($(filter $(MAKECMDGOALS),all debug release),)
$(RMDIRS) $(OBJ_DIR) $(LST_DIR) $(EXE_DIR)
endif
# include auto-generated dependency files (explicit rules)
ifneq (clean,$(findstring clean, $(MAKECMDGOALS)))
-include $(C_DEPS)
endif
[InternetShortcut]
URL=http://www.freertos.org/fat
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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_ */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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_ */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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_ */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || VER_FAT_SL_MINOR != 2
#error Incompatible FAT_SL version number!
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* 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 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || VER_FAT_SL_MINOR != 2
#error Incompatible FAT_SL version number!
#endif
#ifdef __cplusplus
extern "C" {
#endif
unsigned char fsr_init ( void );
unsigned char fsr_delete ( void );
#ifdef __cplusplus
}
#endif
#endif /* ifndef _F_RTOS_H */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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;
}
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || 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 */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || VER_FAT_SL_MINOR != 2
#error Incompatible FAT_SL version number!
#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, F_FAT32_MEDIA
*/
#define F_FAT_TYPE F_FAT16_MEDIA
void f_dotest ( unsigned char );
#endif /* ifndef _CONFIG_STHIN_TEST_H */
/*
* FreeRTOS+FAT SL V1.0.1 (C) 2014 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 standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
* 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 != 5 || VER_FAT_SL_MINOR != 2
#error Incompatible FAT_SL version number!
#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, F_FAT32_MEDIA
*/
#define F_FAT_TYPE F_FAT16_MEDIA
void f_dotest ( unsigned char );
#endif /* ifndef _CONFIG_STHIN_TEST_H */
Changes between V1.0.0 and V1.0.1
+ Fix seeking beyond the end of file when the offset was not multiple of
the sector size, or when the file was empty.
+ Seeking test extended to validate seeking/writing on sector boundaries.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment