USBMSD: Use SDFileSystem class and USB non-blocking

Fork of USBMSD_SD by Samuel Mokrani

Committer:
Olivier
Date:
Sat Feb 15 12:49:23 2014 +0000
Revision:
3:8c7810e6b858
Parent:
2:055119ccf5a7
Use SDFileSystem class instead of duplicating the code into the new class.; ; Required; - http://mbed.org/users/mbed_official/code/USBDevice/pull-request/3; - http://mbed.org/users/mbed_official/code/SDFileSystem/pull-request/1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samux 2:055119ccf5a7 1 /* mbed Microcontroller Library
samux 2:055119ccf5a7 2 * Copyright (c) 2006-2012 ARM Limited
samux 0:de50a209c5a9 3 *
samux 0:de50a209c5a9 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
samux 0:de50a209c5a9 5 * of this software and associated documentation files (the "Software"), to deal
samux 0:de50a209c5a9 6 * in the Software without restriction, including without limitation the rights
samux 0:de50a209c5a9 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
samux 0:de50a209c5a9 8 * copies of the Software, and to permit persons to whom the Software is
samux 0:de50a209c5a9 9 * furnished to do so, subject to the following conditions:
samux 0:de50a209c5a9 10 *
samux 0:de50a209c5a9 11 * The above copyright notice and this permission notice shall be included in
samux 0:de50a209c5a9 12 * all copies or substantial portions of the Software.
samux 0:de50a209c5a9 13 *
samux 0:de50a209c5a9 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
samux 0:de50a209c5a9 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
samux 0:de50a209c5a9 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
samux 0:de50a209c5a9 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
samux 0:de50a209c5a9 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
samux 2:055119ccf5a7 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
samux 2:055119ccf5a7 20 * SOFTWARE.
samux 0:de50a209c5a9 21 */
Olivier 3:8c7810e6b858 22
samux 0:de50a209c5a9 23 #include "USBMSD_SD.h"
samux 2:055119ccf5a7 24 #include "mbed_debug.h"
samux 0:de50a209c5a9 25
Olivier 3:8c7810e6b858 26 USBMSD_SD::USBMSD_SD(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name) :
Olivier 3:8c7810e6b858 27 SDFileSystem(mosi, miso, sclk, cs, name) {
Olivier 3:8c7810e6b858 28 // Set to 5MHz for SD data transfer
Olivier 3:8c7810e6b858 29 set_transfer_sck(5000000);
samux 0:de50a209c5a9 30
Olivier 3:8c7810e6b858 31 // Call USBMSD::connect(bool blocking)
Olivier 3:8c7810e6b858 32 connect(false);
samux 0:de50a209c5a9 33 }