Skip to content

Commit d302896

Browse files
author
Miroslav Talasek
committed
spindle pwm must be 32 bit on this cpu
1 parent 492cd71 commit d302896

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

grbl/spindle_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void spindle_init()
107107

108108
uint8_t spindle_get_state()
109109
{
110-
uint8_t pin = 0;
110+
uint16_t pin = 0;
111111
#ifdef VARIABLE_SPINDLE
112112
#ifdef USE_SPINDLE_DIR_AS_ENABLE_PIN
113113
#ifdef AVRTARGET

grbl/spindle_control.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ uint8_t spindle_get_state();
4141
// Called by spindle_sync() after sync and parking motion/spindle stop override during restore.
4242
#ifdef VARIABLE_SPINDLE
4343
#ifdef STM32F103C8
44-
#define SPINDLE_PWM_TYPE uint16_t
44+
#define SPINDLE_PWM_TYPE uint32_t
4545
#else
4646
#define SPINDLE_PWM_TYPE uint8_t
4747
#endif

grbl/stepper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ typedef struct {
143143
uint8_t prescaler; // Without AMASS, a prescaler is required to adjust for slow timing.
144144
#endif
145145
#ifdef VARIABLE_SPINDLE
146-
uint8_t spindle_pwm;
146+
uint32_t spindle_pwm;
147147
#endif
148148
} segment_t;
149149
static segment_t segment_buffer[SEGMENT_BUFFER_SIZE];
@@ -233,7 +233,7 @@ typedef struct {
233233

234234
#ifdef VARIABLE_SPINDLE
235235
float inv_rate; // Used by PWM laser mode to speed up segment calculations.
236-
uint8_t current_spindle_pwm;
236+
uint32_t current_spindle_pwm;
237237
#endif
238238
} st_prep_t;
239239
static st_prep_t prep;
@@ -548,7 +548,7 @@ void Timer1Proc()
548548
#endif
549549

550550
#ifdef VARIABLE_SPINDLE
551-
// Set real-time spindle output as segment is loaded, just prior to the first step.
551+
// Set real-time spindle output as segment is loaded, just prior to the first step. CMMT
552552
spindle_set_speed(st.exec_segment->spindle_pwm);
553553
#endif
554554

0 commit comments

Comments
 (0)