Skip to content

Commit 18fa963

Browse files
committed
Change disk size constant to macro in vfs_user.c.
1 parent 960b7de commit 18fa963

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/daplink/drag-n-drop/vfs_user.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
#include "cortex_m.h"
3838
#include "target_board.h"
3939

40+
//! @brief Size in bytes of the virtual disk.
41+
//!
42+
//! Must be bigger than 4x the flash size of the biggest supported
43+
//! device. This is to accomodate for hex file programming.
44+
#define VFS_DISK_SIZE (MB(64))
45+
4046
//! @brief Constants for magic action or config files.
4147
//!
4248
//! The "magic files" are files with a special name that if created on the USB MSC volume, will
@@ -66,10 +72,6 @@ typedef struct _magic_file_info {
6672
magic_file_t which; //!< Enum for the file.
6773
} magic_file_info_t;
6874

69-
// Must be bigger than 4x the flash size of the biggest supported
70-
// device. This is to accomodate for hex file programming.
71-
static const uint32_t disc_size = MB(64);
72-
7375
static const char mbed_redirect_file[] =
7476
"<!doctype html>\r\n"
7577
"<!-- mbed Platform Website and Authentication Shortcut -->\r\n"
@@ -131,7 +133,7 @@ void vfs_user_build_filesystem()
131133
uint32_t file_size;
132134
vfs_file_t file_handle;
133135
// Setup the filesystem based on target parameters
134-
vfs_init(get_daplink_drive_name(), disc_size);
136+
vfs_init(get_daplink_drive_name(), VFS_DISK_SIZE);
135137
// MBED.HTM
136138
file_size = get_file_size(read_file_mbed_htm);
137139
vfs_create_file(get_daplink_url_name(), read_file_mbed_htm, 0, file_size);

0 commit comments

Comments
 (0)