Adjust SG filtering threshold

pull/132/head
Alex Voinea 2021-10-13 15:41:55 +02:00 committed by DRracer
parent a87b981a3d
commit 99c05b79d0
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ namespace hal {
namespace tmc2130 { namespace tmc2130 {
bool TMC2130::Init(const MotorParams &params, const MotorCurrents &currents, MotorMode mode) { bool TMC2130::Init(const MotorParams &params, const MotorCurrents &currents, 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.csPin, gpio::GPIO_InitTypeDef(gpio::Mode::output, gpio::Level::high));
gpio::Init(params.sgPin, gpio::GPIO_InitTypeDef(gpio::Mode::input, gpio::Pull::up)); gpio::Init(params.sgPin, gpio::GPIO_InitTypeDef(gpio::Mode::input, gpio::Pull::up));