diff --git a/FT_CAN_AL.c b/FT_CAN_AL.c index e097867..0b0b829 100644 --- a/FT_CAN_AL.c +++ b/FT_CAN_AL.c @@ -17,7 +17,7 @@ HAL_StatusTypeDef ftcan_init(CAN_HandleTypeDef *handle) { return HAL_CAN_Start(hcan); } -HAL_StatusTypeDef ftcan_transmit(uint8_t id, const uint8_t *data, +HAL_StatusTypeDef ftcan_transmit(uint16_t id, const uint8_t *data, size_t datalen) { static CAN_TxHeaderTypeDef header; header.StdId = id; @@ -28,7 +28,7 @@ HAL_StatusTypeDef ftcan_transmit(uint8_t id, const uint8_t *data, return HAL_CAN_AddTxMessage(hcan, &header, data, &mailbox); } -HAL_StatusTypeDef ftcan_add_filter(uint8_t id, uint8_t mask) { +HAL_StatusTypeDef ftcan_add_filter(uint16_t id, uint16_t mask) { static uint32_t next_filter_no = 0; static CAN_FilterTypeDef filter; if (next_filter_no % 2 == 0) { @@ -76,7 +76,7 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *handle) { } #endif // CAN_IS_BXCAN -__weak void ftcan_msg_received_cb(uint8_t id, size_t datalen, +__weak void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {} uint64_t ftcan_unmarshal_unsigned(const uint8_t **data_ptr, size_t num_bytes) { diff --git a/FT_CAN_AL.h b/FT_CAN_AL.h index 1b0fdac..1653f97 100644 --- a/FT_CAN_AL.h +++ b/FT_CAN_AL.h @@ -13,15 +13,15 @@ HAL_StatusTypeDef ftcan_init(CAN_HandleTypeDef *handle); #endif // CAN_IS_BXCAN -HAL_StatusTypeDef ftcan_transmit(uint8_t id, const uint8_t *data, +HAL_StatusTypeDef ftcan_transmit(uint16_t id, const uint8_t *data, size_t datalen); -HAL_StatusTypeDef ftcan_add_filter(uint8_t id, uint8_t mask); +HAL_StatusTypeDef ftcan_add_filter(uint16_t id, uint16_t mask); /** * Define this function to be notified of incoming CAN messages */ -void ftcan_msg_received_cb(uint8_t id, size_t datalen, const uint8_t *data); +void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data); /** * Read num_bytes bytes from a message (unmarshalled network byte order). The