mirror of
https://github.com/eclipse-threadx/filex.git
synced 2026-09-14 04:05:59 +08:00
Merge remote-tracking branch 'github/master'
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||||
|
|
||||||
# Set up the project
|
# Set up the project
|
||||||
project(filex
|
project(filex
|
||||||
|
|||||||
+3
-1
@@ -138,7 +138,9 @@ extern "C" {
|
|||||||
#define AZURE_RTOS_FILEX
|
#define AZURE_RTOS_FILEX
|
||||||
#define FILEX_MAJOR_VERSION 6
|
#define FILEX_MAJOR_VERSION 6
|
||||||
#define FILEX_MINOR_VERSION 4
|
#define FILEX_MINOR_VERSION 4
|
||||||
#define FILEX_PATCH_VERSION 1
|
#define FILEX_PATCH_VERSION 2
|
||||||
|
#define FILEX_BUILD_VERSION 202503
|
||||||
|
#define FILEX_HOTFIX_VERSION ''
|
||||||
|
|
||||||
/* Define the following symbols for backward compatibility */
|
/* Define the following symbols for backward compatibility */
|
||||||
#define EL_PRODUCT_FILEX
|
#define EL_PRODUCT_FILEX
|
||||||
|
|||||||
@@ -443,17 +443,24 @@ UINT sectors_per_fat, f, s;
|
|||||||
_fx_utility_memory_set(&byte_ptr[j + i], ' ', (11 - i));
|
_fx_utility_memory_set(&byte_ptr[j + i], ' ', (11 - i));
|
||||||
#endif /* FX_DISABLE_FORCE_MEMORY_OPERATION */
|
#endif /* FX_DISABLE_FORCE_MEMORY_OPERATION */
|
||||||
|
|
||||||
|
/* Set bootrecord signature. */
|
||||||
#ifdef FX_FORCE_512_BYTE_BOOT_SECTOR
|
#ifdef FX_FORCE_512_BYTE_BOOT_SECTOR
|
||||||
|
/* Put the boot signature in the standard position. */
|
||||||
/* Set bootrecord signature. */
|
byte_ptr[FX_SIG_OFFSET] = FX_SIG_BYTE_1;
|
||||||
byte_ptr[510] = 0x55;
|
byte_ptr[FX_SIG_OFFSET + 1] = FX_SIG_BYTE_2;
|
||||||
byte_ptr[511] = 0xAA;
|
|
||||||
#else
|
#else
|
||||||
|
if (bytes_per_sector < 512)
|
||||||
/* Set bootrecord signature. */
|
{
|
||||||
byte_ptr[bytes_per_sector - 2] = 0x55;
|
/* Put the boot signature at the end of the sector. */
|
||||||
byte_ptr[bytes_per_sector - 1] = 0xAA;
|
byte_ptr[bytes_per_sector - 2] = FX_SIG_BYTE_1;
|
||||||
|
byte_ptr[bytes_per_sector - 1] = FX_SIG_BYTE_2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Put the boot signature in the standard position. */
|
||||||
|
byte_ptr[FX_SIG_OFFSET] = FX_SIG_BYTE_1;
|
||||||
|
byte_ptr[FX_SIG_OFFSET + 1] = FX_SIG_BYTE_2;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Select the boot record write command. */
|
/* Select the boot record write command. */
|
||||||
@@ -510,8 +517,8 @@ UINT sectors_per_fat, f, s;
|
|||||||
byte_ptr[487] = 0x61;
|
byte_ptr[487] = 0x61;
|
||||||
|
|
||||||
/* Build the final signature word, this too is used to help verify that this is a FSINFO sector. */
|
/* Build the final signature word, this too is used to help verify that this is a FSINFO sector. */
|
||||||
byte_ptr[508] = 0x55;
|
byte_ptr[FX_SIG_OFFSET] = FX_SIG_BYTE_1;
|
||||||
byte_ptr[509] = 0xAA;
|
byte_ptr[FX_SIG_OFFSET + 1] = FX_SIG_BYTE_2;
|
||||||
|
|
||||||
/* Setup the total available clusters on the media. We need to subtract 1 for the FAT32 root directory. */
|
/* Setup the total available clusters on the media. We need to subtract 1 for the FAT32 root directory. */
|
||||||
_fx_utility_32_unsigned_write(&byte_ptr[488], (total_clusters - 1));
|
_fx_utility_32_unsigned_write(&byte_ptr[488], (total_clusters - 1));
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
target_sources(${PROJECT_NAME} PRIVATE
|
||||||
|
# {{BEGIN_TARGET_SOURCES}}
|
||||||
|
|
||||||
|
# {{END_TARGET_SOURCES}}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/inc
|
||||||
|
)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (c) 2024 Microsoft Corporation
|
||||||
|
*
|
||||||
|
* This program and the accompanying materials are made available under the
|
||||||
|
* terms of the MIT License which is available at
|
||||||
|
* https://opensource.org/licenses/MIT.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************/
|
||||||
|
/**************************************************************************/
|
||||||
|
/** */
|
||||||
|
/** FileX Component */
|
||||||
|
/** */
|
||||||
|
/** Port Specific */
|
||||||
|
/** */
|
||||||
|
/**************************************************************************/
|
||||||
|
/**************************************************************************/
|
||||||
|
|
||||||
|
/* Include the generic version of fx_port.h. */
|
||||||
|
#include "../../../generic/inc/fx_port.h"
|
||||||
+36
-11
@@ -1,3 +1,15 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* Copyright (c) 2024 Microsoft Corporation
|
||||||
|
* Copyright (c) 2025 Eclipse ThreadX contributors
|
||||||
|
*
|
||||||
|
* This program and the accompanying materials are made available under the
|
||||||
|
* terms of the MIT License which is available at
|
||||||
|
* https://opensource.org/licenses/MIT.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* This is a small demo of the high-performance FileX FAT file system. It includes setup for
|
/* This is a small demo of the high-performance FileX FAT file system. It includes setup for
|
||||||
a small 34KB RAM disk and a loop that writes and reads a small file. */
|
a small 34KB RAM disk and a loop that writes and reads a small file. */
|
||||||
#include "fx_api.h"
|
#include "fx_api.h"
|
||||||
@@ -29,14 +41,16 @@ void thread_0_entry(ULONG thread_input);
|
|||||||
|
|
||||||
|
|
||||||
/* Define FileX global data structures. */
|
/* Define FileX global data structures. */
|
||||||
|
#define TOTAL_SECTORS 256
|
||||||
|
#define SECTOR_SIZE 512
|
||||||
FX_MEDIA ram_disk;
|
FX_MEDIA ram_disk;
|
||||||
FX_FILE my_file;
|
FX_FILE my_file;
|
||||||
|
|
||||||
|
|
||||||
#ifndef FX_STANDALONE_ENABLE
|
#ifndef FX_STANDALONE_ENABLE
|
||||||
CHAR *ram_disk_memory;
|
CHAR *ram_disk_memory;
|
||||||
#else
|
#else
|
||||||
unsigned char ram_disk_memory[256*512];
|
unsigned char ram_disk_memory[TOTAL_SECTORS*SECTOR_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define ThreadX global data structures. */
|
/* Define ThreadX global data structures. */
|
||||||
@@ -102,8 +116,12 @@ CHAR local_buffer[30];
|
|||||||
|
|
||||||
|
|
||||||
/* Format the RAM disk - the memory for the RAM disk was setup in
|
/* Format the RAM disk - the memory for the RAM disk was setup in
|
||||||
tx_application_define above. */
|
tx_application_define above.
|
||||||
fx_media_format(&ram_disk,
|
|
||||||
|
Important Note: The user must ensure there is enough RAM for the format
|
||||||
|
specified. Otherwise, memory corruption can occur.
|
||||||
|
*/
|
||||||
|
status = fx_media_format(&ram_disk,
|
||||||
_fx_ram_driver, // Driver entry
|
_fx_ram_driver, // Driver entry
|
||||||
ram_disk_memory, // RAM disk memory pointer
|
ram_disk_memory, // RAM disk memory pointer
|
||||||
media_memory, // Media buffer pointer
|
media_memory, // Media buffer pointer
|
||||||
@@ -112,28 +130,35 @@ CHAR local_buffer[30];
|
|||||||
1, // Number of FATs
|
1, // Number of FATs
|
||||||
32, // Directory Entries
|
32, // Directory Entries
|
||||||
0, // Hidden sectors
|
0, // Hidden sectors
|
||||||
256, // Total sectors
|
TOTAL_SECTORS, // Total sectors
|
||||||
512, // Sector size
|
SECTOR_SIZE, // Sector size
|
||||||
8, // Sectors per cluster
|
8, // Sectors per cluster
|
||||||
1, // Heads
|
1, // Heads
|
||||||
1); // Sectors per track
|
1); // Sectors per track
|
||||||
|
|
||||||
|
/* Determine if the RAM disk format was successful. */
|
||||||
|
if (status != FX_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Error formatting the RAM disk. */
|
||||||
|
printf("HTTPS RAM disk format failed, error: %x\n", status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Loop to repeat the demo over and over! */
|
/* Loop to repeat the demo over and over! */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Open the RAM disk. */
|
/* Open the RAM disk. */
|
||||||
status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory));
|
status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory));
|
||||||
|
|
||||||
/* Check the media open status. */
|
/* Determine if the RAM disk open was successful. */
|
||||||
if (status != FX_SUCCESS)
|
if (status != FX_SUCCESS)
|
||||||
{
|
{
|
||||||
|
/* Error opening the RAM disk. */
|
||||||
/* Error, break the loop! */
|
printf("RAM disk open failed, error: %x\n", status);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef FX_ENABLE_FAULT_TOLERANT
|
#ifdef FX_ENABLE_FAULT_TOLERANT
|
||||||
status = fx_fault_tolerant_enable(&ram_disk, fault_tolerant_memory, sizeof(fault_tolerant_memory));
|
status = fx_fault_tolerant_enable(&ram_disk, fault_tolerant_memory, sizeof(fault_tolerant_memory));
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||||
cmake_policy(SET CMP0057 NEW)
|
cmake_policy(SET CMP0057 NEW)
|
||||||
|
|
||||||
project(regression_test LANGUAGES C)
|
project(regression_test LANGUAGES C)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||||
cmake_policy(SET CMP0057 NEW)
|
cmake_policy(SET CMP0057 NEW)
|
||||||
|
|
||||||
project(samples LANGUAGES C)
|
project(samples LANGUAGES C)
|
||||||
|
|||||||
Reference in New Issue
Block a user