diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 3f4e99ebb..294d6213c 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -193,9 +193,6 @@ #define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0) -#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) -#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) - #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/millis_t.h similarity index 52% rename from Marlin/src/core/types.h rename to Marlin/src/core/millis_t.h index 7223087f1..97532374b 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/millis_t.h @@ -22,25 +22,8 @@ #pragma once #include -#include typedef uint32_t millis_t; -#pragma pack(push, 1) // No padding between fields - -typedef struct { - float unload_length, load_length; -} fil_change_settings_t; - -typedef struct { - float retract_length, // M207 S - G10 Retract length - retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - retract_zraise, // M207 Z - G10 Retract hop size - retract_recover_length, // M208 S - G11 Recover length - retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate - swap_retract_length, // M207 W - G10 Swap Retract length - swap_retract_recover_length, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate -} fwretract_settings_t; - -#pragma pack(pop) +#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) +#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index bcc44cf83..9da737465 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -27,6 +27,23 @@ #include "../inc/MarlinConfigPre.h" +#pragma pack(push, 1) // No padding between fields + +typedef struct { + float retract_length, // M207 S - G10 Retract length + retract_feedrate_mm_s, // M207 F - G10 Retract feedrate + retract_zraise, // M207 Z - G10 Retract hop size + retract_recover_length, // M208 S - G11 Recover length + retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate + swap_retract_length, // M207 W - G10 Swap Retract length + swap_retract_recover_length, // M208 W - G11 Swap Recover length + swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate +} fwretract_settings_t; + +#pragma pack(pop) + +#if ENABLED(FWRETRACT) + class FWRetract { private: #if EXTRUDERS > 1 @@ -69,3 +86,5 @@ public: }; extern FWRetract fwretract; + +#endif // FWRETRACT diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 7c60bdecb..d5c39846a 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -26,10 +26,16 @@ * This may be combined with related G-codes if features are consolidated. */ -#include "../libs/nozzle.h" +typedef struct { + float unload_length, load_length; +} fil_change_settings_t; #include "../inc/MarlinConfigPre.h" +#if ENABLED(ADVANCED_PAUSE_FEATURE) + +#include "../libs/nozzle.h" + enum AdvancedPauseMode : char { ADVANCED_PAUSE_MODE_PAUSE_PRINT, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, @@ -86,3 +92,5 @@ bool load_filament(const float &slow_load_length=0, const float &fast_load_lengt const bool pause_for_user=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PARAMS); bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT); + +#endif //ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 225e4dc6f..101ccb4a5 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -19,15 +19,13 @@ * along with this program. If not, see . * */ +#pragma once /** * power.h - power control */ -#ifndef POWER_H -#define POWER_H - -#include "../core/types.h" +#include "../core/millis_t.h" class Power { public: @@ -40,5 +38,3 @@ class Power { }; extern Power powerManager; - -#endif // POWER_H diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index 04b011be1..d173b87c5 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -28,7 +28,7 @@ #define _POWER_LOSS_RECOVERY_H_ #include "../sd/cardreader.h" -#include "../core/types.h" +#include "../core/millis_t.h" #include "../inc/MarlinConfigPre.h" #define SAVE_INFO_INTERVAL_MS 0 diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index ae36a1efc..3bca46ed0 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -30,7 +30,7 @@ #include "../HAL/platforms.h" #include "../core/boards.h" #include "../core/macros.h" -#include "../core/types.h" +#include "../core/millis_t.h" #include "Version.h" #include "../../Configuration.h" #include "Conditionals_LCD.h" diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index 64099e774..358f636ca 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -27,7 +27,7 @@ //#define DEBUG_STOPWATCH #include "../core/macros.h" // for FORCE_INLINE -#include "../core/types.h" // for millis_t +#include "../core/millis_t.h" /** * @brief Stopwatch class diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index bb3e341cb..16e30e41f 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -81,13 +81,8 @@ #include "../module/probe.h" #endif -#if ENABLED(FWRETRACT) - #include "../feature/fwretract.h" -#endif - -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" -#endif +#include "../feature/fwretract.h" +#include "../feature/pause.h" #if EXTRUDERS > 1 #include "tool_change.h"