Merge pull request #984 from MRprusa3d/MK3

Sound
This commit is contained in:
PavelSindler 2018-07-30 10:55:06 +02:00 committed by GitHub
commit 9195167541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View File

@ -799,6 +799,7 @@ void factory_reset(char level, bool quiet)
// Level 0: Language reset // Level 0: Language reset
case 0: case 0:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
_delay_ms(100); _delay_ms(100);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -807,6 +808,7 @@ void factory_reset(char level, bool quiet)
//Level 1: Reset statistics //Level 1: Reset statistics
case 1: case 1:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
_delay_ms(100); _delay_ms(100);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -854,6 +856,7 @@ void factory_reset(char level, bool quiet)
fsensor_autoload_set(true); fsensor_autoload_set(true);
#endif //FILAMENT_SENSOR #endif //FILAMENT_SENSOR
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
_delay_ms(100); _delay_ms(100);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -866,6 +869,7 @@ void factory_reset(char level, bool quiet)
lcd_puts_P(PSTR("Factory RESET")); lcd_puts_P(PSTR("Factory RESET"));
lcd_puts_at_P(1, 2, PSTR("ERASING all data")); lcd_puts_at_P(1, 2, PSTR("ERASING all data"));
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
_delay_ms(100); _delay_ms(100);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -938,6 +942,7 @@ void factory_reset()
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
while (!READ(BTN_ENC)); while (!READ(BTN_ENC));
@ -2461,6 +2466,7 @@ void refresh_cmd_timeout(void)
#endif //FWRETRACT #endif //FWRETRACT
void trace() { void trace() {
//if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 440); tone(BEEPER, 440);
delay(25); delay(25);
noTone(BEEPER); noTone(BEEPER);
@ -3095,6 +3101,7 @@ void gcode_M701()
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 100 / 60, active_extruder); //slow sequence plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 100 / 60, active_extruder); //slow sequence
st_synchronize(); st_synchronize();
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 500); tone(BEEPER, 500);
delay_keep_alive(50); delay_keep_alive(50);
noTone(BEEPER); noTone(BEEPER);
@ -3495,6 +3502,7 @@ void process_commands()
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
if (counterBeep== 0){ if (counterBeep== 0){
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER,HIGH); WRITE(BEEPER,HIGH);
} }
@ -6052,6 +6060,7 @@ Sigma_Exit:
if (beepS > 0) if (beepS > 0)
{ {
#if BEEPER > 0 #if BEEPER > 0
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, beepS); tone(BEEPER, beepS);
delay(beepP); delay(beepP);
noTone(BEEPER); noTone(BEEPER);
@ -6493,6 +6502,7 @@ Sigma_Exit:
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
counterBeep = 0; counterBeep = 0;
while(!lcd_clicked() && (counterBeep < 50)) { while(!lcd_clicked() && (counterBeep < 50)) {
@ -7505,6 +7515,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
fsensor_autoload_check_stop(); fsensor_autoload_check_stop();
if (degHotend0() > EXTRUDE_MINTEMP) if (degHotend0() > EXTRUDE_MINTEMP)
{ {
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000); tone(BEEPER, 1000);
delay_keep_alive(50); delay_keep_alive(50);
noTone(BEEPER); noTone(BEEPER);
@ -9159,6 +9170,7 @@ void M600_load_filament()
#ifdef FILAMENT_SENSOR #ifdef FILAMENT_SENSOR
if (fsensor_check_autoload()) if (fsensor_check_autoload())
{ {
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000); tone(BEEPER, 1000);
delay_keep_alive(50); delay_keep_alive(50);
noTone(BEEPER); noTone(BEEPER);
@ -9177,6 +9189,7 @@ void M600_load_filament()
M600_load_filament_movements(); M600_load_filament_movements();
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 500); tone(BEEPER, 500);
delay_keep_alive(50); delay_keep_alive(50);
noTone(BEEPER); noTone(BEEPER);

View File

@ -31,6 +31,7 @@
#include "Marlin.h" #include "Marlin.h"
#include "ultralcd.h" #include "ultralcd.h"
#include "sound.h"
#include "temperature.h" #include "temperature.h"
#include "cardreader.h" #include "cardreader.h"
@ -523,6 +524,7 @@ void fanSpeedError(unsigned char _fan) {
case 0: case 0:
SERIAL_ECHOLNPGM("Extruder fan speed is lower then expected"); SERIAL_ECHOLNPGM("Extruder fan speed is lower then expected");
if (get_message_level() == 0) { if (get_message_level() == 0) {
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
delayMicroseconds(200); delayMicroseconds(200);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -533,6 +535,7 @@ void fanSpeedError(unsigned char _fan) {
case 1: case 1:
SERIAL_ECHOLNPGM("Print fan speed is lower then expected"); SERIAL_ECHOLNPGM("Print fan speed is lower then expected");
if (get_message_level() == 0) { if (get_message_level() == 0) {
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
delayMicroseconds(200); delayMicroseconds(200);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -1343,6 +1346,7 @@ void temp_runaway_stop(bool isPreheat, bool isBed)
disable_e2(); disable_e2();
manage_heater(); manage_heater();
lcd_update(0); lcd_update(0);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
delayMicroseconds(500); delayMicroseconds(500);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);
@ -1427,6 +1431,7 @@ void max_temp_error(uint8_t e) {
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
WRITE(FAN_PIN, 1); WRITE(FAN_PIN, 1);
WRITE(EXTRUDER_0_AUTO_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); WRITE(BEEPER, 1);
// fanSpeed will consumed by the check_axes_activity() routine. // fanSpeed will consumed by the check_axes_activity() routine.
fanSpeed=255; fanSpeed=255;

View File

@ -31,7 +31,6 @@
#include "tmc2130.h" #include "tmc2130.h"
#endif //TMC2130 #endif //TMC2130
//-//
#include "sound.h" #include "sound.h"
#ifdef SNMM_V2 #ifdef SNMM_V2
@ -6065,6 +6064,7 @@ static void lcd_main_menu()
void stack_error() { void stack_error() {
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)||(eSoundMode==e_SOUND_MODE_SILENT))
WRITE(BEEPER, HIGH); WRITE(BEEPER, HIGH);
delay(1000); delay(1000);
WRITE(BEEPER, LOW); WRITE(BEEPER, LOW);

View File

@ -1,6 +1,7 @@
#include "Configuration.h" #include "Configuration.h"
#include "ultralcd.h" #include "ultralcd.h"
#include "sound.h"
#include "language.h" #include "language.h"
#include "util.h" #include "util.h"
@ -294,10 +295,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) for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c)
lcd_putc(*c); lcd_putc(*c);
lcd_puts_at_P(0, 3, _i("Please upgrade."));////MSG_NEW_FIRMWARE_PLEASE_UPGRADE c=20 r=0 lcd_puts_at_P(0, 3, _i("Please upgrade."));////MSG_NEW_FIRMWARE_PLEASE_UPGRADE c=20 r=0
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000); tone(BEEPER, 1000);
delay_keep_alive(50); delay_keep_alive(50);
noTone(BEEPER); noTone(BEEPER);
delay_keep_alive(500); delay_keep_alive(500);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 1000); tone(BEEPER, 1000);
delay_keep_alive(50); delay_keep_alive(50);
noTone(BEEPER); noTone(BEEPER);