Subversion Repositories Tronxy-X3A-Marlin

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ron 1
/**
2
 * Marlin 3D Printer Firmware
3
 * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
 *
5
 * Based on Sprinter and grbl.
6
 * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 *
21
 */
22
 
23
#ifndef __ENUM_H__
24
#define __ENUM_H__
25
 
26
#include "MarlinConfig.h"
27
 
28
/**
29
 * Axis indices as enumerated constants
30
 *
31
 *  - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space
32
 *  - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians
33
 *  - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics
34
 */
35
enum AxisEnum : unsigned char {
36
  X_AXIS    = 0,
37
  A_AXIS    = 0,
38
  Y_AXIS    = 1,
39
  B_AXIS    = 1,
40
  Z_AXIS    = 2,
41
  C_AXIS    = 2,
42
  E_CART    = 3,
43
  #if ENABLED(HANGPRINTER) // Hangprinter order: A_AXIS, B_AXIS, C_AXIS, D_AXIS, E_AXIS
44
    D_AXIS  = 3,
45
    E_AXIS  = 4,
46
  #else
47
    E_AXIS  = 3,
48
  #endif
49
  X_HEAD, Y_HEAD, Z_HEAD,
50
  ALL_AXES  = 0xFE,
51
  NO_AXIS   = 0xFF
52
};
53
 
54
#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=S; VAR<=N; VAR++)
55
#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=S; VAR<N; VAR++)
56
#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
57
#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
58
 
59
#define LOOP_NA(VAR) LOOP_L_N(VAR, NUM_AXIS)
60
#define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
61
#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_CART)
62
#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
63
#define LOOP_MOV_AXIS(VAR) LOOP_S_L_N(VAR, A_AXIS, MOV_AXIS)
64
#define LOOP_NUM_AXIS(VAR) LOOP_S_L_N(VAR, A_AXIS, NUM_AXIS)
65
#define LOOP_NUM_AXIS_N(VAR) LOOP_S_L_N(VAR, A_AXIS, NUM_AXIS_N)
66
 
67
typedef enum {
68
  LINEARUNIT_MM,
69
  LINEARUNIT_INCH
70
} LinearUnit;
71
 
72
typedef enum {
73
  TEMPUNIT_C,
74
  TEMPUNIT_K,
75
  TEMPUNIT_F
76
} TempUnit;
77
 
78
/**
79
 * Debug flags
80
 * Not yet widely applied
81
 */
82
enum DebugFlags : unsigned char {
83
  DEBUG_NONE          = 0,
84
  DEBUG_ECHO          = _BV(0), ///< Echo commands in order as they are processed
85
  DEBUG_INFO          = _BV(1), ///< Print messages for code that has debug output
86
  DEBUG_ERRORS        = _BV(2), ///< Not implemented
87
  DEBUG_DRYRUN        = _BV(3), ///< Ignore temperature setting and E movement commands
88
  DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
89
  DEBUG_LEVELING      = _BV(5), ///< Print detailed output for homing and leveling
90
  DEBUG_MESH_ADJUST   = _BV(6), ///< UBL bed leveling
91
  DEBUG_ALL           = 0xFF
92
};
93
 
94
#if ENABLED(ADVANCED_PAUSE_FEATURE)
95
  enum AdvancedPauseMenuResponse : char {
96
    ADVANCED_PAUSE_RESPONSE_WAIT_FOR,
97
    ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE,
98
    ADVANCED_PAUSE_RESPONSE_RESUME_PRINT
99
  };
100
 
101
  #if ENABLED(ULTIPANEL)
102
    enum AdvancedPauseMessage : char {
103
      ADVANCED_PAUSE_MESSAGE_INIT,
104
      ADVANCED_PAUSE_MESSAGE_UNLOAD,
105
      ADVANCED_PAUSE_MESSAGE_INSERT,
106
      ADVANCED_PAUSE_MESSAGE_LOAD,
107
      ADVANCED_PAUSE_MESSAGE_PURGE,
108
      #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
109
        ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE,
110
      #endif
111
      ADVANCED_PAUSE_MESSAGE_OPTION,
112
      ADVANCED_PAUSE_MESSAGE_RESUME,
113
      ADVANCED_PAUSE_MESSAGE_STATUS,
114
      ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE,
115
      ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT
116
    };
117
  #endif
118
 
119
  enum AdvancedPauseMode : char {
120
    ADVANCED_PAUSE_MODE_PAUSE_PRINT,
121
    ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
122
    ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT
123
  };
124
#endif
125
 
126
/**
127
 * States for managing Marlin and host communication
128
 * Marlin sends messages if blocked or busy
129
 */
130
#if ENABLED(HOST_KEEPALIVE_FEATURE)
131
  enum MarlinBusyState : char {
132
    NOT_BUSY,           // Not in a handler
133
    IN_HANDLER,         // Processing a GCode
134
    IN_PROCESS,         // Known to be blocking command input (as in G29)
135
    PAUSED_FOR_USER,    // Blocking pending any input
136
    PAUSED_FOR_INPUT    // Blocking pending text input (concept)
137
  };
138
#endif
139
 
140
/**
141
 * SD Card
142
 */
143
enum LsAction : char { LS_SerialPrint, LS_Count, LS_GetFilename };
144
 
145
/**
146
 * Ultra LCD
147
 */
148
enum LCDViewAction : char {
149
  LCDVIEW_NONE,
150
  LCDVIEW_REDRAW_NOW,
151
  LCDVIEW_CALL_REDRAW_NEXT,
152
  LCDVIEW_CLEAR_CALL_REDRAW,
153
  LCDVIEW_CALL_NO_REDRAW
154
};
155
 
156
/**
157
 * Dual X Carriage modes. A Dual Nozzle can also do duplication.
158
 */
159
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
160
  enum DualXMode : char {
161
    DXC_FULL_CONTROL_MODE,  // DUAL_X_CARRIAGE only
162
    DXC_AUTO_PARK_MODE,     // DUAL_X_CARRIAGE only
163
    DXC_DUPLICATION_MODE
164
  };
165
#endif
166
 
167
/**
168
 * Workspace planes only apply to G2/G3 moves
169
 * (and "canned cycles" - not a current feature)
170
 */
171
#if ENABLED(CNC_WORKSPACE_PLANES)
172
  enum WorkspacePlane : char { PLANE_XY, PLANE_ZX, PLANE_YZ };
173
#endif
174
 
175
#endif // __ENUM_H__