File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ static void page_storage_close_status_box() {
104104 * The formatting routine.
105105 */
106106static format_codes_t page_storage_format_sd () {
107- if (!sdcard_mounted ()) {
107+ if (!sdcard_inserted ()) {
108108 return FMC_ERR_SDCARD_NOT_INSERTED ;
109109 }
110110
Original file line number Diff line number Diff line change 11#include "sdcard.h"
22
33#include <sys/stat.h>
4+ #include <unistd.h>
45
56bool sdcard_mounted () {
67 struct stat mountpoint ;
@@ -15,3 +16,7 @@ bool sdcard_mounted() {
1516
1617 return false;
1718}
19+
20+ bool sdcard_inserted () {
21+ return access (SD_BLOCK_DEVICE , F_OK ) == 0 ;
22+ }
Original file line number Diff line number Diff line change 22
33#include <stdbool.h>
44
5+ #define SD_BLOCK_DEVICE "/dev/mmcblk0"
6+
57bool sdcard_mounted ();
8+
9+ bool sdcard_inserted ();
You can’t perform that action at this time.
0 commit comments