Merge pull request #322 from EliteEng/dev

Update to fix compile error
This commit is contained in:
Sonny Jeon 2014-01-03 06:23:39 -08:00
commit 0104cad56a
2 changed files with 12 additions and 1 deletions

View File

@ -25,7 +25,10 @@
static uint8_t current_direction; static uint8_t current_direction;
static uint16_t current_rpm; static uint16_t current_rpm;
static uint8_t current_pwm;
#ifdef VARIABLE_SPINDLE
static uint8_t current_pwm; // Stores the PWM set by the S value
#endif
void spindle_init() void spindle_init()
{ {
@ -86,12 +89,17 @@ void spindle_run(int8_t direction, uint16_t rpm) {
} }
} }
#ifdef VARIABLE_SPINDLE
uint8_t spindle_pwm() uint8_t spindle_pwm()
{ {
// This function can be used by the st_prep_buffer() to calculate what the spindle speed vs travel speed
return current_pwm; return current_pwm;
} }
void spindle_pwm_update(uint8_t pwm) void spindle_pwm_update(uint8_t pwm)
{ {
// This function can be used by the stepper interrupt to set the spindle speed
OCR_REGISTER = pwm; OCR_REGISTER = pwm;
} }
#endif

View File

@ -27,7 +27,10 @@
void spindle_init(); void spindle_init();
void spindle_run(int8_t direction, uint16_t rpm); void spindle_run(int8_t direction, uint16_t rpm);
void spindle_stop(); void spindle_stop();
#ifdef VARIABLE_SPINDLE
uint8_t spindle_pwm(); uint8_t spindle_pwm();
void spindle_pwm_update(uint8_t pwm); void spindle_pwm_update(uint8_t pwm);
#endif
#endif #endif