Skip to content

Commit 6f338f8

Browse files
authored
Merge pull request ARMmbed#8006 from deepikabhavnani/sd_driver_cleanup
SD - Add required header file and namespace element instead add all
2 parents 6ec90d1 + 4de8eda commit 6f338f8

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,10 @@
139139
#ifdef DEVICE_SPI
140140

141141
#include "SDBlockDevice.h"
142-
#include "mbed_debug.h"
142+
#include "platform/mbed_debug.h"
143+
#include "platform/mbed_wait_api.h"
143144
#include <errno.h>
144145

145-
/* Required version: 5.9.0 and above */
146-
#if defined(MBED_MAJOR_VERSION) && MBED_MAJOR_VERSION >= 5
147-
#if (MBED_VERSION < MBED_ENCODE_VERSION(5,9,0))
148-
#error "Incompatible mbed-os version detected! Required 5.9.0 and above"
149-
#endif
150-
#else
151-
#warning "mbed-os version 5.9.0 or above required"
152-
#endif
153-
154146
#ifndef MBED_CONF_SD_CMD_TIMEOUT
155147
#define MBED_CONF_SD_CMD_TIMEOUT 5000 /*!< Timeout in ms for response */
156148
#endif

components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#ifdef DEVICE_SPI
2222

2323
#include "BlockDevice.h"
24-
#include "mbed.h"
24+
#include "drivers/SPI.h"
25+
#include "drivers/Timer.h"
26+
#include "drivers/MbedCRC.h"
27+
#include "drivers/DigitalOut.h"
28+
#include "platform/platform.h"
2529
#include "platform/PlatformMutex.h"
2630

2731
/** SDBlockDevice class
@@ -177,10 +181,10 @@ class SDBlockDevice : public BlockDevice {
177181
bool _is_valid_trim(bd_addr_t addr, bd_size_t size);
178182

179183
/* SPI functions */
180-
Timer _spi_timer; /**< Timer Class object used for busy wait */
184+
mbed::Timer _spi_timer; /**< Timer Class object used for busy wait */
181185
uint32_t _init_sck; /**< Intial SPI frequency */
182186
uint32_t _transfer_sck; /**< SPI frequency during data transfer/after initialization */
183-
SPI _spi; /**< SPI Class object */
187+
mbed::SPI _spi; /**< SPI Class object */
184188

185189
/* SPI initialization function */
186190
void _spi_init();
@@ -195,7 +199,7 @@ class SDBlockDevice : public BlockDevice {
195199
int _freq(void);
196200

197201
/* Chip Select and SPI mode select */
198-
DigitalOut _cs;
202+
mbed::DigitalOut _cs;
199203
void _select();
200204
void _deselect();
201205

@@ -217,8 +221,8 @@ class SDBlockDevice : public BlockDevice {
217221
bool _crc_on;
218222
uint32_t _init_ref_count;
219223

220-
MbedCRC<POLY_7BIT_SD, 7> _crc7;
221-
MbedCRC<POLY_16BIT_CCITT, 16> _crc16;
224+
mbed::MbedCRC<POLY_7BIT_SD, 7> _crc7;
225+
mbed::MbedCRC<POLY_16BIT_CCITT, 16> _crc16;
222226
};
223227

224228
#endif /* DEVICE_SPI */

0 commit comments

Comments
 (0)