Skip to content

Commit

Permalink
spindle pwm must be 32 bit on this cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
mirecta committed Jul 18, 2018
1 parent 492cd71 commit d302896
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion grbl/spindle_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void spindle_init()

uint8_t spindle_get_state()
{
uint8_t pin = 0;
uint16_t pin = 0;
#ifdef VARIABLE_SPINDLE
#ifdef USE_SPINDLE_DIR_AS_ENABLE_PIN
#ifdef AVRTARGET
Expand Down
2 changes: 1 addition & 1 deletion grbl/spindle_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ uint8_t spindle_get_state();
// Called by spindle_sync() after sync and parking motion/spindle stop override during restore.
#ifdef VARIABLE_SPINDLE
#ifdef STM32F103C8
#define SPINDLE_PWM_TYPE uint16_t
#define SPINDLE_PWM_TYPE uint32_t
#else
#define SPINDLE_PWM_TYPE uint8_t
#endif
Expand Down
6 changes: 3 additions & 3 deletions grbl/stepper.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ typedef struct {
uint8_t prescaler; // Without AMASS, a prescaler is required to adjust for slow timing.
#endif
#ifdef VARIABLE_SPINDLE
uint8_t spindle_pwm;
uint32_t spindle_pwm;
#endif
} segment_t;
static segment_t segment_buffer[SEGMENT_BUFFER_SIZE];
Expand Down Expand Up @@ -233,7 +233,7 @@ typedef struct {

#ifdef VARIABLE_SPINDLE
float inv_rate; // Used by PWM laser mode to speed up segment calculations.
uint8_t current_spindle_pwm;
uint32_t current_spindle_pwm;
#endif
} st_prep_t;
static st_prep_t prep;
Expand Down Expand Up @@ -548,7 +548,7 @@ void Timer1Proc()
#endif

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

Expand Down

0 comments on commit d302896

Please sign in to comment.