Skip to content

Move to default_instance QSPIF #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/Arduino_Portenta_OTA_QSPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

using namespace arduino;

#if defined (COMPONENT_4343W_FS)
extern QSPIFBlockDevice *qspi_bd;
#endif

/******************************************************************************
CTOR/DTOR
******************************************************************************/
Expand All @@ -47,13 +43,7 @@ Arduino_Portenta_OTA_QSPI::Arduino_Portenta_OTA_QSPI(StorageTypePortenta const s

bool Arduino_Portenta_OTA_QSPI::init()
{
#if !defined (COMPONENT_4343W_FS)
qspi_bd = new QSPIFBlockDevice(PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove completely this line we are dropping compatibility for older core versions ( < 2.3.1 )

if (qspi_bd->init() != QSPIF_BD_ERROR_OK) {
Serial1.println("Error: QSPI init failure.");
return false;
}
#endif
auto qspi_bd = mbed::BlockDevice::get_default_instance();
Copy link
Contributor

@pennam pennam Jan 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory we still need to call the init function here, even if we are using get_default_instance()


if(_storage_type == QSPI_FLASH_FATFS)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Arduino_Portenta_OTA_QSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ class Arduino_Portenta_OTA_QSPI : public Arduino_Portenta_OTA

mbed::BlockDevice * _bd_qspi;
mbed::FATFileSystem * _fs_qspi;
#if !defined (COMPONENT_4343W_FS)
QSPIFBlockDevice *qspi_bd;
#endif

};

#endif /* ARDUINO_PORTENTA_OTA_QSPI_H_ */