From 99c05b79d0f13781c4b3610725fa840c589137fe Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 13 Oct 2021 15:41:55 +0200 Subject: [PATCH] Adjust SG filtering threshold --- src/hal/tmc2130.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal/tmc2130.cpp b/src/hal/tmc2130.cpp index e11c741..fc162ba 100644 --- a/src/hal/tmc2130.cpp +++ b/src/hal/tmc2130.cpp @@ -8,7 +8,7 @@ namespace hal { namespace tmc2130 { bool TMC2130::Init(const MotorParams ¶ms, const MotorCurrents ¤ts, MotorMode mode) { - sg_filter_threshold = (1 << (8 - params.mRes)) - 1; + sg_filter_threshold = (1 << (8 - params.mRes)); gpio::Init(params.csPin, gpio::GPIO_InitTypeDef(gpio::Mode::output, gpio::Level::high)); gpio::Init(params.sgPin, gpio::GPIO_InitTypeDef(gpio::Mode::input, gpio::Pull::up));