Merge pull request #2199 from leptun/MK3_MK2.x_fix_Default_stepper_power
Mk3 mk2.x fix default stepper power
This commit is contained in:
commit
9ff0b7c3a5
1 changed files with 7 additions and 4 deletions
|
@ -1561,11 +1561,14 @@ void EEPROM_read_st(int pos, uint8_t* value, uint8_t size)
|
||||||
|
|
||||||
|
|
||||||
void st_current_init() //Initialize Digipot Motor Current
|
void st_current_init() //Initialize Digipot Motor Current
|
||||||
{
|
{
|
||||||
|
#ifdef MOTOR_CURRENT_PWM_XY_PIN
|
||||||
uint8_t SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT);
|
uint8_t SilentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT);
|
||||||
if (SilentMode == 0xff) SilentMode = 0; //set power to High Power (MK2.5) or Normal Power (MK3, unused)
|
if (SilentMode == 0xff){ //set power to High Power (MK2.5) or Normal Power (MK3, unused)
|
||||||
|
SilentMode = SILENT_MODE_POWER;
|
||||||
|
eeprom_update_byte((uint8_t*)EEPROM_SILENT, SilentMode);
|
||||||
|
}
|
||||||
SilentModeMenu = SilentMode;
|
SilentModeMenu = SilentMode;
|
||||||
#ifdef MOTOR_CURRENT_PWM_XY_PIN
|
|
||||||
pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
|
pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
|
||||||
pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT);
|
pinMode(MOTOR_CURRENT_PWM_Z_PIN, OUTPUT);
|
||||||
pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT);
|
pinMode(MOTOR_CURRENT_PWM_E_PIN, OUTPUT);
|
||||||
|
@ -1587,7 +1590,7 @@ void st_current_init() //Initialize Digipot Motor Current
|
||||||
st_current_set(2, motor_current_setting[2]);
|
st_current_set(2, motor_current_setting[2]);
|
||||||
//Set timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise)
|
//Set timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise)
|
||||||
TCCR5B = (TCCR5B & ~(_BV(CS50) | _BV(CS51) | _BV(CS52))) | _BV(CS50);
|
TCCR5B = (TCCR5B & ~(_BV(CS50) | _BV(CS51) | _BV(CS52))) | _BV(CS50);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue