diff options
author | David Lamparter <equinox@diac24.net> | 2014-12-07 16:48:43 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2014-12-07 16:48:43 +0100 |
commit | a9ef16e6e3c705edad07201cea742e8529c090eb (patch) | |
tree | 53f73fc0bdcf59e8a19b5db42646ab86bcda9971 | |
parent | 2861294d9b9f159b63696bfbe5a0e2cbb8d56124 (diff) |
can: extend protocol macros
-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; |