From 6eab0dda5936fca2a994ffa6bd4029805ce55c91 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 11 Oct 2022 13:23:55 +0200 Subject: [PATCH] Add parentheses - be more explicit in error codes' masking and comparison --- Firmware/mmu2_error_converter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/mmu2_error_converter.cpp b/Firmware/mmu2_error_converter.cpp index ee87c9e54..49f476adc 100644 --- a/Firmware/mmu2_error_converter.cpp +++ b/Firmware/mmu2_error_converter.cpp @@ -84,13 +84,13 @@ uint8_t PrusaErrorCodeIndex(uint16_t ec) { // Need to be placed before TMC-related errors in order to process couples of error bits between single ones // and to keep the code size down. if (ec & (uint16_t)ErrorCode::TMC_PULLEY_BIT) { - if (ec & (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION == (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) + if ((ec & (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) return FindErrorIndex(ERR_ELECTRICAL_PULLEY_SELFTEST_FAILED); } else if (ec & (uint16_t)ErrorCode::TMC_SELECTOR_BIT) { - if (ec & (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION == (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) + if ((ec & (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) return FindErrorIndex(ERR_ELECTRICAL_SELECTOR_SELFTEST_FAILED); } else if (ec & (uint16_t)ErrorCode::TMC_IDLER_BIT) { - if (ec & (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION == (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) + if ((ec & (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) == (uint16_t)ErrorCode::MMU_SOLDERING_NEEDS_ATTENTION) return FindErrorIndex(ERR_ELECTRICAL_IDLER_SELFTEST_FAILED); }