Skip to content

Commit 5459cb4

Browse files
committed
Add CAN msg filters
1 parent 526cf1c commit 5459cb4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Core/Src/can_handler.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ uint8_t init_can1(FDCAN_HandleTypeDef *hcan) {
5858
return U_ERROR;
5959
}
6060

61+
#if TEST_MODE_ENABLED
62+
uint16_t standard3[] = { CALYPSO_ALPHA_CELL_DATA_CANID, CALYPSO_BETA_CELL_DATA_CANID };
63+
status = can_add_filter_standard(&can1, standard3);
64+
if (status != HAL_OK) {
65+
PRINTLN_ERROR("Failed to add standard filter to can1 (Status: %d/%s, ID1: "
66+
"%d, ID2: %d).",
67+
status, hal_status_toString(status), standard3[0],
68+
standard3[1]);
69+
return U_ERROR;
70+
}
71+
#endif // TEST_MODE_ENABLED
72+
6173
/* Add fitlers for extended IDs */
6274
uint32_t extended1[] = {CHARGERBOX_CANID, 0x00};
6375
status = can_add_filter_extended(&can1, extended1);

0 commit comments

Comments
 (0)