mirror of
https://github.com/eclipse-threadx/levelx.git
synced 2026-09-14 04:06:00 +08:00
Updated copyright headers and removed trailing whitespace
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* This is a small demo of the high-performance FileX FAT file system with LevelX
|
||||
/* This is a small demo of the high-performance FileX FAT file system with LevelX
|
||||
and the NAND simulated driver. */
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -9,7 +9,7 @@
|
||||
#define DEMO_STACK_SIZE 4096
|
||||
|
||||
|
||||
/* Buffer for FileX FX_MEDIA sector cache. This must be large enough for at least one
|
||||
/* Buffer for FileX FX_MEDIA sector cache. This must be large enough for at least one
|
||||
sector, which are typically 512 bytes in size. */
|
||||
|
||||
unsigned char media_memory[4096];
|
||||
@@ -23,8 +23,8 @@ VOID _fx_nand_flash_simulator_driver(FX_MEDIA *media_ptr);
|
||||
/* Define LevelX NAND simulated flash erase. */
|
||||
|
||||
UINT _lx_nand_flash_simulator_erase_all(VOID);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Define thread prototypes. */
|
||||
|
||||
void thread_0_entry(ULONG thread_input);
|
||||
@@ -54,8 +54,8 @@ int main(void)
|
||||
#else
|
||||
|
||||
/* Initialize NAND flash. */
|
||||
lx_nand_flash_initialize();
|
||||
|
||||
lx_nand_flash_initialize();
|
||||
|
||||
/* Initialize FileX. */
|
||||
fx_system_initialize();
|
||||
|
||||
@@ -76,13 +76,13 @@ void tx_application_define(void *first_unused_memory)
|
||||
create information. */
|
||||
|
||||
/* Create the main thread. */
|
||||
tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
|
||||
thread_0_stack, DEMO_STACK_SIZE,
|
||||
tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
|
||||
thread_0_stack, DEMO_STACK_SIZE,
|
||||
1, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
|
||||
|
||||
/* Initialize NAND flash. */
|
||||
lx_nand_flash_initialize();
|
||||
|
||||
lx_nand_flash_initialize();
|
||||
|
||||
/* Initialize FileX. */
|
||||
fx_system_initialize();
|
||||
}
|
||||
@@ -97,27 +97,27 @@ ULONG actual;
|
||||
CHAR local_buffer[30];
|
||||
|
||||
LX_PARAMETER_NOT_USED(thread_input);
|
||||
|
||||
|
||||
/* Erase the simulated NAND flash. */
|
||||
_lx_nand_flash_simulator_erase_all();
|
||||
|
||||
/* Format the NAND disk - the memory for the NAND flash disk is setup in
|
||||
|
||||
/* Format the NAND disk - the memory for the NAND flash disk is setup in
|
||||
the NAND simulator. Note that for best performance, the format of the
|
||||
NAND flash should be less than one full NAND flash block of sectors. */
|
||||
fx_media_format(&nand_disk,
|
||||
fx_media_format(&nand_disk,
|
||||
_fx_nand_flash_simulator_driver, // Driver entry
|
||||
FX_NULL, // Unused
|
||||
media_memory, // Media buffer pointer
|
||||
sizeof(media_memory), // Media buffer size
|
||||
sizeof(media_memory), // Media buffer size
|
||||
"MY_NAND_DISK", // Volume Name
|
||||
1, // Number of FATs
|
||||
32, // Directory Entries
|
||||
0, // Hidden sectors
|
||||
120, // Total sectors
|
||||
2048, // Sector size
|
||||
120, // Total sectors
|
||||
2048, // Sector size
|
||||
1, // Sectors per cluster
|
||||
1, // Heads
|
||||
1); // Sectors per track
|
||||
1); // Sectors per track
|
||||
|
||||
/* Loop to repeat the demo over and over! */
|
||||
do
|
||||
@@ -219,7 +219,7 @@ CHAR local_buffer[30];
|
||||
|
||||
/* Delete the file. */
|
||||
status = fx_file_delete(&nand_disk, "TEST.TXT");
|
||||
|
||||
|
||||
/* Check the file delete status. */
|
||||
if (status != FX_SUCCESS)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ CHAR local_buffer[30];
|
||||
/* Error deleting the file, break the loop. */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Close the media. */
|
||||
status = fx_media_close(&nand_disk);
|
||||
|
||||
@@ -243,7 +243,7 @@ CHAR local_buffer[30];
|
||||
of successful passes through this loop. */
|
||||
thread_0_counter++;
|
||||
} while (1);
|
||||
|
||||
|
||||
/* If we get here the FileX test failed! */
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user