-
Notifications
You must be signed in to change notification settings - Fork 1
/
01.config.ino
57 lines (56 loc) · 1.53 KB
/
01.config.ino
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
//const String CONFIG_PATH_MINIMUM_OUTPUT_VOLTAGE = "minimum_output_voltage";
//
//LittleFSConfig cfg;
//
//float savedMinimumOutputVoltage = .8;
//
//void setSavedMinimumOutputVoltage(float newMinimumOutputVoltage) {
// savedMinimumOutputVoltage = newMinimumOutputVoltage;
// String content = String(savedMinimumOutputVoltage, 3);
// writeToFile(CONFIG_PATH_MINIMUM_OUTPUT_VOLTAGE, content);
//}
//
//void writeToFile(String filePath, String content) {
// int toWriteLen = content.length() + 1;
// char chars[toWriteLen];
// content.toCharArray(chars, toWriteLen);
//
// File file = LittleFS.open(filePath, "w");
// if (isConfigDebug) {
// Serial.print("Writing ");
// Serial.print(content);
// Serial.print(" to ");
// Serial.println(filePath);
// }
// file.write(chars);
// file.close();
//}
//
//String readOrPrep(String filePath, String defaultContent) {
// String output = defaultContent;
//
// if (LittleFS.exists(filePath)) {
// File file = LittleFS.open(filePath, "r");
// output = file.readString();
// file.close();
// }
// else {
// writeToFile(filePath, defaultContent);
// }
//
// if (isConfigDebug) {
// Serial.print("Read/prep ");
// Serial.print(output);
// Serial.print(" from ");
// Serial.println(filePath);
// }
//
// return output;
//}
//
void configSetup() {
// LittleFS.setConfig(cfg);
// LittleFS.begin();
// String savedMinimumOutputVoltageRead = readOrPrep(CONFIG_PATH_MINIMUM_OUTPUT_VOLTAGE, "0.8");
// savedMinimumOutputVoltage = savedMinimumOutputVoltageRead.toFloat();
}