Browse Source

Change prusa_stat_printerstatus parameter to uint8_t

Also changes status_number global variable to uint8_t

Changes save 80 bytes of flash and 1 byte of SRAM (Arduino IDE 1.8.19)
Guðni Már Gilbert 2 years ago
parent
commit
459570ab66
3 changed files with 5 additions and 5 deletions
  1. 1 1
      Firmware/Marlin.h
  2. 2 2
      Firmware/Marlin_main.cpp
  3. 2 2
      Firmware/ultralcd.cpp

+ 1 - 1
Firmware/Marlin.h

@@ -335,7 +335,7 @@ extern bool loading_flag;
 extern uint8_t usb_printing_counter;
 extern unsigned long total_filament_used;
 void save_statistics(unsigned long _total_filament_used, unsigned long _total_print_time);
-extern unsigned int status_number;
+extern uint8_t status_number;
 extern uint8_t heating_status_counter;
 extern char snmm_filaments_used;
 extern unsigned long PingTime;

+ 2 - 2
Firmware/Marlin_main.cpp

@@ -213,7 +213,7 @@ bool mesh_bed_leveling_flag = false;
 bool prusa_sd_card_upload = false;
 #endif
 
-unsigned int status_number = 0;
+uint8_t status_number = 0;
 
 unsigned long total_filament_used;
 HeatingStatus heating_status;
@@ -4509,7 +4509,7 @@ void process_commands()
 			}	  
 		}
 		else if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN
-		  printf_P(_N("%d"), status_number);
+		  printf_P(_N("%u"), status_number);
 
         } else if( code_seen_P(PSTR("FANPINTST"))){
             gcode_PRUSA_BadRAMBoFanTest();

+ 2 - 2
Firmware/ultralcd.cpp

@@ -126,7 +126,7 @@ static void lcd_control_temperature_menu();
 #ifdef TMC2130
 static void lcd_settings_linearity_correction_menu_save();
 #endif
-static void prusa_stat_printerstatus(int _status);
+static void prusa_stat_printerstatus(uint8_t _status);
 static void prusa_stat_farm_number();
 static void prusa_stat_diameter();
 static void prusa_stat_temperatures();
@@ -4064,7 +4064,7 @@ void prusa_statistics(uint8_t _message, uint8_t _fil_nr) {
 
 }
 
-static void prusa_stat_printerstatus(int _status)
+static void prusa_stat_printerstatus(uint8_t _status)
 {
 	SERIAL_ECHOPGM("[PRN:");
 	SERIAL_ECHO(_status);