Skip to content

Commit a0b3955

Browse files
configure fs use
1 parent a23e69a commit a0b3955

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

BLE_SM/mbed_app.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
11
{
2+
"config": {
3+
"filesystem_support": {
4+
"help": "Whether filesystem is supported on the target",
5+
"value": 1
6+
}
7+
},
8+
"target_overrides": {
9+
"K64F": {
10+
"target.features_add": ["BLE"],
11+
"target.extra_labels_add": ["ST_BLUENRG"],
12+
"filesystem_support": 0
13+
},
14+
"NUCLEO_F401RE": {
15+
"target.features_add": ["BLE"],
16+
"target.extra_labels_add": ["ST_BLUENRG", "CORDIO"]
17+
},
18+
"DISCO_L475VG_IOT01A": {
19+
"target.features_add": ["BLE"],
20+
"target.extra_labels_add": ["ST_BLUENRG", "CORDIO"]
21+
}
22+
}
223
}

BLE_SM/source/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
#include "ble/BLE.h"
2020
#include "SecurityManager.h"
2121

22+
#if MBED_CONF_APP_FILESYSTEM_SUPPORT
2223
#include "LittleFileSystem.h"
2324
#include "HeapBlockDevice.h"
25+
#endif //MBED_CONF_APP_FILESYSTEM_SUPPORT
2426

2527
/** This example demonstrates all the basic setup required
2628
* for pairing and setting up link security both as a central and peripheral
@@ -409,6 +411,8 @@ class SMDeviceCentral : public SMDevice {
409411
};
410412
};
411413

414+
415+
#if MBED_CONF_APP_FILESYSTEM_SUPPORT
412416
bool create_filesystem()
413417
{
414418
static LittleFileSystem fs("fs");
@@ -443,17 +447,20 @@ bool create_filesystem()
443447

444448
return true;
445449
}
450+
#endif //MBED_CONF_APP_FILESYSTEM_SUPPORT
446451

447452
int main()
448453
{
449454
BLE& ble = BLE::Instance();
450455
events::EventQueue queue;
451456

457+
#if MBED_CONF_APP_FILESYSTEM_SUPPORT
452458
/* if filesystem creation fails or there is no filesystem the security manager
453459
* will fallback to storing the security database in memory */
454460
if (!create_filesystem()) {
455461
printf("Filesystem creation failed, will use memory storage\r\n");
456462
}
463+
#endif
457464

458465
while(1) {
459466
{

0 commit comments

Comments
 (0)