Replace types.h with millis_t.h

This commit is contained in:
Scott Lahteine 2018-10-20 16:10:50 -05:00
parent eeef4e630a
commit b641571098
9 changed files with 37 additions and 39 deletions

View File

@ -193,9 +193,6 @@
#define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0) #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 MMM_TO_MMS(MM_M) ((MM_M)/60.0f)
#define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f)

View File

@ -22,25 +22,8 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include <string.h>
typedef uint32_t millis_t; typedef uint32_t millis_t;
#pragma pack(push, 1) // No padding between fields #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
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)

View File

@ -27,6 +27,23 @@
#include "../inc/MarlinConfigPre.h" #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 { class FWRetract {
private: private:
#if EXTRUDERS > 1 #if EXTRUDERS > 1
@ -69,3 +86,5 @@ public:
}; };
extern FWRetract fwretract; extern FWRetract fwretract;
#endif // FWRETRACT

View File

@ -26,10 +26,16 @@
* This may be combined with related G-codes if features are consolidated. * 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" #include "../inc/MarlinConfigPre.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#include "../libs/nozzle.h"
enum AdvancedPauseMode : char { enum AdvancedPauseMode : char {
ADVANCED_PAUSE_MODE_PAUSE_PRINT, ADVANCED_PAUSE_MODE_PAUSE_PRINT,
ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 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); 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); bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT);
#endif //ADVANCED_PAUSE_FEATURE

View File

@ -19,15 +19,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#pragma once
/** /**
* power.h - power control * power.h - power control
*/ */
#ifndef POWER_H #include "../core/millis_t.h"
#define POWER_H
#include "../core/types.h"
class Power { class Power {
public: public:
@ -40,5 +38,3 @@ class Power {
}; };
extern Power powerManager; extern Power powerManager;
#endif // POWER_H

View File

@ -28,7 +28,7 @@
#define _POWER_LOSS_RECOVERY_H_ #define _POWER_LOSS_RECOVERY_H_
#include "../sd/cardreader.h" #include "../sd/cardreader.h"
#include "../core/types.h" #include "../core/millis_t.h"
#include "../inc/MarlinConfigPre.h" #include "../inc/MarlinConfigPre.h"
#define SAVE_INFO_INTERVAL_MS 0 #define SAVE_INFO_INTERVAL_MS 0

View File

@ -30,7 +30,7 @@
#include "../HAL/platforms.h" #include "../HAL/platforms.h"
#include "../core/boards.h" #include "../core/boards.h"
#include "../core/macros.h" #include "../core/macros.h"
#include "../core/types.h" #include "../core/millis_t.h"
#include "Version.h" #include "Version.h"
#include "../../Configuration.h" #include "../../Configuration.h"
#include "Conditionals_LCD.h" #include "Conditionals_LCD.h"

View File

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

View File

@ -81,13 +81,8 @@
#include "../module/probe.h" #include "../module/probe.h"
#endif #endif
#if ENABLED(FWRETRACT) #include "../feature/fwretract.h"
#include "../feature/fwretract.h" #include "../feature/pause.h"
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#include "../feature/pause.h"
#endif
#if EXTRUDERS > 1 #if EXTRUDERS > 1
#include "tool_change.h" #include "tool_change.h"