-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIldaSDCardDataReader.cpp
More file actions
111 lines (80 loc) · 2.62 KB
/
IldaSDCardDataReader.cpp
File metadata and controls
111 lines (80 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// #include "IldaSDCardDataReader.h"
// void IldaSDCardDataReader::Init()
// {
// while(true)
// {
// // Serial.println("Waiting for SD Card...");
// _file.close();
// if(!SD.begin())
// {
// // Serial.println("Card Mount Failed");
// // return;
// delay(_sdCardWaitTime);
// continue;
// }
// uint8_t cardType = SD.cardType();
// if(cardType == CARD_NONE)
// {
// // Serial.println("No SD card attached");
// // return;
// continue;
// }
// // Serial.print("SD Card Type: ");
// if(cardType == CARD_MMC){
// // Serial.println("MMC");
// } else if(cardType == CARD_SD){
// // Serial.println("SDSC");
// } else if(cardType == CARD_SDHC){
// // Serial.println("SDHC");
// } else {
// // Serial.println("UNKNOWN");
// }
// uint64_t cardSize = SD.cardSize() / (1024 * 1024);
// // Serial.printf("SD Card Size: %lluMB\n", cardSize);
// _filename = new char[_filenameLen];
// memset(_filename, 0, _filenameLen);
// File file = SD.open("/ILDA/filename.txt");
// if(!file)
// {
// // Serial.println("Failed to open /ILDA/filename.txt for reading");
// // return;
// continue;
// }
// int filenamepos = 0;
// while(file.available() && filenamepos < _filenameLen)
// {
// _filename[filenamepos++] = file.read();
// }
// file.close();
// // Serial.printf("ilda filename is '%s'\n", _filename);
// _file = SD.open(_filename);
// if(!_file)
// {
// // Serial.println("Failed to open ilda file for reading");
// // return;
// continue;
// }
// // ildaFileSize = _file.size();
// // Serial.print("File size ");
// // Serial.println(ildaFileSize);
// break;
// } // /while
// }
// int IldaSDCardDataReader::Read(uint8_t * buf, int bufSize)
// {
// int bytesRead = 0;
// if (!_file.available())
// {
// // if (!_file.seek(0))
// // {
// // return 0;
// // }
// return 0;
// }
// bytesRead = _file.read(buf, bufSize);
// return bytesRead;
// }
// void IldaSDCardDataReader::ResetToBegin()
// {
// _file.seek(0);
// }