|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|
Routines for handling Configuration Data. More...
Functions | |
| static void | DefaultConfig (void) |
| Programs default values into non volatile Memory. More... | |
| void | DumpConfig (void) |
| Lists the current configuration values. More... | |
| void | DumpConfigSignal (uint8_t number) |
| DumpConfig Helper Function for Optocoupler outputs. More... | |
| void | ReadConfig (void) |
| Reads the Config-Struct from EEPROM into config. More... | |
| bool | SoundsOK (void) |
| Checks if sounds may currently be played. More... | |
| void | WriteConfig (void) |
| Writes the Config-Struct to EEPROM. More... | |
Variables | |
| confStruct_t | config |
| The Configuration. It is read on startup from the EEPROM. More... | |
| bool | configDirty =false |
| Set to true by routines affecting configuration if config memory needs to be saved to the EEPROM. More... | |
| confStruct_t EEMEM | defaultConfig |
| This Struct will be stored in the EEPROM and is contained in the Production File. More... | |
Routines for handling Configuration Data.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
|
static |
Programs default values into non volatile Memory.
This function is mostly useful during development but I recommend to leave it functional. You can omit this routine if you want to save about 300 bytes of flash but it is quite useful if you change the config struct and change CONF_MAGIC. It will reprogram the EEPROM with default values then. Especially in devices already in the field it would lead to unpredictable results if the configuration memory format would not be compatible with the current version.
| void DumpConfig | ( | void | ) |
Lists the current configuration values.
Prints a verbose explanation of the configuration data to the host.
| void DumpConfigSignal | ( | uint8_t | number | ) |
DumpConfig Helper Function for Optocoupler outputs.
| number | The Number of the Signal Output (Zero-based) |
| void ReadConfig | ( | void | ) |
Reads the Config-Struct from EEPROM into config.
Only the config-struct in RAM will be used. Changes in config will only become permanent if you use a write-command. There is a configDirty-flag that is set by every routine that changes config and is used to remind the user to execute a write-command.
| bool SoundsOK | ( | void | ) |
Checks if sounds may currently be played.
"Curremtly" means at the actual time-of-day. Check this function before you play sounds that should not be always enabled.
| void WriteConfig | ( | void | ) |
Writes the Config-Struct to EEPROM.
| confStruct_t config |
The Configuration. It is read on startup from the EEPROM.
| bool configDirty =false |
Set to true by routines affecting configuration if config memory needs to be saved to the EEPROM.
| confStruct_t EEMEM defaultConfig |
This Struct will be stored in the EEPROM and is contained in the Production File.
'New' devices are programmed using the production file which also can write the default EEPROM content and the fuses.
1.8.3.1