Browse Source

Do not create static object in function. Saves 8B RAM and 16B flash, because there is no need to guard constructor against concurrent calls.

Marek Bel 6 years ago
parent
commit
f819392d10
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Firmware/Marlin_main.cpp

+ 1 - 1
Firmware/Marlin_main.cpp

@@ -318,6 +318,7 @@ float pause_lastpos[4];
 unsigned long pause_time = 0;
 unsigned long start_pause_print = millis();
 unsigned long t_fan_rising_edge = millis();
+static LongTimer safetyTimer;
 
 //unsigned long load_filament_time;
 
@@ -7156,7 +7157,6 @@ static void handleSafetyTimer()
 #if (EXTRUDERS > 1)
 #error Implemented only for one extruder.
 #endif //(EXTRUDERS > 1)
-    static LongTimer safetyTimer;
     if (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4)
         || (lcd_commands_type == LCD_COMMAND_V2_CAL) || (!degTargetBed() && !degTargetHotend(0)))
     {