summaryrefslogtreecommitdiff
path: root/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp')
-rw-r--r--tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp b/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp
new file mode 100644
index 0000000000..2dc525cd08
--- /dev/null
+++ b/tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/fs/main.cpp
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "rtos.h"
+#include "SDFileSystem.h"
+
+#define FILE_LOC "/sd/test.txt"
+
+Serial pc(USBTX, USBRX);
+Serial gps(p28, p27);
+Serial test(p9,p10);
+
+SDFileSystem sd(p11, p12, p13, p14, "sd");
+
+DigitalOut myled(LED1);
+DigitalOut sdled(LED2);
+
+void sd_thread(void const *argument) {
+ while (true) {
+ sdled = !sdled;
+ FILE *fp = NULL;
+ fp = fopen(FILE_LOC, "w");
+ if( fp != NULL ) fclose(fp);
+ Thread::wait(1000);
+ }
+}
+
+int main() {
+ Thread sdTask(sd_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE * 2.25);
+ while (true) {
+ myled = !myled;
+ Thread::wait(1000);
+ }
+}