Browse Source

Replace types.h with millis_t.h

Scott Lahteine 6 years ago
parent
commit
b641571098

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

193
 
193
 
194
 #define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
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
 #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f)
196
 #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f)
200
 #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f)
197
 #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f)
201
 
198
 

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

22
 #pragma once
22
 #pragma once
23
 
23
 
24
 #include <stdint.h>
24
 #include <stdint.h>
25
-#include <string.h>
26
 
25
 
27
 typedef uint32_t millis_t;
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 View File

27
 
27
 
28
 #include "../inc/MarlinConfigPre.h"
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
 class FWRetract {
47
 class FWRetract {
31
 private:
48
 private:
32
   #if EXTRUDERS > 1
49
   #if EXTRUDERS > 1
69
 };
86
 };
70
 
87
 
71
 extern FWRetract fwretract;
88
 extern FWRetract fwretract;
89
+
90
+#endif // FWRETRACT

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

26
  * This may be combined with related G-codes if features are consolidated.
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
 #include "../inc/MarlinConfigPre.h"
33
 #include "../inc/MarlinConfigPre.h"
32
 
34
 
35
+#if ENABLED(ADVANCED_PAUSE_FEATURE)
36
+
37
+#include "../libs/nozzle.h"
38
+
33
 enum AdvancedPauseMode : char {
39
 enum AdvancedPauseMode : char {
34
   ADVANCED_PAUSE_MODE_PAUSE_PRINT,
40
   ADVANCED_PAUSE_MODE_PAUSE_PRINT,
35
   ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
41
   ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
86
                           const bool pause_for_user=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PARAMS);
92
                           const bool pause_for_user=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PARAMS);
87
 
93
 
88
 bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT);
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 View File

19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
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
  * power.h - power control
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
 class Power {
30
 class Power {
33
   public:
31
   public:
40
 };
38
 };
41
 
39
 
42
 extern Power powerManager;
40
 extern Power powerManager;
43
-
44
-#endif // POWER_H

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

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

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

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

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

27
 //#define DEBUG_STOPWATCH
27
 //#define DEBUG_STOPWATCH
28
 
28
 
29
 #include "../core/macros.h" // for FORCE_INLINE
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
  * @brief Stopwatch class
33
  * @brief Stopwatch class

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

81
   #include "../module/probe.h"
81
   #include "../module/probe.h"
82
 #endif
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
 #if EXTRUDERS > 1
87
 #if EXTRUDERS > 1
93
   #include "tool_change.h"
88
   #include "tool_change.h"

Loading…
Cancel
Save