From 6d9ef6e4be479a1331c1790986f4a089b869fadd Mon Sep 17 00:00:00 2001 From: BlackMark Date: Mon, 13 Apr 2020 16:41:16 +0200 Subject: [PATCH] Make variables const --- hardware.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hardware.hpp b/hardware.hpp index 4cef107..4f8b7b8 100644 --- a/hardware.hpp +++ b/hardware.hpp @@ -376,9 +376,9 @@ class InterruptHardware { protected: static void rxIntHandler() FORCE_INLINE { - auto data = HardwareImpl::rxByteInterrupt(); + const auto data = HardwareImpl::rxByteInterrupt(); - uint8_t tmpHead = (sm_rxBuf.head + 1) % RX_BUFFER_SIZE; + const uint8_t tmpHead = (sm_rxBuf.head + 1) % RX_BUFFER_SIZE; if (tmpHead != sm_rxBuf.tail) { sm_rxBuf.head = tmpHead; @@ -391,7 +391,7 @@ class InterruptHardware { static void dataRegEmptyIntHandler() FORCE_INLINE { if (sm_txBuf.head != sm_txBuf.tail) { - uint8_t tmpTail = (sm_txBuf.tail + 1) % TX_BUFFER_SIZE; + const uint8_t tmpTail = (sm_txBuf.tail + 1) % TX_BUFFER_SIZE; sm_txBuf.tail = tmpTail; HardwareImpl::txByteInterrupt(sm_txBuf.buf[tmpTail]); } else