diff options
-rw-r--r-- | can.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |