Browse Source

Merge pull request #3337 from esenapaj/patch-2

suppress warnings
Scott Lahteine 9 years ago
parent
commit
d771174797

+ 10
- 6
Marlin/M100_Free_Mem_Chk.cpp View File

@@ -137,8 +137,10 @@ void gcode_M100() {
137 137
   // other vital statistics that define the memory pool.
138 138
   //
139 139
   if (code_seen('F')) {
140
-    int max_addr = (int) __brkval;
141
-    int max_cnt = 0;
140
+    #if 0
141
+      int max_addr = (int) __brkval;
142
+      int max_cnt = 0;
143
+    #endif
142 144
     int block_cnt = 0;
143 145
     ptr = (unsigned char*) __brkval;
144 146
     sp = top_of_stack();
@@ -155,10 +157,12 @@ void gcode_M100() {
155 157
           i += j;
156 158
           block_cnt++;
157 159
         }
158
-        if (j > max_cnt) {      // We don't do anything with this information yet
159
-          max_cnt  = j;     // but we do know where the biggest free memory block is.
160
-          max_addr = (int) ptr + i;
161
-        }
160
+        #if 0
161
+          if (j > max_cnt) {      // We don't do anything with this information yet
162
+            max_cnt  = j;     // but we do know where the biggest free memory block is.
163
+            max_addr = (int) ptr + i;
164
+          }
165
+        #endif
162 166
       }
163 167
     }
164 168
     if (block_cnt > 1)

+ 22
- 10
Marlin/Marlin_main.cpp View File

@@ -1638,6 +1638,9 @@ static void setup_for_endstop_move() {
1638 1638
   }
1639 1639
 
1640 1640
   static void stow_z_probe(bool doRaise = true) {
1641
+    #if !(HAS_SERVO_ENDSTOPS && (Z_RAISE_AFTER_PROBING > 0))
1642
+      UNUSED(doRaise);
1643
+    #endif
1641 1644
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1642 1645
       if (DEBUGGING(LEVELING)) {
1643 1646
         print_xyz("stow_z_probe > current_position", current_position);
@@ -1912,11 +1915,13 @@ static void setup_for_endstop_move() {
1912 1915
 
1913 1916
 #endif // AUTO_BED_LEVELING_FEATURE
1914 1917
 
1915
-static void axis_unhomed_error() {
1916
-  LCD_MESSAGEPGM(MSG_YX_UNHOMED);
1917
-  SERIAL_ECHO_START;
1918
-  SERIAL_ECHOLNPGM(MSG_YX_UNHOMED);
1919
-}
1918
+#if ENABLED(Z_PROBE_SLED) || ENABLED(Z_SAFE_HOMING) || ENABLED(AUTO_BED_LEVELING_FEATURE)
1919
+  static void axis_unhomed_error() {
1920
+    LCD_MESSAGEPGM(MSG_YX_UNHOMED);
1921
+    SERIAL_ECHO_START;
1922
+    SERIAL_ECHOLNPGM(MSG_YX_UNHOMED);
1923
+  }
1924
+#endif
1920 1925
 
1921 1926
 #if ENABLED(Z_PROBE_SLED)
1922 1927
 
@@ -2300,6 +2305,8 @@ void unknown_command_error() {
2300 2305
           SERIAL_ECHO_START;
2301 2306
           SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT);
2302 2307
           break;
2308
+        default:
2309
+          break;
2303 2310
       }
2304 2311
     }
2305 2312
     next_busy_signal_ms = ms + 10000UL; // "busy: ..." message every 10s
@@ -3820,7 +3827,7 @@ inline void gcode_M42() {
3820 3827
     }
3821 3828
 
3822 3829
     double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50];
3823
-    uint8_t verbose_level = 1, n_samples = 10, n_legs = 0, schizoid_flag = 0;
3830
+    int8_t verbose_level = 1, n_samples = 10, n_legs = 0, schizoid_flag = 0;
3824 3831
 
