DFU: increase detach timeout to 2 seconds
[clinton/Smoothieware.git] / src / libs / Config.cpp
index 058d9ce..3d85848 100644 (file)
@@ -1,8 +1,8 @@
-/*  
+/*
       This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
       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.
       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.
-      You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. 
+      You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
 */
 
 
@@ -47,14 +47,14 @@ void Config::set_string( string setting, string value ){
     this->kernel->call_event(ON_CONFIG_RELOAD);
 }
 
-void Config::get_module_list(vector<uint16_t>* list, uint16_t family){ 
+void Config::get_module_list(vector<uint16_t>* list, uint16_t family){
     for( unsigned int i=1; i<this->config_cache.size(); i++){
-        ConfigValue* value = this->config_cache.at(i); 
+        ConfigValue* value = this->config_cache.at(i);
         //if( value->check_sums.size() == 3 && value->check_sums.at(2) == 29545 && value->check_sums.at(0) == family ){
         if( value->check_sums[2] == 29545 && value->check_sums[0] == family ){
-            // We found a module enable for this family, add it's number 
+            // We found a module enable for this family, add it's number
             list->push_back(value->check_sums[1]);
-        } 
+        }
     }
 }
 
@@ -88,28 +88,28 @@ void Config::config_cache_clear(){
 
 
 ConfigValue* Config::value(uint16_t check_sum_a, uint16_t check_sum_b, uint16_t check_sum_c ){
-    uint16_t check_sums[3]; 
-    check_sums[0] = check_sum_a; 
+    uint16_t check_sums[3];
+    check_sums[0] = check_sum_a;
     check_sums[1] = check_sum_b;
     check_sums[2] = check_sum_c;
     return this->value(check_sums);
-}    
+}
 
 ConfigValue* Config::value(uint16_t check_sum_a, uint16_t check_sum_b){
-    uint16_t check_sums[3]; 
-    check_sums[0] = check_sum_a; 
+    uint16_t check_sums[3];
+    check_sums[0] = check_sum_a;
     check_sums[1] = check_sum_b;
     check_sums[2] = 0x0000;
     return this->value(check_sums);
-}    
+}
 
 ConfigValue* Config::value(uint16_t check_sum){
-    uint16_t check_sums[3]; 
-    check_sums[0] = check_sum; 
+    uint16_t check_sums[3];
+    check_sums[0] = check_sum;
     check_sums[1] = 0x0000;
     check_sums[2] = 0x0000;
     return this->value(check_sums);
-}    
+}
     
 // Get a value from the configuration as a string
 // Because we don't like to waste space in Flash with lengthy config parameter names, we take a checksum instead so that the name does not have to be stored
@@ -120,18 +120,18 @@ ConfigValue* Config::value(uint16_t check_sums[]){
     if( !cache_preloaded ){ this->config_cache_load(); }
      
     for( unsigned int i=1; i<this->config_cache.size(); i++){
-        // If this line matches the checksum 
+        // If this line matches the checksum
         bool match = true;
         unsigned int counter = 0;
         while(check_sums[counter] != 0x0000 && counter <= 2 ){
              if(this->config_cache[i]->check_sums[counter] != check_sums[counter] ){
                 match = false;
-                break; 
+                break;
             }
             counter++;
-        } 
-        if( match == false ){ 
-            continue; 
+        }
+        if( match == false ){
+            continue;
         }
         result = this->config_cache[i];
         break;