Sound @ MK2

step 2
This commit is contained in:
MRprusa3d 2019-04-08 23:02:48 +02:00
parent 1c7a280faf
commit a9f83f5cea
4 changed files with 13 additions and 0 deletions

View File

@ -937,6 +937,7 @@ void factory_reset(char level, bool quiet)
// Level 0: Language reset
case 0:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -946,6 +947,7 @@ void factory_reset(char level, bool quiet)
//Level 1: Reset statistics
case 1:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -969,6 +971,7 @@ void factory_reset(char level, bool quiet)
eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
EEPROM_save_B(EEPROM_FARM_NUMBER, &farm_no);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -981,6 +984,7 @@ void factory_reset(char level, bool quiet)
lcd_printPGM(PSTR("Factory RESET"));
lcd_print_at_PGM(1, 2, PSTR("ERASING all data"));
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
_delay_ms(100);
WRITE(BEEPER, LOW);
@ -1117,6 +1121,7 @@ void setup()
SET_OUTPUT(BEEPER);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH);
while (!READ(BTN_ENC));
@ -5076,6 +5081,7 @@ Sigma_Exit:
if (beepS > 0)
{
#if BEEPER > 0
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, beepS);
delay(beepP);
noTone(BEEPER);

View File

@ -31,6 +31,7 @@
#include "Marlin.h"
#include "ultralcd.h"
#include "sound.h"
#include "temperature.h"
#include "watchdog.h"
#include "cardreader.h"
@ -1239,6 +1240,7 @@ void temp_runaway_stop(bool isPreheat, bool isBed)
disable_e2();
manage_heater();
lcd_update();
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH);
delayMicroseconds(500);
WRITE(BEEPER, LOW);
@ -1324,6 +1326,7 @@ void max_temp_error(uint8_t e) {
SET_OUTPUT(BEEPER);
WRITE(FAN_PIN, 1);
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, 1);
// fanSpeed will consumed by the check_axes_activity() routine.
fanSpeed=255;

View File

@ -4779,6 +4779,7 @@ static void lcd_main_menu()
void stack_error() {
SET_OUTPUT(BEEPER);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH);
delay(1000);
WRITE(BEEPER, LOW);

View File

@ -1,6 +1,7 @@
#include "Configuration.h"
#include "ultralcd.h"
#include "sound.h"
#include "language.h"
#include "util.h"
@ -256,10 +257,12 @@ bool show_upgrade_dialog_if_version_newer(const char *version_string)
for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c)
lcd_implementation_write(*c);
lcd_print_at_PGM(0, 3, MSG_NEW_FIRMWARE_PLEASE_UPGRADE);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000);
delay_keep_alive(50);
noTone(BEEPER);
delay_keep_alive(500);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000);
delay_keep_alive(50);
noTone(BEEPER);