Skip to content

Commit 020bcb7

Browse files
committed
usb_slcan: disable can filters
1 parent 8982af3 commit 020bcb7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/usb_slcan/usb_slcan.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ static uint8_t hex_to_nibble(char c) {
7373
static void process_slcan_cmd(struct slcan_instance_s* instance, size_t cmd_len) {
7474
// Unsupported commands that are just ACKed
7575
switch(instance->cmd_buf[0]) {
76-
case 'S': // Set bitrate
7776
case 'C': // Close CAN channel
77+
can_set_filtering_enabled(instance.can_instance, true);
78+
case 'S': // Set bitrate
7879
case 'M':
7980
case 'm': {
8081
chnWriteTimeout(&SDU1, (uint8_t*)"\r", 1, TIME_IMMEDIATE);
@@ -88,16 +89,19 @@ static void process_slcan_cmd(struct slcan_instance_s* instance, size_t cmd_len)
8889
switch(instance->cmd_buf[0]) {
8990
case 'L': { // Open CAN channel in silent mode
9091
instance->loopback_enable = false;
92+
can_set_filtering_enabled(instance.can_instance, false);
9193
chnWriteTimeout(&SDU1, (uint8_t*)"\r", 1, TIME_IMMEDIATE);
9294
return;
9395
}
9496
case 'O': { // Open CAN channel in normal mode
9597
instance->loopback_enable = false;
98+
can_set_filtering_enabled(instance.can_instance, false);
9699
chnWriteTimeout(&SDU1, (uint8_t*)"\r", 1, TIME_IMMEDIATE);
97100
return;
98101
}
99102
case 'l': {
100103
instance->loopback_enable = true;
104+
can_set_filtering_enabled(instance.can_instance, false);
101105
chnWriteTimeout(&SDU1, (uint8_t*)"\r", 1, TIME_IMMEDIATE);
102106
return;
103107
}

0 commit comments

Comments
 (0)