drivers: can: mcux: Fix set can_send callbacks
The callback function and callback argument were not set when the filter is attached, and therefore, the callback function was never called. This commit sets the function and callback correct. Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit is contained in:
parent
7da78796de
commit
41c36b7cd6
1 changed files with 3 additions and 0 deletions
|
@ -216,6 +216,8 @@ static int mcux_flexcan_send(struct device *dev, const struct zcan_frame *msg,
|
||||||
}
|
}
|
||||||
|
|
||||||
mcux_flexcan_copy_zframe_to_frame(msg, &data->tx_cbs[alloc].frame);
|
mcux_flexcan_copy_zframe_to_frame(msg, &data->tx_cbs[alloc].frame);
|
||||||
|
data->tx_cbs[alloc].function = callback_isr;
|
||||||
|
data->tx_cbs[alloc].arg = callback_arg;
|
||||||
xfer.frame = &data->tx_cbs[alloc].frame;
|
xfer.frame = &data->tx_cbs[alloc].frame;
|
||||||
xfer.mbIdx = ALLOC_IDX_TO_TXMB_IDX(alloc);
|
xfer.mbIdx = ALLOC_IDX_TO_TXMB_IDX(alloc);
|
||||||
FLEXCAN_SetTxMbConfig(config->base, xfer.mbIdx, true);
|
FLEXCAN_SetTxMbConfig(config->base, xfer.mbIdx, true);
|
||||||
|
@ -280,6 +282,7 @@ static int mcux_flexcan_attach_isr(struct device *dev, can_rx_callback_t isr,
|
||||||
if (status != kStatus_Success) {
|
if (status != kStatus_Success) {
|
||||||
LOG_ERR("Failed to start rx for filter id %d (err = %d)",
|
LOG_ERR("Failed to start rx for filter id %d (err = %d)",
|
||||||
alloc, status);
|
alloc, status);
|
||||||
|
alloc = CAN_NO_FREE_FILTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
k_mutex_unlock(&data->rx_mutex);
|
k_mutex_unlock(&data->rx_mutex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue