summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--can.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/can.c b/can.c
index 143d311..1a874c5 100644
--- a/can.c
+++ b/can.c
@@ -15,11 +15,16 @@
#define can_rx_isext() (can_rx_addr.b[1] & 0x08)
#define can_rx_ext_rr() (can_rx_dlc & 0x40)
+#define can_rx_ext_rr2(cst) (cst.rx_dlc & 0x40)
#define can_rx_len() (can_rx_dlc & 0x0f)
+#define can_rx_len2(cst) (cst.rx_dlc & 0x0f)
-#define can_rx_sublab_proto() ((can_rx_addr.b[0] << 8) | (can_rx_addr.b[1] & 0xe8))
-#define can_rx_sublab_addr() (((can_rx_addr.b[2] & 0x0f) << 8) | can_rx_addr.b[3])
+#define can_rx_sublab_proto() (uint16_t)((can_rx_addr.b[0] << 8) | (can_rx_addr.b[1] & 0xe8))
+#define can_rx_sublab_proto2(cst) (uint16_t)((cst.rx_addr.b[0] << 8) | (cst.rx_addr.b[1] & 0xe8))
+#define can_rx_sublab_addr() (((can_rx_addr.b[2] & 0x0f) << 8) | can_rx_addr.b[3])
+#define can_rx_sublab_addr2(cst) (((cst.rx_addr.b[2] & 0x0f) << 8) | cst.rx_addr.b[3])
#define can_rx_sublab_disco_page() ((can_rx_addr.b[2] & 0xf0) >> 4)
+#define can_rx_sublab_disco_page2(cst) ((cst.rx_addr.b[2] & 0xf0) >> 4)
#ifndef R0KET
#define spi_ss(x) PORTB = ((x) << B_SS) | 0x3;