Selaa lähdekoodia

suppress warnings

esenapaj 8 vuotta sitten
vanhempi
commit
f9e1a0ee6c

+ 10
- 6
Marlin/M100_Free_Mem_Chk.cpp Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -726,6 +726,8 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
726 726
   if (temph > 0) setTargetHotend(temph, endnum);
727 727
   #if TEMP_SENSOR_BED != 0
728 728
     setTargetBed(tempb);
729
+  #else
730
+    UNUSED(tempb);
729 731
   #endif
730 732
   #if FAN_COUNT > 0
731 733
     #if FAN_COUNT > 1
@@ -733,6 +735,8 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
733 735
     #else
734 736
       fanSpeeds[0] = fan;
735 737
     #endif
738
+  #else
739
+    UNUSED(fan);
736 740
   #endif
737 741
   lcd_return_to_status();
738 742
 }
@@ -1146,10 +1150,16 @@ static void lcd_control_menu() {
1146 1150
   // Helpers for editing PID Ki & Kd values
1147 1151
   // grab the PID value out of the temp variable; scale it; then update the PID driver
1148 1152
   void copy_and_scalePID_i(int e) {
1153
+    #if DISABLED(PID_PARAMS_PER_EXTRUDER)
1154
+      UNUSED(e);
1155
+    #endif
1149 1156
     PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
1150 1157
     updatePID();
1151 1158
   }
1152 1159
   void copy_and_scalePID_d(int e) {
1160
+    #if DISABLED(PID_PARAMS_PER_EXTRUDER)
1161
+      UNUSED(e);
1162
+    #endif
1153 1163
     PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
1154 1164
     updatePID();
1155 1165
   }
@@ -1720,18 +1730,20 @@ static void menu_action_function(menuFunc_t func) { (*func)(); }
1720 1730
 #if ENABLED(SDSUPPORT)
1721 1731
 
1722 1732
   static void menu_action_sdfile(const char* filename, char* longFilename) {
1733
+    UNUSED(longFilename);
1723 1734
     card.openAndPrintFile(filename);
1724 1735
     lcd_return_to_status();
1725 1736
   }
1726 1737
 
1727 1738
   static void menu_action_sddirectory(const char* filename, char* longFilename) {
1739
+    UNUSED(longFilename);
1728 1740
     card.chdir(filename);
1729 1741
     encoderPosition = 0;
1730 1742
   }
1731 1743
 
1732 1744
 #endif //SDSUPPORT
1733 1745
 
1734
-static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { *ptr = !(*ptr); }
1746
+static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) {UNUSED(pstr); *ptr = !(*ptr); }
1735 1747
 static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) {
1736 1748
   menu_action_setting_edit_bool(pstr, ptr);
1737 1749
   (*callback)();
@@ -2031,6 +2043,10 @@ void lcd_ignore_click(bool b) {
2031 2043
 }
2032 2044
 
2033 2045
 void lcd_finishstatus(bool persist=false) {
2046
+  #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0))
2047
+    UNUSED(persist);
2048
+  #endif
2049
+
2034 2050
   #if ENABLED(LCD_PROGRESS_BAR)
2035 2051
     progress_bar_ms = millis();
2036 2052
     #if PROGRESS_MSG_EXPIRE > 0

+ 1
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h Näytä tiedosto

@@ -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…
Peruuta
Tallenna