diff options
author | Fede85 <f.vanzati@gmail.com> | 2013-06-20 13:24:27 +0200 |
---|---|---|
committer | Fede85 <f.vanzati@gmail.com> | 2013-06-20 13:24:27 +0200 |
commit | ed672deb7447e8c229fa5bfef54189dceb0841a8 (patch) | |
tree | cb37bd09ae201ad91c7f15b8c987d7226988a103 /libraries/Bridge/FileIO.cpp | |
parent | 0a594d273d7e6cb7decff31653c116cafed0e096 (diff) |
modified SDclass.begin() check for sd presence and added the Datalogger example
Diffstat (limited to 'libraries/Bridge/FileIO.cpp')
-rw-r--r-- | libraries/Bridge/FileIO.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libraries/Bridge/FileIO.cpp b/libraries/Bridge/FileIO.cpp index c66f937..c49c2b4 100644 --- a/libraries/Bridge/FileIO.cpp +++ b/libraries/Bridge/FileIO.cpp @@ -160,7 +160,13 @@ const char *File::name() { boolean SDClass::begin() { - return true; + Process chksd; + int res = chksd.runShellCommand(F("cat /sys/bus/scsi/drivers/sd/*/block/sda/size")); + if (res == 0) { + if (chksd.peek() != '0') + return true; + } + return false; } File SDClass::open(const char *filename, uint8_t mode) { |