From 5185feb984da4c7a4537d1bd090f530732c0e071 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 7 Nov 2025 12:37:47 -0500 Subject: transmit line number on error --- fw/can.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'fw/can.c') diff --git a/fw/can.c b/fw/can.c index 8376049..421c69b 100644 --- a/fw/can.c +++ b/fw/can.c @@ -261,7 +261,7 @@ readRxbn(U8 n, CanFrame *frame) { CAN_CS = 0; // Start reading at RXBnSIDH - (void)spiTx(CMD_READ_RX | (U8)((n & 1u) << 2u)); + (void)spiTx(CMD_READ_RX | (U8)((n & 1) << 2u)); // Read ID sidh = spiTx(0u); @@ -270,13 +270,9 @@ readRxbn(U8 n, CanFrame *frame) { eid0 = spiTx(0u); packId(&frame->id, sidh, sidl, eid8, eid0); - // Read RTR and DLC + // Read DLC and RTR frame->dlc = spiTx(0u); - if (frame->id.isExt) { - frame->rtr = frame->dlc & RTR; - } else { - frame->rtr = sidl & SRR; - } + frame->rtr = (sidl & IDE) ? (frame->dlc & RTR) : (sidl & SRR); frame->dlc &= 0xF; // Read data -- cgit v1.2.3