Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Smoothie by
Config.h
00001 /* 00002 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). 00003 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. 00004 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. 00005 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. 00006 */ 00007 00008 #ifndef CONFIG_H 00009 #define CONFIG_H 00010 #include "libs/Kernel.h" 00011 #include "libs/utils.h" 00012 #include "libs/Pin.h" 00013 #include "ConfigValue.h" 00014 #include "ConfigCache.h" 00015 #include "ConfigSource.h" 00016 #include "libs/ConfigSources/FileConfigSource.h" 00017 #include "checksumm.h" 00018 00019 #define error(...) (fprintf(stderr, __VA_ARGS__), exit(1)) 00020 00021 using namespace std; 00022 #include <vector> 00023 #include <string> 00024 #include <stdio.h> 00025 00026 #define LOCAL_CONFIGSOURCE_CHECKSUM 13581 00027 #define SD_CONFIGSOURCE_CHECKSUM 19415 00028 00029 00030 class Config : public Module { 00031 public: 00032 Config(); 00033 00034 void on_module_loaded(); 00035 void on_console_line_received( void* argument ); 00036 void config_cache_load(); 00037 void config_cache_clear(); 00038 void set_string( string setting , string value); 00039 00040 ConfigValue* value(uint16_t check_sum); 00041 ConfigValue* value(uint16_t check_sum_a, uint16_t check_sum_b); 00042 ConfigValue* value(uint16_t check_sum_a, uint16_t check_sum_b, uint16_t check_sum_c ); 00043 ConfigValue* value(uint16_t check_sums[3] ); 00044 00045 void get_module_list(vector<uint16_t>* list, uint16_t family); 00046 00047 bool has_characters(uint16_t check_sum, string str ); 00048 00049 ConfigCache config_cache; // A cache in which ConfigValues are kept 00050 vector<ConfigSource*> config_sources; // A list of all possible coniguration sources 00051 bool config_cache_loaded; // Whether or not the cache is currently popluated 00052 }; 00053 00054 #endif
Generated on Tue Jul 12 2022 20:09:00 by
1.7.2
