From 414a2e2bef285e7c189aaeedc658db9182ffc42c Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 21 Nov 2017 21:49:36 +0200 Subject: [PATCH] Fixed the CAN acceptance filter initialization in the STM32 driver --- libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp b/libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp index 13cef40aad..5bb5cf199d 100644 --- a/libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp +++ b/libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp @@ -472,7 +472,8 @@ uavcan::int16_t CanIface::configureFilters(const uavcan::CanFilterConfig* filter { can_->FilterRegister[filter_start_index].FR1 = 0; can_->FilterRegister[filter_start_index].FR2 = 0; - can_->FA1R = 1 << filter_start_index; + // We can't directly overwrite FA1R because that breaks the other CAN interface + can_->FA1R |= 1U << filter_start_index; // Other filters may still be enabled, we don't care } else {