From 6d569cd838e92fac480fadd03992cf1ea5cf0411 Mon Sep 17 00:00:00 2001 From: Wilhelm Duembeg Date: Sun, 7 Apr 2019 15:50:33 -0700 Subject: [PATCH] Fix bug with size for step_pulse_time for STM32 * Fixed issue with size of step_pulse_time, it is a uint8 but for STM32 and clk source of 72MHz these would be 720 for 10us pulse; uint8 can only hold 255 max. Changed type to uint16 on stm32 targets. --- grbl/stepper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/grbl/stepper.c b/grbl/stepper.c index fa5be91d..621d9b9c 100644 --- a/grbl/stepper.c +++ b/grbl/stepper.c @@ -140,10 +140,12 @@ typedef struct { #endif uint8_t execute_step; // Flags step execution for each interrupt. -#ifndef WIN32 - uint8_t step_pulse_time; // Step pulse reset time after step rise +#ifdef WIN32 + LONGLONG step_pulse_time; // Step pulse reset time after step rise +#elif defined(STM32F103C8) + uint16_t step_pulse_time; // Step pulse reset time after step rise #else - LONGLONG step_pulse_time; + uint8_t step_pulse_time; // Step pulse reset time after step rise #endif PORTPINDEF step_outbits; // The next stepping-bits to be output PORTPINDEF dir_outbits;