Просмотр исходного кода

Merge remote-tracking branch 'upstream/MK3' into translations-doc

D.R.racer 4 лет назад
Родитель
Сommit
17cca89993
2 измененных файлов с 9 добавлено и 6 удалено
  1. 7 4
      Firmware/stepper.cpp
  2. 2 2
      Firmware/ultralcd.cpp

+ 7 - 4
Firmware/stepper.cpp

@@ -1561,11 +1561,14 @@ void EEPROM_read_st(int pos, uint8_t* value, uint8_t size)
 
 
 void st_current_init() //Initialize Digipot Motor Current
-{  
+{
+#ifdef MOTOR_CURRENT_PWM_XY_PIN
   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;
-  #ifdef MOTOR_CURRENT_PWM_XY_PIN
     pinMode(MOTOR_CURRENT_PWM_XY_PIN, OUTPUT);
     pinMode(MOTOR_CURRENT_PWM_Z_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]);
     //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);
-  #endif
+#endif
 }
 
 

+ 2 - 2
Firmware/ultralcd.cpp

@@ -3048,9 +3048,9 @@ static void lcd_menu_xyz_offset()
 
     for (uint_least8_t i = 0; i < 2; i++)
     {
-        lcd_puts_at_P(11, i + 2, PSTR(""));
+        lcd_set_cursor((cntr[i] < 0) ? 10 : 11, i+2);
         lcd_print(cntr[i]);
-        lcd_puts_at_P((cntr[i] < 0) ? 17 : 16, i + 2, PSTR("mm"));
+        lcd_puts_at_P(16, i + 2, PSTR("mm"));
     }
     menu_back_if_clicked();
 }