drivers: can: mcp2515: Remove MCP2515 specifics
CAN_MCP2515_MAX_FILTER is not needed anymore and was probably just a misunderstanding. Aligned it with the other CAN drivers. This also was the last difference in the mcp2515 specific config for the can sample, so that can be deleted as well. Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
This commit is contained in:
parent
79b3a50772
commit
f06fec0ef7
4 changed files with 7 additions and 17 deletions
|
@ -26,7 +26,7 @@ config CAN_MCP2515_INT_THREAD_PRIO
|
|||
Priority level of the internal thread which is ran for
|
||||
interrupt handling and incoming packets.
|
||||
|
||||
config CAN_MCP2515_MAX_FILTER
|
||||
config CAN_MAX_FILTER
|
||||
int "Maximum number of concurrent active filters"
|
||||
default 5
|
||||
range 1 32
|
||||
|
|
|
@ -524,12 +524,12 @@ static int mcp2515_attach_isr(const struct device *dev,
|
|||
|
||||
/* find free filter */
|
||||
while ((BIT(filter_idx) & dev_data->filter_usage)
|
||||
&& (filter_idx < CONFIG_CAN_MCP2515_MAX_FILTER)) {
|
||||
&& (filter_idx < CONFIG_CAN_MAX_FILTER)) {
|
||||
filter_idx++;
|
||||
}
|
||||
|
||||
/* setup filter */
|
||||
if (filter_idx < CONFIG_CAN_MCP2515_MAX_FILTER) {
|
||||
if (filter_idx < CONFIG_CAN_MAX_FILTER) {
|
||||
dev_data->filter_usage |= BIT(filter_idx);
|
||||
|
||||
dev_data->filter[filter_idx] = *filter;
|
||||
|
@ -590,7 +590,7 @@ static void mcp2515_rx_filter(const struct device *dev,
|
|||
|
||||
k_mutex_lock(&dev_data->mutex, K_FOREVER);
|
||||
|
||||
for (; filter_idx < CONFIG_CAN_MCP2515_MAX_FILTER; filter_idx++) {
|
||||
for (; filter_idx < CONFIG_CAN_MAX_FILTER; filter_idx++) {
|
||||
if (!(BIT(filter_idx) & dev_data->filter_usage)) {
|
||||
continue; /* filter slot empty */
|
||||
}
|
||||
|
|
|
@ -46,9 +46,9 @@ struct mcp2515_data {
|
|||
|
||||
/* filter data */
|
||||
uint32_t filter_usage;
|
||||
can_rx_callback_t rx_cb[CONFIG_CAN_MCP2515_MAX_FILTER];
|
||||
void *cb_arg[CONFIG_CAN_MCP2515_MAX_FILTER];
|
||||
struct zcan_filter filter[CONFIG_CAN_MCP2515_MAX_FILTER];
|
||||
can_rx_callback_t rx_cb[CONFIG_CAN_MAX_FILTER];
|
||||
void *cb_arg[CONFIG_CAN_MAX_FILTER];
|
||||
struct zcan_filter filter[CONFIG_CAN_MAX_FILTER];
|
||||
can_state_change_isr_t state_change_isr;
|
||||
|
||||
/* general data */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue