Make variables const

This commit is contained in:
BlackMark 2020-04-13 16:41:16 +02:00
parent bcd18db494
commit 6d9ef6e4be

View File

@ -376,9 +376,9 @@ class InterruptHardware {
protected: protected:
static void rxIntHandler() FORCE_INLINE 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) { if (tmpHead != sm_rxBuf.tail) {
sm_rxBuf.head = tmpHead; sm_rxBuf.head = tmpHead;
@ -391,7 +391,7 @@ class InterruptHardware {
static void dataRegEmptyIntHandler() FORCE_INLINE static void dataRegEmptyIntHandler() FORCE_INLINE
{ {
if (sm_txBuf.head != sm_txBuf.tail) { 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; sm_txBuf.tail = tmpTail;
HardwareImpl::txByteInterrupt(sm_txBuf.buf[tmpTail]); HardwareImpl::txByteInterrupt(sm_txBuf.buf[tmpTail]);
} else } else