SOUND_ON_DEFAULT option (#24102)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Pauli Jokela
2022-05-12 05:23:16 +03:00
committed by GitHub
parent 11c701af9b
commit 04fe50936e
23 changed files with 80 additions and 92 deletions

View File

@@ -541,7 +541,7 @@ typedef struct SettingsDataStruct {
// Buzzer enable/disable
//
#if ENABLED(SOUND_MENU_ITEM)
bool buzzer_enabled;
bool sound_on;
#endif
//
@@ -1576,7 +1576,7 @@ void MarlinSettings::postprocess() {
// Buzzer enable/disable
//
#if ENABLED(SOUND_MENU_ITEM)
EEPROM_WRITE(ui.buzzer_enabled);
EEPROM_WRITE(ui.sound_on);
#endif
//
@@ -2546,8 +2546,8 @@ void MarlinSettings::postprocess() {
// Buzzer enable/disable
//
#if ENABLED(SOUND_MENU_ITEM)
_FIELD_TEST(buzzer_enabled);
EEPROM_READ(ui.buzzer_enabled);
_FIELD_TEST(sound_on);
EEPROM_READ(ui.sound_on);
#endif
//
@@ -2945,7 +2945,9 @@ void MarlinSettings::reset() {
//
// Buzzer enable/disable
//
TERN_(SOUND_MENU_ITEM, ui.buzzer_enabled = true);
#if ENABLED(SOUND_MENU_ITEM)
ui.sound_on = ENABLED(SOUND_ON_DEFAULT);
#endif
//
// Magnetic Parking Extruder

View File

@@ -178,7 +178,7 @@
#include "tool_change.h"
#endif
#if USE_BEEPER
#if HAS_BEEPER
#include "../libs/buzzer.h"
#endif
@@ -1224,18 +1224,14 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) {
marlin_state = MF_KILLED;
thermalManager.disable_all_heaters();
#if USE_BEEPER
#if HAS_BEEPER
for (uint8_t i = 20; i--;) {
WRITE(BEEPER_PIN, HIGH);
delay(25);
watchdog_refresh();
WRITE(BEEPER_PIN, LOW);
delay(40);
watchdog_refresh();
delay(40);
buzzer.click(25);
delay(80);
watchdog_refresh();
}
WRITE(BEEPER_PIN, HIGH);
buzzer.on();
#endif
#if ENABLED(NOZZLE_PARK_FEATURE)
if (!homing_needed_error()) {