Commit | Line | Data |
---|---|---|
df27a6a3 | 1 | /* |
4cff3ded AW |
2 | This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). |
3 | Smoothie 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. | |
4 | Smoothie 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. | |
df27a6a3 | 5 | You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. |
4cff3ded AW |
6 | */ |
7 | ||
8 | #ifndef CONFIG_H | |
9 | #define CONFIG_H | |
4cff3ded | 10 | #include "libs/Kernel.h" |
b66fb830 | 11 | #include "libs/utils.h" |
e6b22382 | 12 | #include "libs/Pin.h" |
c295905f AW |
13 | #include "ConfigValue.h" |
14 | #include "ConfigCache.h" | |
15 | #include "ConfigSource.h" | |
16 | #include "libs/ConfigSources/FileConfigSource.h" | |
d4f93cf4 | 17 | #include "checksumm.h" |
3c132bd0 | 18 | |
79f6bf9e | 19 | #define error(...) (fprintf(stderr, __VA_ARGS__), exit(1)) |
3c132bd0 AW |
20 | |
21 | using namespace std; | |
22 | #include <vector> | |
4cff3ded | 23 | #include <string> |
79f6bf9e | 24 | #include <stdio.h> |
4cff3ded | 25 | |
32891c60 L |
26 | #define LOCAL_CONFIGSOURCE_CHECKSUM 13581 |
27 | #define SD_CONFIGSOURCE_CHECKSUM 19415 | |
28 | ||
29 | ||
4cff3ded AW |
30 | class Config : public Module { |
31 | public: | |
32 | Config(); | |
cebe90b6 AW |
33 | |
34 | void on_module_loaded(); | |
35 | void on_console_line_received( void* argument ); | |
d272dd3c L |
36 | void config_cache_load(); |
37 | void config_cache_clear(); | |
3c132bd0 | 38 | void set_string( string setting , string value); |
fc82a1ee | 39 | |
b66fb830 | 40 | ConfigValue* value(uint16_t check_sum); |
3c132bd0 AW |
41 | ConfigValue* value(uint16_t check_sum_a, uint16_t check_sum_b); |
42 | ConfigValue* value(uint16_t check_sum_a, uint16_t check_sum_b, uint16_t check_sum_c ); | |
4464301d | 43 | ConfigValue* value(uint16_t check_sums[3] ); |
3c132bd0 AW |
44 | |
45 | void get_module_list(vector<uint16_t>* list, uint16_t family); | |
46 | ||
a699b669 | 47 | bool has_characters(uint16_t check_sum, string str ); |
4cff3ded | 48 | |
7b49793d | 49 | ConfigCache config_cache; // A cache in which ConfigValues are kept |
c295905f | 50 | vector<ConfigSource*> config_sources; // A list of all possible coniguration sources |
b03ad2ef | 51 | bool config_cache_loaded; // Whether or not the cache is currently popluated |
4cff3ded AW |
52 | }; |
53 | ||
54 | #endif |