BUZZ cleanup (#14760)
This commit is contained in:
@ -79,7 +79,7 @@ void BrickoutGame::game_screen() {
|
||||
}
|
||||
// Did the ball go below the bottom?
|
||||
else if (newy > BTOF(LCD_PIXEL_HEIGHT)) {
|
||||
BUZZ(500, 75);
|
||||
_BUZZ(500, 75);
|
||||
if (--bdat.balls_left) reset_ball(); else game_state = 0;
|
||||
break; // done
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
//#define MUTE_GAMES
|
||||
|
||||
#ifdef MUTE_GAMES
|
||||
#if ENABLED(MUTE_GAMES) || !HAS_BUZZER
|
||||
#define _BUZZ(D,F) NOOP
|
||||
#else
|
||||
#define _BUZZ(D,F) BUZZ(D,F)
|
||||
|
@ -31,7 +31,9 @@
|
||||
#include "../../module/printcounter.h"
|
||||
#include "../../gcode/queue.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../libs/buzzer.h"
|
||||
#if HAS_BUZZER
|
||||
#include "../../libs/buzzer.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
#include "../../module/configuration_store.h"
|
||||
@ -346,13 +348,15 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
encoderTopLine = encoderLine;
|
||||
}
|
||||
|
||||
void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
||||
if (good) {
|
||||
BUZZ(100, 659);
|
||||
BUZZ(100, 698);
|
||||
#if HAS_BUZZER
|
||||
void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
||||
if (good) {
|
||||
BUZZ(100, 659);
|
||||
BUZZ(100, 698);
|
||||
}
|
||||
else BUZZ(20, 440);
|
||||
}
|
||||
else BUZZ(20, 440);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_LINE_TO_Z
|
||||
|
||||
@ -433,8 +437,18 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
||||
#endif
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
void lcd_store_settings() { ui.completion_feedback(settings.save()); }
|
||||
void lcd_load_settings() { ui.completion_feedback(settings.load()); }
|
||||
void lcd_store_settings() {
|
||||
const bool saved = settings.save();
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback(saved);
|
||||
#endif
|
||||
}
|
||||
void lcd_load_settings() {
|
||||
const bool loaded = settings.load();
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback(loaded);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void _lcd_draw_homing() {
|
||||
|
@ -603,7 +603,12 @@ void menu_backlash();
|
||||
static void lcd_init_eeprom_confirm() {
|
||||
do_select_screen(
|
||||
PSTR(MSG_BUTTON_INIT), PSTR(MSG_BUTTON_CANCEL),
|
||||
[]{ ui.completion_feedback(settings.init_eeprom()); },
|
||||
[]{
|
||||
const bool inited = settings.init_eeprom();
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback(inited);
|
||||
#endif
|
||||
},
|
||||
ui.goto_previous_screen,
|
||||
PSTR(MSG_INIT_EEPROM), nullptr, PSTR("?")
|
||||
);
|
||||
@ -698,8 +703,11 @@ void menu_advanced_settings() {
|
||||
//
|
||||
// Toggle the SD Firmware Update state in EEPROM
|
||||
//
|
||||
const bool new_state = !settings.sd_update_status();
|
||||
ui.completion_feedback(settings.set_sd_update_status(new_state));
|
||||
const bool new_state = !settings.sd_update_status(),
|
||||
didset = settings.set_sd_update_status(new_state);
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback(didset);
|
||||
#endif
|
||||
ui.return_to_status();
|
||||
if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status();
|
||||
});
|
||||
|
@ -77,7 +77,9 @@
|
||||
ui.synchronize(PSTR(MSG_LEVEL_BED_DONE));
|
||||
#endif
|
||||
ui.goto_previous_screen_no_defer();
|
||||
ui.completion_feedback();
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback();
|
||||
#endif
|
||||
}
|
||||
if (ui.should_draw()) draw_menu_item_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE));
|
||||
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
|
@ -56,7 +56,9 @@ void menu_advanced_settings();
|
||||
|
||||
static void lcd_factory_settings() {
|
||||
settings.reset();
|
||||
ui.completion_feedback();
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR_TEST)
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
void _lcd_user_gcode(PGM_P const cmd) {
|
||||
queue.inject_P(cmd);
|
||||
#if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK)
|
||||
#if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) && HAS_BUZZER
|
||||
ui.completion_feedback();
|
||||
#endif
|
||||
#if ENABLED(USER_SCRIPT_RETURN)
|
||||
|
@ -38,7 +38,9 @@ inline void _menu_service(const int index, PGM_P const name) {
|
||||
PSTR(MSG_BUTTON_RESET), PSTR(MSG_BUTTON_CANCEL),
|
||||
[]{
|
||||
print_job_timer.resetServiceInterval(index);
|
||||
ui.completion_feedback(true);
|
||||
#if HAS_BUZZER
|
||||
ui.completion_feedback();
|
||||
#endif
|
||||
ui.reset_status();
|
||||
ui.return_to_status();
|
||||
},
|
||||
|
Reference in New Issue
Block a user