RAMDisk example for the USBFileSystem
Dependencies: mbed USBFileSystem
Fork of USBFileSystem_RAMDISK_HelloWorld by
main.cpp@1:e1b0157ce547, 2013-07-30 (annotated)
- Committer:
- Sissors
- Date:
- Tue Jul 30 18:27:18 2013 +0000
- Revision:
- 1:e1b0157ce547
- Parent:
- 0:fc0ff7c1656b
- Child:
- 2:1c8a3c4ba703
Memory leaks -_-
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ragmondo | 0:fc0ff7c1656b | 1 | #include "mbed.h" |
ragmondo | 0:fc0ff7c1656b | 2 | #include "USBMSD_Ram.h" |
ragmondo | 0:fc0ff7c1656b | 3 | |
ragmondo | 0:fc0ff7c1656b | 4 | USBMSD_Ram sd; |
Sissors | 1:e1b0157ce547 | 5 | DigitalOut led(LED_GREEN); |
Sissors | 1:e1b0157ce547 | 6 | Serial pc(USBTX, USBRX); |
ragmondo | 0:fc0ff7c1656b | 7 | |
ragmondo | 0:fc0ff7c1656b | 8 | int main() { |
Sissors | 1:e1b0157ce547 | 9 | pc.baud(115200); |
Sissors | 1:e1b0157ce547 | 10 | while(1) { |
Sissors | 1:e1b0157ce547 | 11 | led = 1; |
Sissors | 1:e1b0157ce547 | 12 | printf("Connecting!\n"); |
Sissors | 1:e1b0157ce547 | 13 | if (!sd.connect()) |
Sissors | 1:e1b0157ce547 | 14 | error("Failed to connect!\n"); |
Sissors | 1:e1b0157ce547 | 15 | wait(5); |
Sissors | 1:e1b0157ce547 | 16 | led = 0; |
Sissors | 1:e1b0157ce547 | 17 | printf("Disconnecting!\n"); |
Sissors | 1:e1b0157ce547 | 18 | sd.disconnect(); |
Sissors | 1:e1b0157ce547 | 19 | wait(2); |
Sissors | 1:e1b0157ce547 | 20 | } |
ragmondo | 0:fc0ff7c1656b | 21 | } |