Don't apply M428 if an error occurs

- Also move audio feedback into the command
- Added shorthand for `lcd_buzz` availability
This commit is contained in:
Scott Lahteine
2015-04-29 19:05:48 -07:00
parent d065d37822
commit d4c74b8f8c
5 changed files with 49 additions and 24 deletions

View File

@ -442,8 +442,8 @@ static void lcd_main_menu() {
* Set the home offset based on the current_position
*/
void lcd_set_home_offsets() {
// Command with Audio feedback
enqueuecommands_P(PSTR("M428\nM300 S659 P200\nM300 S698 P200"));
// M428 Command
enqueuecommands_P(PSTR("M428"));
lcd_return_to_status();
}
@ -1285,7 +1285,7 @@ void lcd_quick_feedback() {
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6)
#endif
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#elif defined(BEEPER) && BEEPER > -1
#elif defined(BEEPER) && BEEPER >= 0
#ifndef LCD_FEEDBACK_FREQUENCY_HZ
#define LCD_FEEDBACK_FREQUENCY_HZ 5000
#endif
@ -1718,12 +1718,12 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
void lcd_buzz(long duration, uint16_t freq) {
if (freq > 0) {
#if BEEPER > 0
#ifdef LCD_USE_I2C_BUZZER
lcd.buzz(duration, freq);
#elif defined(BEEPER) && BEEPER >= 0
SET_OUTPUT(BEEPER);
tone(BEEPER, freq, duration);
delay(duration);
#elif defined(LCD_USE_I2C_BUZZER)
lcd.buzz(duration, freq);
#else
delay(duration);
#endif