2016-07-19 15:31:09 +02:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
|
|
|
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
|
|
|
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2018-11-04 09:25:55 +01:00
|
|
|
#pragma once
|
2016-07-19 15:31:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Axis indices as enumerated constants
|
|
|
|
*
|
2018-05-24 07:04:47 +02:00
|
|
|
* - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space
|
|
|
|
* - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians
|
|
|
|
* - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics
|
2016-07-19 15:31:09 +02:00
|
|
|
*/
|
2018-03-07 05:35:22 +01:00
|
|
|
enum AxisEnum : unsigned char {
|
2017-06-09 14:06:23 +02:00
|
|
|
X_AXIS = 0,
|
|
|
|
A_AXIS = 0,
|
|
|
|
Y_AXIS = 1,
|
|
|
|
B_AXIS = 1,
|
|
|
|
Z_AXIS = 2,
|
|
|
|
C_AXIS = 2,
|
|
|
|
E_AXIS = 3,
|
|
|
|
X_HEAD = 4,
|
|
|
|
Y_HEAD = 5,
|
|
|
|
Z_HEAD = 6,
|
2018-03-07 05:35:22 +01:00
|
|
|
ALL_AXES = 0xFE,
|
|
|
|
NO_AXIS = 0xFF
|
2016-07-19 15:31:09 +02:00
|
|
|
};
|
|
|
|
|
2018-06-27 01:49:59 +02:00
|
|
|
#define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++)
|
|
|
|
#define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++)
|
2017-06-09 14:06:23 +02:00
|
|
|
#define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
|
|
|
|
#define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
|
|
|
|
|
|
|
|
#define LOOP_NA(VAR) LOOP_L_N(VAR, NUM_AXIS)
|
|
|
|
#define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
|
|
|
|
#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)
|
|
|
|
#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
|
2018-02-04 07:26:05 +01:00
|
|
|
#define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)
|
|
|
|
#define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS)
|
|
|
|
#define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N)
|
2016-07-23 22:07:23 +02:00
|
|
|
|
2016-07-19 15:31:09 +02:00
|
|
|
typedef enum {
|
|
|
|
LINEARUNIT_MM,
|
|
|
|
LINEARUNIT_INCH
|
|
|
|
} LinearUnit;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
TEMPUNIT_C,
|
|
|
|
TEMPUNIT_K,
|
|
|
|
TEMPUNIT_F
|
|
|
|
} TempUnit;
|