mirror of
https://github.com/okalachev/flix.git
synced 2026-08-16 00:38:56 +00:00
Fix typo
This commit is contained in:
+4
-4
@@ -22,7 +22,7 @@ struct Parameter {
|
|||||||
const char *name; // max length is 15
|
const char *name; // max length is 15
|
||||||
bool integer;
|
bool integer;
|
||||||
union { float *f; int *i; }; // pointer to the variable
|
union { float *f; int *i; }; // pointer to the variable
|
||||||
float inital; // default value
|
float initial; // default value
|
||||||
float cache; // what's stored in flash
|
float cache; // what's stored in flash
|
||||||
void (*callback)(); // called after parameter change
|
void (*callback)(); // called after parameter change
|
||||||
Parameter(const char *name, float *variable, void (*callback)() = nullptr) : name(name), integer(false), f(variable), callback(callback) {};
|
Parameter(const char *name, float *variable, void (*callback)() = nullptr) : name(name), integer(false), f(variable), callback(callback) {};
|
||||||
@@ -150,7 +150,7 @@ void setupParameters() {
|
|||||||
storage.begin("flix");
|
storage.begin("flix");
|
||||||
// Read parameters from storage
|
// Read parameters from storage
|
||||||
for (auto ¶meter : parameters) {
|
for (auto ¶meter : parameters) {
|
||||||
parameter.inital = parameter.getValue();
|
parameter.initial = parameter.getValue();
|
||||||
if (storage.isKey(parameter.name)) {
|
if (storage.isKey(parameter.name)) {
|
||||||
parameter.setValue(storage.getFloat(parameter.name));
|
parameter.setValue(storage.getFloat(parameter.name));
|
||||||
}
|
}
|
||||||
@@ -211,10 +211,10 @@ void printParameters(const char *filter) {
|
|||||||
for (auto ¶meter : parameters) {
|
for (auto ¶meter : parameters) {
|
||||||
if (strncasecmp(parameter.name, filter, strlen(filter))) continue;
|
if (strncasecmp(parameter.name, filter, strlen(filter))) continue;
|
||||||
|
|
||||||
if (floatEquals(parameter.getValue(), parameter.inital)) { // parameter changed
|
if (floatEquals(parameter.getValue(), parameter.initial)) { // parameter changed
|
||||||
print("%-15s %-13g\n", parameter.name, parameter.getValue());
|
print("%-15s %-13g\n", parameter.name, parameter.getValue());
|
||||||
} else {
|
} else {
|
||||||
print("%-15s %-13g [%g]\n", parameter.name, parameter.getValue(), parameter.inital);
|
print("%-15s %-13g [%g]\n", parameter.name, parameter.getValue(), parameter.initial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user