From ba52430e1ded753a2ed330167c181e0b4bc09e09 Mon Sep 17 00:00:00 2001 From: VintagePC <53943260+vintagepc@users.noreply.github.com> Date: Tue, 19 Jul 2022 20:08:19 -0400 Subject: [PATCH] Magic numbers are bad... --- Firmware/mmu2.cpp | 2 +- Firmware/mmu2.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index 503de8417..e36592732 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -244,7 +244,7 @@ bool MMU2::RetryIfPossible(uint16_t ec){ void MMU2::ResetRetryAttempts(){ SERIAL_ECHOLNPGM("ResetRetryAttempts"); - retryAttempts = 3; + retryAttempts = MAX_RETRIES; } void MMU2::DecrementRetryAttempts(){ diff --git a/Firmware/mmu2.h b/Firmware/mmu2.h index 6113d45fa..a1cd8ee7a 100644 --- a/Firmware/mmu2.h +++ b/Firmware/mmu2.h @@ -6,6 +6,8 @@ struct E_Step; namespace MMU2 { +static constexpr uint8_t MAX_RETRIES = 3U; + /// @@TODO hmmm, 12 bytes... may be we can reduce that struct xyz_pos_t { float xyz[3];