aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge/FileIO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/Bridge/FileIO.cpp')
-rw-r--r--libraries/Bridge/FileIO.cpp8
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) {