From 80a10cd134fe2184b167e426ad810119d48faf02 Mon Sep 17 00:00:00 2001 From: Deepika Date: Wed, 5 Sep 2018 11:33:42 -0500 Subject: [PATCH 1/2] Version check not needed as driver in part of mbed-os --- .../storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp index 2fd729f5fc..917544e36a 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp @@ -142,15 +142,6 @@ #include "mbed_debug.h" #include -/* Required version: 5.9.0 and above */ -#if defined(MBED_MAJOR_VERSION) && MBED_MAJOR_VERSION >= 5 -#if (MBED_VERSION < MBED_ENCODE_VERSION(5,9,0)) -#error "Incompatible mbed-os version detected! Required 5.9.0 and above" -#endif -#else -#warning "mbed-os version 5.9.0 or above required" -#endif - #ifndef MBED_CONF_SD_CMD_TIMEOUT #define MBED_CONF_SD_CMD_TIMEOUT 5000 /*!< Timeout in ms for response */ #endif From 4de8eda249c665f77f3b124b1c85239b24f9cd30 Mon Sep 17 00:00:00 2001 From: Deepika Date: Wed, 5 Sep 2018 11:41:25 -0500 Subject: [PATCH 2/2] Add required header file and namespace element instead add all --- .../blockdevice/COMPONENT_SD/SDBlockDevice.cpp | 3 ++- .../blockdevice/COMPONENT_SD/SDBlockDevice.h | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp index 917544e36a..18759dcc79 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp @@ -139,7 +139,8 @@ #ifdef DEVICE_SPI #include "SDBlockDevice.h" -#include "mbed_debug.h" +#include "platform/mbed_debug.h" +#include "platform/mbed_wait_api.h" #include #ifndef MBED_CONF_SD_CMD_TIMEOUT diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h index 750156dada..352ab634dc 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h @@ -21,7 +21,11 @@ #ifdef DEVICE_SPI #include "BlockDevice.h" -#include "mbed.h" +#include "drivers/SPI.h" +#include "drivers/Timer.h" +#include "drivers/MbedCRC.h" +#include "drivers/DigitalOut.h" +#include "platform/platform.h" #include "platform/PlatformMutex.h" /** SDBlockDevice class @@ -177,10 +181,10 @@ private: bool _is_valid_trim(bd_addr_t addr, bd_size_t size); /* SPI functions */ - Timer _spi_timer; /**< Timer Class object used for busy wait */ + mbed::Timer _spi_timer; /**< Timer Class object used for busy wait */ uint32_t _init_sck; /**< Intial SPI frequency */ uint32_t _transfer_sck; /**< SPI frequency during data transfer/after initialization */ - SPI _spi; /**< SPI Class object */ + mbed::SPI _spi; /**< SPI Class object */ /* SPI initialization function */ void _spi_init(); @@ -195,7 +199,7 @@ private: int _freq(void); /* Chip Select and SPI mode select */ - DigitalOut _cs; + mbed::DigitalOut _cs; void _select(); void _deselect(); @@ -217,8 +221,8 @@ private: bool _crc_on; uint32_t _init_ref_count; - MbedCRC _crc7; - MbedCRC _crc16; + mbed::MbedCRC _crc7; + mbed::MbedCRC _crc16; }; #endif /* DEVICE_SPI */