From efeb6efe773ed137f3a1d225f98b0f0b929c320b Mon Sep 17 00:00:00 2001 From: Luu Lac <45380455+shitcreek@users.noreply.github.com> Date: Thu, 24 Oct 2019 12:04:45 -0500 Subject: [PATCH] Set pullup on BTN_BACK pin (#15654) --- Marlin/src/lcd/ultralcd.cpp | 4 ++++ Marlin/src/libs/vector_3.cpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index e67a7812f9..54d13c29c1 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -295,6 +295,10 @@ void MarlinUI::init() { SET_INPUT_PULLUP(BTN_ENC); #endif + #if BUTTON_EXISTS(BACK) + SET_INPUT_PULLUP(BTN_BACK); + #endif + #if BUTTON_EXISTS(UP) SET_INPUT(BTN_UP); #endif diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index 41ea3ec977..f50fde5ed5 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -71,9 +71,9 @@ void vector_3::normalize() { // Apply a rotation to the matrix void vector_3::apply_rotation(const matrix_3x3 &matrix) { const float _x = x, _y = y, _z = z; - x = _x * matrix.vectors[0][0] + _y * matrix.vectors[1][0] + _z * matrix.vectors[2][0]; - y = _x * matrix.vectors[0][1] + _y * matrix.vectors[1][1] + _z * matrix.vectors[2][1]; - z = _x * matrix.vectors[0][2] + _y * matrix.vectors[1][2] + _z * matrix.vectors[2][2]; + *this = { matrix.vectors[0][0] * _x + matrix.vectors[1][0] * _y + matrix.vectors[2][0] * _z, + matrix.vectors[0][1] * _x + matrix.vectors[1][1] * _y + matrix.vectors[2][1] * _z, + matrix.vectors[0][2] * _x + matrix.vectors[1][2] * _y + matrix.vectors[2][2] * _z }; } void vector_3::debug(PGM_P const title) {