Prusa MINI Firmware overview
|
Go to the documentation of this file.
55 #define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++)
56 #define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++)
57 #define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
58 #define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
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_AXIS)
62 #define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
63 #define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)
64 #define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS)
65 #define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N)
72 template <
bool,
class L,
class R>
74 template <
class L,
class R>
83 #define MMM_TO_MMS(MM_M) feedRate_t(float(MM_M) / 60.0f)
84 #define MMS_TO_MMM(MM_S) (float(MM_S) * 60.0f)
85 #define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage)
92 #define _RECIP(N) ((N) ? 1.0f / float(N) : 0.0f)
93 #define _ABS(N) ((N) < 0 ? -(N) : (N))
94 #define _LS(N) (N = (T)(uint32_t(N) << v))
95 #define _RS(N) (N = (T)(uint32_t(N) >> v))
96 #define FI FORCE_INLINE
99 template<
typename T>
struct XYval;
190 FI void set(
const T px,
const T py) {
x = px;
y = py; }
194 FI operator bool() {
return x ||
y; }
291 FI void set(
const T px,
const T py) {
x = px;
y = py; }
292 FI void set(
const T px,
const T py,
const T pz) {
x = px;
y = py;
z = pz; }
297 FI operator bool() {
return z ||
x ||
y; }
390 FI operator bool() {
return e ||
z ||
x ||
y; }
392 FI void set(
const T px,
const T py) {
x = px;
y = py; }
393 FI void set(
const T px,
const T py,
const T pz) {
x = px;
y = py;
z = pz; }
394 FI void set(
const T px,
const T py,
const T pz,
const T pe) {
x = px;
y = py;
z = pz;
e = pe; }
FI bool operator!=(const XYZval< T > &rs)
Definition: types.h:271
#define FI
Definition: types.h:96
T z
Definition: types.h:286
FI bool operator==(const XYZval< T > &rs)
Definition: types.h:265
FI XYval< float > asFloat()
Definition: types.h:201
T pos[3]
Definition: types.h:288
FI XYval< T > & operator-=(const XYval< T > &rs)
Definition: types.h:252
FI XYZEval< int32_t > asLong()
Definition: types.h:406
T a
Definition: types.h:186
FI XYZEval< T > & operator+=(const XYval< T > &rs)
Definition: types.h:457
T a
Definition: types.h:287
T z
Definition: types.h:383
FI XYZEval< T > operator>>(const int &v)
Definition: types.h:454
FI XYZEval< float > asFloat()
Definition: types.h:407
FI void set(const T px, const T py, const T pz)
Definition: types.h:292
#define _RECIP(N)
Definition: types.h:92
FI XYZEval< T > operator<<(const int &v)
Definition: types.h:456
FI XYZEval< T > & operator<<=(const int &v)
Definition: types.h:471
FI XYZEval< T > operator<<(const int &v) const
Definition: types.h:455
FI XYZEval< T > & operator*=(const T &v)
Definition: types.h:469
FI XYval< T > & operator+=(const XYZEval< T > &rs)
Definition: types.h:257
xyze_float_t xyze_pos_t
Definition: types.h:161
FI XYval< T > & operator-=(const XYZval< T > &rs)
Definition: types.h:255
FI bool operator==(const XYZval< T > &rs)
Definition: types.h:472
FI bool operator==(const XYZEval< T > &rs) const
Definition: types.h:371
FI XYZEval< T > & operator*=(const XYval< T > &rs)
Definition: types.h:459
T x
Definition: types.h:286
FI bool operator!=(const XYZEval< T > &rs) const
Definition: types.h:275
L type
Definition: types.h:75
FI bool operator!=(const XYZval< T > &rs) const
Definition: types.h:274
FI bool operator==(const XYZEval< T > &rs)
Definition: types.h:369
FI T magnitude() const
Definition: types.h:388
FI void reset()
Definition: types.h:294
FI XYZval< T > operator/(const XYval< T > &rs) const
Definition: types.h:323
FI XYZval< T > operator<<(const int &v)
Definition: types.h:352
FI XYZval< T > & operator*=(const int &v)
Definition: types.h:366
FI void set(const XYval< T > pxy, const T pz)
Definition: types.h:396
const FI T & operator[](const int i) const
Definition: types.h:313
FI XYZEval< T > & operator*=(const XYZEval< T > &rs)
Definition: types.h:467
FI XYZEval< float > asLogical() const
Definition: types.h:410
const FI T & operator[](const int i) const
Definition: types.h:211
FI XYZEval< T > & operator=(const T v)
Definition: types.h:418
FI void set(const XYval< T > pxy, const T pz, const T pe)
Definition: types.h:398
FI void set(const XYval< T > pxy)
Definition: types.h:395
FI XYZEval< T > & operator-=(const XYZEval< T > &rs)
Definition: types.h:466
FI XYZEval< T > operator+(const XYval< T > &rs) const
Definition: types.h:421
FI T & operator[](const int i)
Definition: types.h:416
FI XYval< T > operator*(const XYval< T > &rs) const
Definition: types.h:219
xyze_long_t abce_long_t
Definition: types.h:155
FI XYZEval< float > reciprocal() const
Definition: types.h:409
FI XYval< T > & operator+=(const XYval< T > &rs)
Definition: types.h:251
xyze_ulong_t abce_ulong_t
Definition: types.h:157
FI XYZval< T > & operator*=(const float &v)
Definition: types.h:365
FI XYZval< T > operator*(const XYval< T > &rs) const
Definition: types.h:321
T e
Definition: types.h:383
FI XYval< T > operator>>(const int &v) const
Definition: types.h:247
FI XYZval< int16_t > asInt()
Definition: types.h:300
FI XYZval< float > asFloat()
Definition: types.h:304
FI XYZval< T > & operator=(const T v)
Definition: types.h:314
xy_uint8_t xy_byte_t
Definition: types.h:150
uint8_t i
Definition: screen_test_graph.c:72
void toNative(xy_pos_t &raw)
Definition: motion.h:274
FI void set(const T px, const T py)
Definition: types.h:291
FI bool operator!=(const XYZval< T > &rs)
Definition: types.h:473
FI XYZval< T > & operator-=(const XYZEval< T > &rs)
Definition: types.h:362
FI XYZEval< int32_t > asLong() const
Definition: types.h:405
AxisEnum
Definition: types.h:36
FI XYZval< T > & operator+=(const XYZval< T > &rs)
Definition: types.h:357
xyz_float_t xyz_pos_t
Definition: types.h:160
FI XYZval< float > asFloat() const
Definition: types.h:305
FI bool operator!=(const XYZEval< T > &rs)
Definition: types.h:370
xy_float_t xy_pos_t
Definition: types.h:159
FI XYval< float > asFloat() const
Definition: types.h:202
FI XYZval< T > operator>>(const int &v) const
Definition: types.h:349
FI void set(const XYval< T > pxy, const T pz)
Definition: types.h:293
FI void set(const T px, const T py)
Definition: types.h:190
FI XYZval< int16_t > asInt() const
Definition: types.h:301
const FI XYZval< T > operator-() const
Definition: types.h:374
FI XYZval< T > & operator+=(const XYZEval< T > &rs)
Definition: types.h:361
float feedRate_t
Definition: types.h:80
FI void set(const T px)
Definition: types.h:290
FI XYZval< T > operator>>(const int &v)
Definition: types.h:350
FI bool operator!=(const XYval< T > &rs)
Definition: types.h:270
FI XYZval< T > & operator/=(const XYZEval< T > &rs)
Definition: types.h:364
FI XYZval< T > ABS() const
Definition: types.h:299
FI bool operator==(const XYZval< T > &rs) const
Definition: types.h:268
FI XYZval< T > operator-()
Definition: types.h:373
T pos[2]
Definition: types.h:187
ab_float_t ab_pos_t
Definition: types.h:167
const FI T & operator[](const int i) const
Definition: types.h:417
FI void reset()
Definition: types.h:191
FI T magnitude() const
Definition: types.h:295
FI XYval< T > & operator>>=(const int &v)
Definition: types.h:262
FI XYZval< T > & operator*=(const XYZEval< T > &rs)
Definition: types.h:363
FI XYZval< T > & operator-=(const XYZval< T > &rs)
Definition: types.h:358
FI void set(const T px, const T py)
Definition: types.h:392
T b
Definition: types.h:186
T a
Definition: types.h:384
T b
Definition: types.h:287
T c
Definition: types.h:384
FI XYval< float > reciprocal() const
Definition: types.h:203
FI T & operator[](const int i)
Definition: types.h:312
FI void set(const T px)
Definition: types.h:189
FI XYZval< T > & operator*=(const XYZval< T > &rs)
Definition: types.h:359
FI XYZval< int32_t > asLong() const
Definition: types.h:303
FI XYZval< T > copy() const
Definition: types.h:298
FI XYZEval< T > & operator-=(const XYZval< T > &rs)
Definition: types.h:462
FI XYZEval< T > copy() const
Definition: types.h:401
FI XYval< float > asNative() const
Definition: types.h:205
FI void set(const XYval< T > pxy, const XYval< T > pze)
Definition: types.h:399
xyz_uint8_t xyz_byte_t
Definition: types.h:151
FI T magnitude() const
Definition: types.h:192
T b
Definition: types.h:384
FI XYZEval< T > & operator+=(const XYZEval< T > &rs)
Definition: types.h:465
FI void set(const T px, const T py, const T pz, const T pe)
Definition: types.h:394
#define _ABS(N)
Definition: types.h:93
FI XYval< T > operator-()
Definition: types.h:276
FI XYZval< T > & operator*=(const XYval< T > &rs)
Definition: types.h:355
FI XYval< T > operator+(const XYval< T > &rs) const
Definition: types.h:215
FI bool operator!=(const XYval< T > &rs) const
Definition: types.h:273
FI XYZEval< float > asNative() const
Definition: types.h:411
FI XYZval< float > asLogical() const
Definition: types.h:307
FI XYZval< float > reciprocal() const
Definition: types.h:306
FI void set(const T px, const T py, const T pz)
Definition: types.h:393
FI XYval< T > & operator*=(const float &v)
Definition: types.h:260
T x
Definition: types.h:383
FI XYval< int32_t > asLong()
Definition: types.h:199
FI XYval< T > & operator+=(const XYZval< T > &rs)
Definition: types.h:254
FI XYval< T > operator>>(const int &v)
Definition: types.h:248
FI XYZEval< T > & operator>>=(const int &v)
Definition: types.h:470
#define _LS(N)
Definition: types.h:94
xyze_uint8_t xyze_byte_t
Definition: types.h:152
FI XYval< T > ABS() const
Definition: types.h:196
#define L(CODE)
Definition: macros.h:76
FI XYZval< T > operator+(const XYval< T > &rs) const
Definition: types.h:317
FI XYZval< T > & operator/=(const XYZval< T > &rs)
Definition: types.h:360
FI void set(const T px)
Definition: types.h:391
T x
Definition: types.h:185
FI XYval< float > asLogical() const
Definition: types.h:204
FI XYZval< int32_t > asLong()
Definition: types.h:302
FI bool operator==(const XYval< T > &rs)
Definition: types.h:264
FI XYval< int16_t > asInt()
Definition: types.h:197
T pos[4]
Definition: types.h:385
const uint8_t[]
Definition: 404_html.c:3
FI XYZEval< T > & operator*=(const XYZval< T > &rs)
Definition: types.h:463
const FI XYval< T > operator-() const
Definition: types.h:277
FI XYval< T > operator<<(const int &v)
Definition: types.h:250
FI XYval< T > & operator*=(const XYZEval< T > &rs)
Definition: types.h:259
T y
Definition: types.h:286
FI XYZval< T > & operator-=(const XYval< T > &rs)
Definition: types.h:354
FI XYZEval< T > & operator/=(const XYval< T > &rs)
Definition: types.h:460
#define _RS(N)
Definition: types.h:95
FI XYval< T > & operator<<=(const int &v)
Definition: types.h:263
FI XYval< int32_t > asLong() const
Definition: types.h:200
FI XYval< int16_t > asInt() const
Definition: types.h:198
FI XYZEval< T > operator>>(const int &v) const
Definition: types.h:453
abc_float_t abc_pos_t
Definition: types.h:168
FI XYZval< T > & operator+=(const XYval< T > &rs)
Definition: types.h:353
FI T & operator[](const int i)
Definition: types.h:210
FI XYval< T > operator/(const XYval< T > &rs) const
Definition: types.h:221
FI XYZval< T > & operator/=(const XYval< T > &rs)
Definition: types.h:356
FI XYZEval< float > asFloat() const
Definition: types.h:408
FI XYval< T > & operator-=(const XYZEval< T > &rs)
Definition: types.h:258
FI bool operator!=(const XYZEval< T > &rs) const
Definition: types.h:372
xy_float_t ab_float_t
Definition: types.h:163
FI bool operator==(const XYval< T > &rs) const
Definition: types.h:267
FI XYZEval< T > operator*(const XYval< T > &rs) const
Definition: types.h:425
FI bool operator==(const XYZval< T > &rs) const
Definition: types.h:474
FI XYval< T > & operator*=(const XYZval< T > &rs)
Definition: types.h:256
FI XYval< T > & operator=(const T v)
Definition: types.h:212
abce_float_t abce_pos_t
Definition: types.h:169
FI XYval< T > operator<<(const int &v) const
Definition: types.h:249
const FI XYZEval< T > operator-() const
Definition: types.h:477
xyz_float_t abc_float_t
Definition: types.h:164
T y
Definition: types.h:185
FI bool operator==(const XYZEval< T > &rs)
Definition: types.h:266
FI XYval< T > & operator*=(const int &v)
Definition: types.h:261
xyz_ulong_t abc_ulong_t
Definition: types.h:156
FI bool operator==(const XYZEval< T > &rs) const
Definition: types.h:269
FI XYZEval< T > & operator/=(const XYZEval< T > &rs)
Definition: types.h:468
FI bool operator!=(const XYZEval< T > &rs)
Definition: types.h:272
xyze_float_t abce_float_t
Definition: types.h:165
FI XYZval< T > operator<<(const int &v) const
Definition: types.h:351
FI XYval< T > copy() const
Definition: types.h:195
R type
Definition: types.h:73
const xyze_char_t axis_codes
Definition: types.h:486
FI bool operator!=(const XYZval< T > &rs) const
Definition: types.h:475
T c
Definition: types.h:287
FI XYZEval< T > & operator-=(const XYval< T > &rs)
Definition: types.h:458
FI XYZEval< T > ABS() const
Definition: types.h:402
FI XYZval< T > & operator>>=(const int &v)
Definition: types.h:367
FI XYZEval< T > & operator/=(const XYZval< T > &rs)
Definition: types.h:464
xyz_long_t abc_long_t
Definition: types.h:154
void toLogical(xy_pos_t &raw)
Definition: motion.h:271
FI XYZEval< T > & operator+=(const XYZval< T > &rs)
Definition: types.h:461
FI XYZval< float > asNative() const
Definition: types.h:308
FI XYZEval< int16_t > asInt()
Definition: types.h:403
FI XYZval< T > & operator<<=(const int &v)
Definition: types.h:368
FI void reset()
Definition: types.h:387
FI XYZEval< int16_t > asInt() const
Definition: types.h:404
FI XYZEval< T > operator-()
Definition: types.h:476
FI XYZEval< T > operator/(const XYval< T > &rs) const
Definition: types.h:427
FI void set(const XYZval< T > pxyz)
Definition: types.h:397
FI XYval< T > & operator*=(const XYval< T > &rs)
Definition: types.h:253
T y
Definition: types.h:383
FI void set(const XYZval< T > pxyz, const T pe)
Definition: types.h:400