Make variables const
This commit is contained in:
parent
bcd18db494
commit
6d9ef6e4be
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user