From fb8a28d1208cb03d824577d9ea6b1ef44952e585 Mon Sep 17 00:00:00 2001
From: Robert Pelnar <robert.pelnar@seznam.cz>
Date: Thu, 1 Mar 2018 14:34:21 +0100
Subject: [PATCH] bugfix - beltstatus overflow

---
 Firmware/tmc2130.cpp | 2 +-
 Firmware/tmc2130.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Firmware/tmc2130.cpp b/Firmware/tmc2130.cpp
index 109712bd..58f84cf4 100644
--- a/Firmware/tmc2130.cpp
+++ b/Firmware/tmc2130.cpp
@@ -50,7 +50,7 @@ uint8_t tmc2130_sg_thr_home[4] = {3, 3, TMC2130_SG_THRS_Z, TMC2130_SG_THRS_E};
 uint8_t sg_homing_axes_mask = 0x00;
 
 uint8_t tmc2130_sg_meassure = 0xff;
-uint16_t tmc2130_sg_meassure_cnt = 0;
+uint32_t tmc2130_sg_meassure_cnt = 0;
 uint32_t tmc2130_sg_meassure_val = 0;
 
 uint8_t tmc2130_home_enabled = 0;
diff --git a/Firmware/tmc2130.h b/Firmware/tmc2130.h
index 6dd9f59d..4f93a0c3 100644
--- a/Firmware/tmc2130.h
+++ b/Firmware/tmc2130.h
@@ -17,7 +17,7 @@ extern bool tmc2130_sg_stop_on_crash;
 extern uint8_t tmc2130_sg_crash; //crash mask
 
 extern uint8_t tmc2130_sg_meassure;
-extern uint16_t tmc2130_sg_meassure_cnt;
+extern uint32_t tmc2130_sg_meassure_cnt;
 extern uint32_t tmc2130_sg_meassure_val;
 
 #define TMC2130_MODE_NORMAL 0