Skip to content

Commit 272f37e

Browse files
committed
OSPI: update Platform storage
1 parent b8d6c6b commit 272f37e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

storage/blockdevice/tests/TESTS/blockdevice/general_block_device/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,13 +752,14 @@ void test_write_deinit_init()
752752

753753
void test_get_type_functionality()
754754
{
755-
utest_printf("\nTest get blockdevice type..\n");
755+
utest_printf("Test get blockdevice type..\n");
756756

757757
block_device = BlockDevice::get_default_instance();
758758
TEST_SKIP_UNLESS_MESSAGE(block_device != NULL, "no block device found.");
759759

760760
const char *bd_type = block_device->get_type();
761761
TEST_ASSERT_NOT_EQUAL(0, bd_type);
762+
utest_printf("block device found: %s\n", bd_type);
762763

763764
#if COMPONENT_QSPIF
764765
TEST_ASSERT_EQUAL(0, strcmp(bd_type, "QSPIF"));
@@ -770,7 +771,7 @@ void test_get_type_functionality()
770771
TEST_ASSERT_EQUAL(0, strcmp(bd_type, "DATAFLASH"));
771772
#elif COMPONENT_SD
772773
TEST_ASSERT_EQUAL(0, strcmp(bd_type, "SD"));
773-
#elif COMPONET_FLASHIAP
774+
#elif COMPONENT_FLASHIAP
774775
TEST_ASSERT_EQUAL(0, strcmp(bd_type, "FLASHIAP"));
775776
#endif
776777
}

storage/platform/source/PlatformStorage.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h"
2929
#endif
3030

31+
#if COMPONENT_OSPIF
32+
#include "storage/blockdevice/COMPONENT_OSPIF/OSPIFBlockDevice.h"
33+
#endif
34+
3135
#if COMPONENT_DATAFLASH
3236
#include "storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.h"
3337
#endif
@@ -75,6 +79,12 @@ MBED_WEAK BlockDevice *BlockDevice::get_default_instance()
7579

7680
return &default_bd;
7781

82+
#elif COMPONENT_OSPIF
83+
84+
static OSPIFBlockDevice default_bd;
85+
86+
return &default_bd;
87+
7888
#elif COMPONENT_DATAFLASH
7989

8090
static DataFlashBlockDevice default_bd;
@@ -140,7 +150,7 @@ MBED_WEAK BlockDevice *BlockDevice::get_default_instance()
140150

141151
MBED_WEAK FileSystem *FileSystem::get_default_instance()
142152
{
143-
#if COMPONENT_SPIF || COMPONENT_QSPIF || COMPONENT_DATAFLASH
153+
#if COMPONENT_SPIF || COMPONENT_QSPIF || COMPONENT_OSPIF || COMPONENT_DATAFLASH
144154

145155
static LittleFileSystem flash("flash", BlockDevice::get_default_instance());
146156
flash.set_as_default();

0 commit comments

Comments
 (0)