Swimate V2 without RTOS code

Dependencies:   Adafruit_GFX_128x64 DS3231 PinDetect SDFileSystem USBDevice mbed RealtimeMath MODSERIAL

Files at this revision

API Documentation at this revision

Comitter:
paulbartell
Date:
Wed May 28 23:15:05 2014 +0000
Parent:
13:227a6cfd2097
Child:
17:fb8415091770
Child:
18:06b718f8e6fd
Commit message:
started working on listSessions piece.

Changed in this revision

sync.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/sync.cpp	Wed May 28 22:56:25 2014 +0000
+++ b/sync.cpp	Wed May 28 23:15:05 2014 +0000
@@ -2,6 +2,7 @@
 #include "sync.h"
 #include "DS3231.h"
 #include "Timeout.h"
+#include "SDFileSystem.h"
 enum state {IDLE, CAPTURE, SYNC};
 extern enum state State;
 extern DS3231 rtc;
@@ -85,8 +86,17 @@
     
 }
 void listSessions()
-{
-    
+{   //todo buffer this with buff
+    DIR *dp;
+    struct dirent *dirp;
+    dp = opendir("/sd/");
+    while((dirp = readdir(dp)) != NULL) {
+        bt.puts(dirp->d_name);
+        bt.putc(',');
+        //todo: put size here?
+        bt.puts("\r\\n");
+    }
+    closedir(dp);
 }
 
 void syncSession()