Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOFT-512, setup tests for mcp2515 #431

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/ms-helper/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(T)_DEPS += mu-gen mu-store
endif

ifeq (x86,$(PLATFORM))
$(T)_EXCLUDE_TESTS := mcp2515 adc_periodic_reader
$(T)_EXCLUDE_TESTS := adc_periodic_reader
endif

$(T)_test_thermistor_MOCKS := adc_read_converted adc_get_channel adc_set_channel
3 changes: 2 additions & 1 deletion libraries/ms-helper/src/mcp2515.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ StatusCode mcp2515_init(Mcp2515Storage *storage, const Mcp2515Settings *settings
MCP2515_CANCTRL_OPMODE_CONFIG | MCP2515_CANCTRL_CLKOUT_CLKPRE_4);

// set RXB0 ctrl BUKT bit on to enable rollover to rx1
prv_bit_modify(storage, MCP2515_CTRL_REG_RXB0CTRL, 1 << 3, 1 << 3);
prv_bit_modify(storage, MCP2515_CTRL_REG_RXB0CTRL, 1 << 3, 1 << 3); // Replace the magic numbers

prv_configure_filters(storage, settings->filters);

Expand Down Expand Up @@ -301,6 +301,7 @@ StatusCode mcp2515_init(Mcp2515Storage *storage, const Mcp2515Settings *settings
prv_bit_modify(storage, MCP2515_CTRL_REG_CANCTRL, MCP2515_CANCTRL_OPMODE_MASK, opmode);
// Active-low interrupt pin
const GpioSettings gpio_settings = {
// potentially set up the rest of the fields
.direction = GPIO_DIR_IN,
};

Expand Down