Skip to content

SD - Add required header file and namespace element instead add all #8006

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

Merged
merged 2 commits into from
Oct 1, 2018
Merged
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: 2 additions & 10 deletions components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,10 @@
#ifdef DEVICE_SPI

#include "SDBlockDevice.h"
#include "mbed_debug.h"
#include "platform/mbed_debug.h"
#include "platform/mbed_wait_api.h"
#include <errno.h>

/* 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
Expand Down
16 changes: 10 additions & 6 deletions components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -177,10 +181,10 @@ class SDBlockDevice : public BlockDevice {
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();
Expand All @@ -195,7 +199,7 @@ class SDBlockDevice : public BlockDevice {
int _freq(void);

/* Chip Select and SPI mode select */
DigitalOut _cs;
mbed::DigitalOut _cs;
void _select();
void _deselect();

Expand All @@ -217,8 +221,8 @@ class SDBlockDevice : public BlockDevice {
bool _crc_on;
uint32_t _init_ref_count;

MbedCRC<POLY_7BIT_SD, 7> _crc7;
MbedCRC<POLY_16BIT_CCITT, 16> _crc16;
mbed::MbedCRC<POLY_7BIT_SD, 7> _crc7;
mbed::MbedCRC<POLY_16BIT_CCITT, 16> _crc16;
};

#endif /* DEVICE_SPI */
Expand Down