Skip to content

Commit ed8e170

Browse files
Yossi LevyYossi Levy
authored andcommitted
Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure.
1 parent 881929e commit ed8e170

File tree

182 files changed

+3836
-4984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+3836
-4984
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,11 @@ matrix:
187187

188188
- env:
189189
- NAME=littlefs
190-
- LITTLEFS=features/filesystem/littlefs
190+
- LITTLEFS=features/storage/filesystem/littlefs
191191
install:
192192
# Install dependencies
193193
- sudo apt-get install gcc-arm-embedded fuse libfuse-dev
194194
- pip install -r requirements.txt
195-
- git clone https://github.com/armmbed/spiflash-driver.git
196195
# Print versions
197196
- arm-none-eabi-gcc --version
198197
- gcc --version

components/storage/blockdevice/COMPONENT_DATAFLASH/.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ enum dummy {
131131
};
132132

133133
DataFlashBlockDevice::DataFlashBlockDevice(PinName mosi,
134-
PinName miso,
135-
PinName sclk,
136-
PinName cs,
137-
int freq,
138-
PinName nwp)
134+
PinName miso,
135+
PinName sclk,
136+
PinName cs,
137+
int freq,
138+
PinName nwp)
139139
: _spi(mosi, miso, sclk),
140140
_cs(cs, 1),
141141
_nwp(nwp),
@@ -244,7 +244,7 @@ int DataFlashBlockDevice::init()
244244

245245
/* adjust device size */
246246
_device_size = (_device_size / DATAFLASH_PAGE_SIZE_256) *
247-
DATAFLASH_PAGE_SIZE_264;
247+
DATAFLASH_PAGE_SIZE_264;
248248
}
249249
break;
250250
case DATAFLASH_ID_DENSITY_16_MBIT:
@@ -258,7 +258,7 @@ int DataFlashBlockDevice::init()
258258

259259
/* adjust device size */
260260
_device_size = (_device_size / DATAFLASH_PAGE_SIZE_512) *
261-
DATAFLASH_PAGE_SIZE_528;
261+
DATAFLASH_PAGE_SIZE_528;
262262
}
263263
break;
264264
default:
@@ -361,7 +361,7 @@ int DataFlashBlockDevice::program(const void *buffer, bd_addr_t addr, bd_size_t
361361
/* check parameters are valid and the write is within bounds */
362362
if (is_valid_program(addr, size) && buffer) {
363363

364-
const uint8_t * external_buffer = static_cast<const uint8_t*>(buffer);
364+
const uint8_t *external_buffer = static_cast<const uint8_t *>(buffer);
365365

366366
/* Each write command can only cover one page at a time.
367367
Find page and current page offset for handling unaligned writes.
@@ -577,7 +577,7 @@ void DataFlashBlockDevice::_write_enable(bool enable)
577577

578578
/* enable writing, disable write protection */
579579
if (enable) {
580-
/* if not-write-protected pin is connected, select it */
580+
/* if not-write-protected pin is connected, select it */
581581
if (_nwp.is_connected()) {
582582
_nwp = 1;
583583
}
@@ -612,8 +612,8 @@ int DataFlashBlockDevice::_sync(void)
612612
The polling interval is based on the typical page program time.
613613
*/
614614
for (uint32_t timeout = 0;
615-
timeout < DATAFLASH_TIMEOUT;
616-
timeout += DATAFLASH_TIMING_ERASE_PROGRAM_PAGE) {
615+
timeout < DATAFLASH_TIMEOUT;
616+
timeout += DATAFLASH_TIMING_ERASE_PROGRAM_PAGE) {
617617

618618
/* get status register */
619619
uint16_t status = _get_register(DATAFLASH_OP_STATUS);
@@ -622,12 +622,12 @@ int DataFlashBlockDevice::_sync(void)
622622
if (status & DATAFLASH_BIT_ERASE_PROGRAM_ERROR) {
623623
DEBUG_PRINTF("DATAFLASH_BIT_ERASE_PROGRAM_ERROR\r\n");
624624
break;
625-
/* device ready, set OK code set */
625+
/* device ready, set OK code set */
626626
} else if (status & DATAFLASH_BIT_READY) {
627627
DEBUG_PRINTF("DATAFLASH_BIT_READY\r\n");
628628
result = BD_ERROR_OK;
629629
break;
630-
/* wait the typical write period before trying again */
630+
/* wait the typical write period before trying again */
631631
} else {
632632
DEBUG_PRINTF("wait_ms: %d\r\n", DATAFLASH_TIMING_ERASE_PROGRAM_PAGE);
633633
wait_ms(DATAFLASH_TIMING_ERASE_PROGRAM_PAGE);
@@ -647,9 +647,9 @@ int DataFlashBlockDevice::_sync(void)
647647
* @return BlockDevice error code.
648648
*/
649649
int DataFlashBlockDevice::_write_page(const uint8_t *buffer,
650-
uint32_t page,
651-
uint32_t offset,
652-
uint32_t size)
650+
uint32_t page,
651+
uint32_t offset,
652+
uint32_t size)
653653
{
654654
DEBUG_PRINTF("_write_page: %p %" PRIX32 " %" PRIX32 "\r\n", buffer, page, size);
655655

components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ class DataFlashBlockDevice : public BlockDevice {
7171
* @param freq Clock speed of the SPI bus (defaults to 40MHz)
7272
*/
7373
DataFlashBlockDevice(PinName mosi,
74-
PinName miso,
75-
PinName sclk,
76-
PinName csel,
77-
int freq = 40000000,
78-
PinName nowp = NC);
74+
PinName miso,
75+
PinName sclk,
76+
PinName csel,
77+
int freq = 40000000,
78+
PinName nowp = NC);
7979

8080
/** Initialize a block device
8181
*

components/storage/blockdevice/COMPONENT_DATAFLASH/LICENSE.md

Lines changed: 0 additions & 165 deletions
This file was deleted.

components/storage/blockdevice/COMPONENT_DATAFLASH/README.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)