Преглед изворни кода

Merge pull request #3337 from esenapaj/patch-2

suppress warnings
Scott Lahteine пре 9 година
родитељ
комит
d771174797

+ 10
- 6
Marlin/M100_Free_Mem_Chk.cpp Прегледај датотеку

137
   // other vital statistics that define the memory pool.
137
   // other vital statistics that define the memory pool.
138
   //
138
   //
139
   if (code_seen('F')) {
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
     int block_cnt = 0;
144
     int block_cnt = 0;
143
     ptr = (unsigned char*) __brkval;
145
     ptr = (unsigned char*) __brkval;
144
     sp = top_of_stack();
146
     sp = top_of_stack();
155
           i += j;
157
           i += j;
156
           block_cnt++;
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
     if (block_cnt > 1)
168
     if (block_cnt > 1)

+ 22
- 10
Marlin/Marlin_main.cpp Прегледај датотеку

1638
   }
1638
   }
1639
 
1639
 
1640
   static void stow_z_probe(bool doRaise = true) {
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
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1644
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1642
       if (DEBUGGING(LEVELING)) {
1645
       if (DEBUGGING(LEVELING)) {
1643
         print_xyz("stow_z_probe > current_position", current_position);
1646
         print_xyz("stow_z_probe > current_position", current_position);
1912
 
1915
 
1913
 #endif // AUTO_BED_LEVELING_FEATURE
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
 #if ENABLED(Z_PROBE_SLED)
1926
 #if ENABLED(Z_PROBE_SLED)
1922
 
1927
 
2300
           SERIAL_ECHO_START;
2305
           SERIAL_ECHO_START;
2301
           SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT);
2306
           SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT);
2302
           break;
2307
           break;
2308
+        default:
2309
+          break;
2303
       }
2310
       }
2304
     }
2311
     }
2305
     next_busy_signal_ms = ms + 10000UL; // "busy: ..." message every 10s
2312
     next_busy_signal_ms = ms + 10000UL; // "busy: ..." message every 10s
3820
     }
3827
     }
3821
 
3828
 
3822
     double sum = 0.0, mean = 0.0, sigma = 0.0, sample_set[50];
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
     if (code_seen('V')) {
3832
     if (code_seen('V')) {
3826
       verbose_level = code_value_short();
3833
       verbose_level = code_value_short();
5476
     if (delay_index2 == -1) { //initialize the ring buffer if it has not been done since startup
5483
     if (delay_index2 == -1) { //initialize the ring buffer if it has not been done since startup
5477
       int temp_ratio = widthFil_to_size_ratio();
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
         measurement_delay[delay_index1] = temp_ratio - 100;  //subtract 100 to scale within a signed byte
5487
         measurement_delay[delay_index1] = temp_ratio - 100;  //subtract 100 to scale within a signed byte
5481
 
5488
 
5482
       delay_index1 = delay_index2 = 0;
5489
       delay_index1 = delay_index2 = 0;
5525
    * M421: Set a single Mesh Bed Leveling Z coordinate
5532
    * M421: Set a single Mesh Bed Leveling Z coordinate
5526
    */
5533
    */
5527
   inline void gcode_M421() {
5534
   inline void gcode_M421() {
5528
-    float x, y, z;
5535
+    float x = 0, y = 0, z = 0;
5529
     bool err = false, hasX, hasY, hasZ;
5536
     bool err = false, hasX, hasY, hasZ;
5530
     if ((hasX = code_seen('X'))) x = code_value();
5537
     if ((hasX = code_seen('X'))) x = code_value();
5531
     if ((hasY = code_seen('Y'))) y = code_value();
5538
     if ((hasY = code_seen('Y'))) y = code_value();
5688
       return;
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
     for (int i = 0; i < NUM_AXIS; i++)
5703
     for (int i = 0; i < NUM_AXIS; i++)
5694
       lastpos[i] = destination[i] = current_position[i];
5704
       lastpos[i] = destination[i] = current_position[i];
5745
     disable_e3();
5755
     disable_e3();
5746
     delay(100);
5756
     delay(100);
5747
     LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
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
     KEEPALIVE_STATE(PAUSED_FOR_USER);
5761
     KEEPALIVE_STATE(PAUSED_FOR_USER);
5750
     while (!lcd_clicked()) {
5762
     while (!lcd_clicked()) {
5751
       #if DISABLED(AUTO_FILAMENT_CHANGE)
5763
       #if DISABLED(AUTO_FILAMENT_CHANGE)

+ 1
- 0
Marlin/Sd2Card.cpp Прегледај датотеку

365
   #if DISABLED(SOFTWARE_SPI)
365
   #if DISABLED(SOFTWARE_SPI)
366
     return setSckRate(sckRateID);
366
     return setSckRate(sckRateID);
367
   #else  // SOFTWARE_SPI
367
   #else  // SOFTWARE_SPI
368
+    UNUSED(sckRateID);
368
     return true;
369
     return true;
369
   #endif  // SOFTWARE_SPI
370
   #endif  // SOFTWARE_SPI
370
 
371
 

+ 4
- 4
Marlin/cardreader.cpp Прегледај датотеку

348
   char *dirname_start, *dirname_end;
348
   char *dirname_start, *dirname_end;
349
   if (name[0] == '/') {
349
   if (name[0] == '/') {
350
     dirname_start = &name[1];
350
     dirname_start = &name[1];
351
-    while (dirname_start > 0) {
351
+    while (dirname_start != NULL) {
352
       dirname_end = strchr(dirname_start, '/');
352
       dirname_end = strchr(dirname_start, '/');
353
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
353
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
354
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
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
         char subdirname[FILENAME_LENGTH];
356
         char subdirname[FILENAME_LENGTH];
357
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
357
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
358
         subdirname[dirname_end - dirname_start] = 0;
358
         subdirname[dirname_end - dirname_start] = 0;
429
   char *dirname_start, *dirname_end;
429
   char *dirname_start, *dirname_end;
430
   if (name[0] == '/') {
430
   if (name[0] == '/') {
431
     dirname_start = strchr(name, '/') + 1;
431
     dirname_start = strchr(name, '/') + 1;
432
-    while (dirname_start > 0) {
432
+    while (dirname_start != NULL) {
433
       dirname_end = strchr(dirname_start, '/');
433
       dirname_end = strchr(dirname_start, '/');
434
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
434
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
435
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
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
         char subdirname[FILENAME_LENGTH];
437
         char subdirname[FILENAME_LENGTH];
438
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
438
         strncpy(subdirname, dirname_start, dirname_end - dirname_start);
439
         subdirname[dirname_end - dirname_start] = 0;
439
         subdirname[dirname_end - dirname_start] = 0;

+ 1
- 1
Marlin/temperature.h Прегледај датотеку

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

+ 17
- 1
Marlin/ultralcd.cpp Прегледај датотеку

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

+ 1
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h Прегледај датотеку

873
 #if ENABLED(SDSUPPORT)
873
 #if ENABLED(SDSUPPORT)
874
 
874
 
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) {
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
     char c;
877
     char c;
877
     uint8_t n = LCD_WIDTH - concat;
878
     uint8_t n = LCD_WIDTH - concat;
878
     lcd.setCursor(0, row);
879
     lcd.setCursor(0, row);

Loading…
Откажи
Сачувај