changes
This commit is contained in:
@ -20,7 +20,9 @@ configItems = [
|
||||
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RainSensor1/Debug"},
|
||||
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0},
|
||||
{"label":"Period (s)", "key":"period", "type":"I", "default":5},
|
||||
{"label":"Debounce (us)", "key":"debounce", "type":"I", "default":300}
|
||||
{"label":"Debounce (us)", "key":"debounce", "type":"I", "default":300},
|
||||
{"label":"ml per tock", "key":"spoonfill", "type":"F", "default":3.5},
|
||||
{"label":"Measure Area", "key":"measureArea", "type":"F", "default":68.75}
|
||||
]
|
||||
|
||||
|
||||
|
@ -35,6 +35,8 @@ void configServeIndex() {
|
||||
strcpy(configBlock.$configItem.key, "$configItem.default");
|
||||
#else if $configItem.type == "I"
|
||||
configBlock.$configItem.key = $configItem.default;
|
||||
#else if $configItem.type == "F"
|
||||
configBlock.$configItem.key = $configItem.default;
|
||||
#end if
|
||||
#end if
|
||||
#end for
|
||||
@ -79,6 +81,10 @@ void configServeIndex() {
|
||||
buffer += " value=\"";
|
||||
buffer += configBlock.$configItem.key;
|
||||
buffer += "\"";
|
||||
#else if $configItem.type == "F"
|
||||
buffer += " value=\"";
|
||||
buffer += configBlock.$configItem.key;
|
||||
buffer += "\"";
|
||||
#end if
|
||||
|
||||
buffer +=
|
||||
@ -119,6 +125,8 @@ void configServeGetConfiguration() {
|
||||
strcpy(configBlock.$configItem.key, arg.c_str());
|
||||
#else if $configItem.type == "I"
|
||||
configBlock.$configItem.key = atoi(arg.c_str());
|
||||
#else if $configItem.type == "F"
|
||||
configBlock.$configItem.key = atof(arg.c_str());
|
||||
#end if
|
||||
#end if
|
||||
#end for
|
||||
|
@ -4,6 +4,8 @@ typedef struct {
|
||||
char ${configItem.key}[$configItem.length];
|
||||
#else if $configItem.type == 'I'
|
||||
uint32_t $configItem.key;
|
||||
#else if $configItem.type == 'F'
|
||||
float $configItem.key;
|
||||
#end if
|
||||
#end for
|
||||
} tConfigBlock;
|
||||
|
Reference in New Issue
Block a user