Move [xyz]_endstop_adj to Endstops class
This commit is contained in:
parent
83c83e3127
commit
e8fc0e9a57
5 changed files with 82 additions and 68 deletions
|
|
@ -21,11 +21,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* endstops.h - manages endstops
|
||||
* endstops.h - manages endstops
|
||||
*/
|
||||
|
||||
#ifndef ENDSTOPS_H
|
||||
#define ENDSTOPS_H
|
||||
#ifndef __ENDSTOPS_H__
|
||||
#define __ENDSTOPS_H__
|
||||
|
||||
#include "enum.h"
|
||||
#include "MarlinConfig.h"
|
||||
|
|
@ -38,11 +38,21 @@ class Endstops {
|
|||
static volatile char endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
|
||||
|
||||
#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
|
||||
static uint16_t
|
||||
typedef uint16_t esbits_t;
|
||||
#if ENABLED(X_DUAL_ENDSTOPS)
|
||||
static float x_endstop_adj;
|
||||
#endif
|
||||
#if ENABLED(Y_DUAL_ENDSTOPS)
|
||||
static float y_endstop_adj;
|
||||
#endif
|
||||
#if ENABLED(Z_DUAL_ENDSTOPS)
|
||||
static float z_endstop_adj;
|
||||
#endif
|
||||
#else
|
||||
static byte
|
||||
typedef byte esbits_t;
|
||||
#endif
|
||||
current_endstop_bits, old_endstop_bits;
|
||||
|
||||
static esbits_t current_endstop_bits, old_endstop_bits;
|
||||
|
||||
Endstops() {
|
||||
enable_globally(
|
||||
|
|
@ -57,7 +67,7 @@ class Endstops {
|
|||
/**
|
||||
* Initialize the endstop pins
|
||||
*/
|
||||
void init();
|
||||
static void init();
|
||||
|
||||
/**
|
||||
* Update the endstops bits from the pins
|
||||
|
|
@ -113,5 +123,4 @@ extern Endstops endstops;
|
|||
#define ENDSTOPS_ENABLED endstops.enabled
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ENDSTOPS_H
|
||||
#endif // __ENDSTOPS_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue