Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of gr-peach-opencv-project-sd-card by
mStorage.cpp
00001 #include "mStorage.hpp" 00002 00003 cStorage::cStorage(char *name) 00004 { 00005 fs = new FATFileSystem(name); 00006 mounted = false; 00007 } 00008 00009 cStorage::~cStorage(void) 00010 { 00011 if( mounted == true) 00012 { 00013 fs->unmount(); 00014 delete fs; 00015 } 00016 } 00017 00018 mStorageError cStorage::isConnectSdCard() 00019 { 00020 if (sd.connect()) 00021 { 00022 return STORG_PASS; 00023 } 00024 return STORG_FAIL; 00025 } 00026 00027 mStorageError cStorage::mountSdCard() 00028 { 00029 if(fs == NULL) 00030 { 00031 return STORG_FAIL; 00032 } 00033 else if( fs->mount(&sd) == 0 ) 00034 { 00035 mounted = true; 00036 return STORG_PASS; 00037 } 00038 return STORG_FAIL; 00039 } 00040 00041 mStorageError cStorage::unmountSdCard() 00042 { 00043 if( mounted == true ) 00044 { 00045 fs->mount(&sd); 00046 return STORG_PASS; 00047 } 00048 return STORG_FAIL; 00049 }
Generated on Tue Jul 12 2022 14:47:28 by
1.7.2
