int8_t rpp_can_write(rpp_can_hw_obj hw_obj, const struct rpp_can_pdu *pdu)
{
- uint32_t reg_index, bit_index;
+ uint32_t reg_index, bit_mask;
uint8_t i;
canBASE_t *controller;
struct rpp_can_tx_config *tx_cfg = &can_config->tx_config[hw_obj];
}
reg_index = (tx_cfg->msg_obj - 1) >> 5;
- bit_index = 1 << ((tx_cfg->msg_obj - 1) & 0x1FU);
+ bit_mask = 1 << ((tx_cfg->msg_obj - 1) & 0x1FU);
// FIXME: Check whether sending should be aborted or message overwritten
- if (controller->TXRQx[reg_index] & bit_index)
+ if (controller->TXRQx[reg_index] & bit_mask)
{
return FAILURE;
}
int8_t rpp_can_check_tx_con(rpp_can_hw_obj hw_obj, bool *tx_con)
{
- uint32_t reg_index, bit_index;
+ uint32_t reg_index, bit_mask;
canBASE_t *controller;
if (!(controller = map_controller(can_config->tx_config[hw_obj].controller)))
}
reg_index = can_config->tx_config[hw_obj].msg_obj >> 5;
- bit_index = 1 << ((can_config->tx_config[hw_obj].msg_obj - 1) & 0x1FU);
+ bit_mask = 1 << ((can_config->tx_config[hw_obj].msg_obj - 1) & 0x1FU);
- *tx_con = controller->TXRQx[reg_index] & bit_index;
+ *tx_con = controller->TXRQx[reg_index] & bit_mask;
return SUCCESS;
}
int8_t rpp_can_read(rpp_can_hw_obj hw_obj, struct rpp_can_pdu *pdu)
{
- uint32_t reg_index, bit_index;
+ uint32_t reg_index, bit_mask;
uint32_t i;
canBASE_t *controller;
}
reg_index = (can_config->rx_config[hw_obj].msg_obj - 1) >> 5;
- bit_index = 1 << ((can_config->rx_config[hw_obj].msg_obj - 1) & 0x1FU);
+ bit_mask = 1 << ((can_config->rx_config[hw_obj].msg_obj - 1) & 0x1FU);
// FIXME: Check whether to abort if there are no new data
- if (!(controller->NWDATx[reg_index] & bit_index))
+ if (!(controller->NWDATx[reg_index] & bit_mask))
{
return FAILURE;
}
int8_t rpp_can_check_rx_ind(rpp_can_hw_obj hw_obj, bool *rx_ind)
{
- uint32_t reg_index, bit_index;
+ uint32_t reg_index, bit_mask;
canBASE_t *controller;
if (!(controller = map_controller(can_config->rx_config[hw_obj].controller)))
}
reg_index = (can_config->rx_config[hw_obj].msg_obj - 1) >> 5;
- bit_index = 1 << ((can_config->rx_config[hw_obj].msg_obj - 1) & 0x1FU);
+ bit_mask = 1 << ((can_config->rx_config[hw_obj].msg_obj - 1) & 0x1FU);
- *rx_ind = controller->NWDATx[reg_index] & bit_index;
+ *rx_ind = controller->NWDATx[reg_index] & bit_mask;
return SUCCESS;
}