From 070e6f49e8303a6ae006675d853b9fc2eafe19e6 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Thu, 12 Jul 2018 18:56:11 +0200 Subject: [PATCH] Fix error in sine wave compression algorithm in tmc2130. This problem could manifest itself only for negative function slope, which is not used. --- Firmware/tmc2130.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/tmc2130.cpp b/Firmware/tmc2130.cpp index bfc720c6..558ea5aa 100644 --- a/Firmware/tmc2130.cpp +++ b/Firmware/tmc2130.cpp @@ -878,7 +878,7 @@ void tmc2130_set_wave(uint8_t axis, uint8_t amp, uint8_t fac1000) uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) uint8_t s = 0; //current segment int8_t b; //encoded bit value - uint8_t dA; //delta value + int8_t dA; //delta value int i; //microstep index uint32_t reg; //tmc2130 register tmc2130_wr_MSLUTSTART(axis, 0, amp);