Sfoglia il codice sorgente

Replace types.h with millis_t.h

Scott Lahteine 5 anni fa
parent
commit
b641571098

+ 0
- 3
Marlin/src/core/macros.h Vedi File

@@ -193,9 +193,6 @@
193 193
 
194 194
 #define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
195 195
 
196
-#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
197
-#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
198
-
199 196
 #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f)
200 197
 #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f)
201 198
 

Marlin/src/core/types.h → Marlin/src/core/millis_t.h Vedi File

@@ -22,25 +22,8 @@
22 22
 #pragma once
23 23
 
24 24
 #include <stdint.h>
25
-#include <string.h>
26 25
 
27 26
 typedef uint32_t millis_t;
28 27
 
29
-#pragma pack(push, 1) // No padding between fields
30
-
31
-typedef struct {
32
-  float unload_length, load_length;
33
-} fil_change_settings_t;
34
-
35
-typedef struct {
36
-  float retract_length,                     // M207 S - G10 Retract length
37
-        retract_feedrate_mm_s,              // M207 F - G10 Retract feedrate
38
-        retract_zraise,                      // M207 Z - G10 Retract hop size
39
-        retract_recover_length,             // M208 S - G11 Recover length
40
-        retract_recover_feedrate_mm_s,      // M208 F - G11 Recover feedrate
41
-        swap_retract_length,                // M207 W - G10 Swap Retract length
42
-        swap_retract_recover_length,        // M208 W - G11 Swap Recover length
43
-        swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate
44
-} fwretract_settings_t;
45
-
46
-#pragma pack(pop)
28
+#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
29
+#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))

+ 19
- 0
Marlin/src/feature/fwretract.h Vedi File

@@ -27,6 +27,23 @@
27 27
 
28 28
 #include "../inc/MarlinConfigPre.h"
29 29
 
30
+#pragma pack(push, 1) // No padding between fields
31
+
32
+typedef struct {
33
+  float retract_length,                     // M207 S - G10 Retract length
34
+        retract_feedrate_mm_s,              // M207 F - G10 Retract feedrate
35
+        retract_zraise,                      // M207 Z - G10 Retract hop size
36
+        retract_recover_length,             // M208 S - G11 Recover length
37
+        retract_recover_feedrate_mm_s,      // M208 F - G11 Recover feedrate
38
+        swap_retract_length,                // M207 W - G10 Swap Retract length
39
+        swap_retract_recover_length,        // M208 W - G11 Swap Recover length
40
+        swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate
41
+} fwretract_settings_t;
42
+
43
+#pragma pack(pop)
44
+
45
+#if ENABLED(FWRETRACT)
46
+
30 47
 class FWRetract {
31 48
 private:
32 49
   #if EXTRUDERS > 1
@@ -69,3 +86,5 @@ public:
69 86
 };
70 87
 
71 88
 extern FWRetract fwretract;
89
+
90
+#endif // FWRETRACT

+ 9
- 1
Marlin/src/feature/pause.h Vedi File

@@ -26,10 +26,16 @@
26 26
  * This may be combined with related G-codes if features are consolidated.
27 27
  */
28 28
 
29
-#include "../libs/nozzle.h"
29
+typedef struct {
30
+  float unload_length, load_length;
31
+} fil_change_settings_t;
30 32
 
31 33
 #include "../inc/MarlinConfigPre.h"
32 34
 
35
+#if ENABLED(ADVANCED_PAUSE_FEATURE)
36
+
37
+#include "../libs/nozzle.h"
38
+
33 39
 enum AdvancedPauseMode : char {
34 40
   ADVANCED_PAUSE_MODE_PAUSE_PRINT,
35 41
   ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
@@ -86,3 +92,5 @@ bool load_filament(const float &slow_load_length=0, const float &fast_load_lengt
86 92
                           const bool pause_for_user=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PARAMS);
87 93
 
88 94
 bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT);
95
+
96
+#endif //ADVANCED_PAUSE_FEATURE

+ 2
- 6
Marlin/src/feature/power.h Vedi File

@@ -19,15 +19,13 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
+#pragma once
22 23
 
23 24
 /**
24 25
  * power.h - power control
25 26
  */
26 27
 
27
-#ifndef POWER_H
28
-#define POWER_H
29
-
30
-#include "../core/types.h"
28
+#include "../core/millis_t.h"
31 29
 
32 30
 class Power {
33 31
   public:
@@ -40,5 +38,3 @@ class Power {
40 38
 };
41 39
 
42 40
 extern Power powerManager;
43
-
44
-#endif // POWER_H

+ 1
- 1
Marlin/src/feature/power_loss_recovery.h Vedi File

@@ -28,7 +28,7 @@
28 28
 #define _POWER_LOSS_RECOVERY_H_
29 29
 
30 30
 #include "../sd/cardreader.h"
31
-#include "../core/types.h"
31
+#include "../core/millis_t.h"
32 32
 #include "../inc/MarlinConfigPre.h"
33 33
 
34 34
 #define SAVE_INFO_INTERVAL_MS 0

+ 1
- 1
Marlin/src/inc/MarlinConfigPre.h Vedi File

@@ -30,7 +30,7 @@
30 30
 #include "../HAL/platforms.h"
31 31
 #include "../core/boards.h"
32 32
 #include "../core/macros.h"
33
-#include "../core/types.h"
33
+#include "../core/millis_t.h"
34 34
 #include "Version.h"
35 35
 #include "../../Configuration.h"
36 36
 #include "Conditionals_LCD.h"

+ 1
- 1
Marlin/src/libs/stopwatch.h Vedi File

@@ -27,7 +27,7 @@
27 27
 //#define DEBUG_STOPWATCH
28 28
 
29 29
 #include "../core/macros.h" // for FORCE_INLINE
30
-#include "../core/types.h"  // for millis_t
30
+#include "../core/millis_t.h"
31 31
 
32 32
 /**
33 33
  * @brief Stopwatch class

+ 2
- 7
Marlin/src/module/configuration_store.cpp Vedi File

@@ -81,13 +81,8 @@
81 81
   #include "../module/probe.h"
82 82
 #endif
83 83
 
84
-#if ENABLED(FWRETRACT)
85
-  #include "../feature/fwretract.h"
86
-#endif
87
-
88
-#if ENABLED(ADVANCED_PAUSE_FEATURE)
89
-  #include "../feature/pause.h"
90
-#endif
84
+#include "../feature/fwretract.h"
85
+#include "../feature/pause.h"
91 86
 
92 87
 #if EXTRUDERS > 1
93 88
   #include "tool_change.h"

Loading…
Annulla
Salva