3825 3832
     if (code_seen('V')) {
3826 3833
       verbose_level = code_value_short();
@@ -5476,7 +5483,7 @@ inline void gcode_M400() { st_synchronize(); }
5476 5483
     if (delay_index2 == -1) { //initialize the ring buffer if it has not been done since startup
5477 5484
       int temp_ratio = widthFil_to_size_ratio();
5478 5485
 
5479
-      for (delay_index1 = 0; delay_index1 < COUNT(measurement_delay); ++delay_index1)
5486
+      for (delay_index1 = 0; delay_index1 < (int)COUNT(measurement_delay); ++delay_index1)
5480 5487
         measurement_delay[delay_index1] = temp_ratio - 100;  //subtract 100 to scale within a signed byte
5481 5488
 
5482 5489
       delay_index1 = delay_index2 = 0;
@@ -5525,7 +5532,7 @@ inline void gcode_M410() { quickStop(); }
5525 5532
    * M421: Set a single Mesh Bed Leveling Z coordinate
5526 5533
    */
5527 5534
   inline void gcode_M421() {
5528
-    float x, y, z;
5535
+    float x = 0, y = 0, z = 0;
5529 5536
     bool err = false, hasX, hasY, hasZ;
5530 5537
     if ((hasX = code_seen('X'))) x = code_value();
5531 5538
     if ((hasY = code_seen('Y'))) y = code_value();
@@ -5688,7 +5695,10 @@ inline void gcode_M503() {
5688 5695
       return;
5689 5696
     }
5690 5697
 
5691
-    float lastpos[NUM_AXIS], fr60 = feedrate / 60;
5698
+    float lastpos[NUM_AXIS];
5699
+    #if ENABLED(DELTA)
5700
+      float fr60 = feedrate / 60;
5701
+    #endif
5692 5702
 
5693 5703
     for (int i = 0; i < NUM_AXIS; i++)
5694 5704
       lastpos[i] = destination[i] = current_position[i];
@@ -5745,7 +5755,9 @@ inline void gcode_M503() {
5745 5755
     disable_e3();
5746 5756
     delay(100);
5747 5757
     LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
5748
-    millis_t next_tick = 0;
5758
+    #if DISABLED(AUTO_FILAMENT_CHANGE)
5759
+      millis_t next_tick = 0;
5760
+    #endif
5749 5761
     KEEPALIVE_STATE(PAUSED_FOR_USER);
5750 5762
     while (!lcd_clicked()) {
5751 5763
       #if DISABLED(AUTO_FILAMENT_CHANGE)

+ 1
- 0
Marlin/Sd2Card.cpp View File

@@ -365,6 +365,7 @@ bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
365 365
   #if DISABLED(SOFTWARE_SPI)
366 366
     return setSckRate(sckRateID);
367 367
   #else  // SOFTWARE_SPI
368
+    UNUSED(sckRateID);
368 369
     return true;
369 370
   #endif  // SOFTWARE_SPI
370 371
 

+ 4
- 4
Marlin/cardreader.cpp View File

@@ -348,11 +348,11 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) {
348 348
   char *dirname_start, *dirname_end;
349 349
   if (name[0] == '/') {
350 350
     dirname_start = &name[1];
351
-    while (dirname_start > 0) {
351
+    while (dirname_start != NULL) {
352 352
       dirname_end = strchr(dirname_start, '/');
353 353
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
354 354
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
355
-      if (dirname_end > 0 && dirname_end > dirname_start) {
355
+      if (dirname_end != NULL && dirname_end > dirname_start) {
356 356
         char subdirname[FILENAME_LENGTH];
357 357
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
358 358
         subdirname[dirname_end - dirname_start] = 0;
@@ -429,11 +429,11 @@ void CardReader::removeFile(char* name) {
429 429
   char *dirname_start, *dirname_end;
430 430
   if (name[0] == '/') {
431 431
     dirname_start = strchr(name, '/') + 1;
432
-    while (dirname_start > 0) {
432
+    while (dirname_start != NULL) {
433 433
       dirname_end = strchr(dirname_start, '/');
434 434
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
435 435
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
436
-      if (dirname_end > 0 && dirname_end > dirname_start) {
436
+      if (dirname_end != NULL && dirname_end > dirname_start) {
437 437
         char subdirname[FILENAME_LENGTH];
438 438
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
439 439
         subdirname[dirname_end - dirname_start] = 0;

+ 1
- 1
Marlin/temperature.h View File

@@ -83,7 +83,7 @@ extern float current_temperature_bed;
83 83
 
84 84
   #if ENABLED(PID_PARAMS_PER_EXTRUDER)
85 85
     extern float Kp[EXTRUDERS], Ki[EXTRUDERS], Kd[EXTRUDERS], Kc[EXTRUDERS]; // one param per extruder
86
-    #define PID_PARAM(param,e) param[e] // use macro to point to array value
86
+    #define PID_PARAM(param, e) param[e] // use macro to point to array value
87 87
   #else
88 88
     extern float Kp, Ki, Kd, Kc; // one param per extruder - saves 20 or 36 bytes of ram (inc array pointer)
89 89
     #define PID_PARAM(param, e) param // use macro to point directly to value

+ 17
- 1
Marlin/ultralcd.cpp View File

@@ -755,6 +755,8 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
755 755
   if (temph > 0) setTargetHotend(temph, endnum);
756 756
   #if TEMP_SENSOR_BED != 0
757 757
     setTargetBed(tempb);
758
+  #else
759
+    UNUSED(tempb);
758 760
   #endif
759 761
   #if FAN_COUNT > 0
760 762
     #if FAN_COUNT > 1
@@ -762,6 +764,8 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
762 764
     #else
763 765
       fanSpeeds[0] = fan;
764 766
     #endif
767
+  #else
768
+    UNUSED(fan);
765 769
   #endif
766 770
   lcd_return_to_status();
767 771
 }
@@ -1318,10 +1322,16 @@ static void lcd_control_menu() {
1318 1322
   // Helpers for editing PID Ki & Kd values
1319 1323
   // grab the PID value out of the temp variable; scale it; then update the PID driver
1320 1324
   void copy_and_scalePID_i(int e) {
1325
+    #if DISABLED(PID_PARAMS_PER_EXTRUDER)
1326
+      UNUSED(e);
1327
+    #endif
1321 1328
     PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
1322 1329
     updatePID();
1323 1330
   }
1324 1331
   void copy_and_scalePID_d(int e) {
1332
+    #if DISABLED(PID_PARAMS_PER_EXTRUDER)
1333
+      UNUSED(e);
1334
+    #endif
1325 1335
     PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
1326 1336
     updatePID();
1327 1337
   }
@@ -1892,18 +1902,20 @@ static void menu_action_function(menuFunc_t func) { (*func)(); }
1892 1902
 #if ENABLED(SDSUPPORT)
1893 1903
 
1894 1904
   static void menu_action_sdfile(const char* filename, char* longFilename) {
1905
+    UNUSED(longFilename);
1895 1906
     card.openAndPrintFile(filename);
1896 1907
     lcd_return_to_status();
1897 1908
   }
1898 1909
 
1899 1910
   static void menu_action_sddirectory(const char* filename, char* longFilename) {
1911
+    UNUSED(longFilename);
1900 1912
     card.chdir(filename);
1901 1913
     encoderPosition = 0;
1902 1914
   }
1903 1915
 
1904 1916
 #endif //SDSUPPORT
1905 1917
 
1906
-static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { *ptr = !(*ptr); }
1918
+static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); }
1907 1919
 static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) {
1908 1920
   menu_action_setting_edit_bool(pstr, ptr);
1909 1921
   (*callback)();
@@ -2203,6 +2215,10 @@ void lcd_ignore_click(bool b) {
2203 2215
 }
2204 2216
 
2205 2217
 void lcd_finishstatus(bool persist=false) {
2218
+  #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
2219
+    UNUSED(persist);
2220
+  #endif
2221
+
2206 2222
   #if ENABLED(LCD_PROGRESS_BAR)
2207 2223
     progress_bar_ms = millis();
2208 2224
     #if PROGRESS_MSG_EXPIRE > 0

+ 1
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -873,6 +873,7 @@ void lcd_implementation_drawedit(const char* pstr, const char* value) {
873 873
 #if ENABLED(SDSUPPORT)
874 874
 
875 875
   static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) {
876
+    UNUSED(pstr);
876 877
     char c;
877 878
     uint8_t n = LCD_WIDTH - concat;
878 879
     lcd.setCursor(0, row);

Loading…
Cancel
Save