Browse Source

Set pullup on BTN_BACK pin (#15654)

Luu Lac 5 years ago
parent
commit
efeb6efe77
2 changed files with 7 additions and 3 deletions
  1. 4
    0
      Marlin/src/lcd/ultralcd.cpp
  2. 3
    3
      Marlin/src/libs/vector_3.cpp

+ 4
- 0
Marlin/src/lcd/ultralcd.cpp View File

295
       SET_INPUT_PULLUP(BTN_ENC);
295
       SET_INPUT_PULLUP(BTN_ENC);
296
     #endif
296
     #endif
297
 
297
 
298
+    #if BUTTON_EXISTS(BACK)
299
+      SET_INPUT_PULLUP(BTN_BACK);
300
+    #endif
301
+
298
     #if BUTTON_EXISTS(UP)
302
     #if BUTTON_EXISTS(UP)
299
       SET_INPUT(BTN_UP);
303
       SET_INPUT(BTN_UP);
300
     #endif
304
     #endif

+ 3
- 3
Marlin/src/libs/vector_3.cpp View File

71
 // Apply a rotation to the matrix
71
 // Apply a rotation to the matrix
72
 void vector_3::apply_rotation(const matrix_3x3 &matrix) {
72
 void vector_3::apply_rotation(const matrix_3x3 &matrix) {
73
   const float _x = x, _y = y, _z = z;
73
   const float _x = x, _y = y, _z = z;
74
-  x = _x * matrix.vectors[0][0] + _y * matrix.vectors[1][0] + _z * matrix.vectors[2][0];
75
-  y = _x * matrix.vectors[0][1] + _y * matrix.vectors[1][1] + _z * matrix.vectors[2][1];
76
-  z = _x * matrix.vectors[0][2] + _y * matrix.vectors[1][2] + _z * matrix.vectors[2][2];
74
+  *this = { matrix.vectors[0][0] * _x + matrix.vectors[1][0] * _y + matrix.vectors[2][0] * _z,
75
+            matrix.vectors[0][1] * _x + matrix.vectors[1][1] * _y + matrix.vectors[2][1] * _z,
76
+            matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z };
77
 }
77
 }
78
 
78
 
79
 void vector_3::debug(PGM_P const title) {
79
 void vector_3::debug(PGM_P const title) {

Loading…
Cancel
Save