Merge remote-tracking branch 'robert/MK3-variants' into variants

This commit is contained in:
PavelSindler 2019-02-06 09:20:21 +01:00
commit 27d002a46f
5 changed files with 39 additions and 19 deletions

View file

@ -2325,9 +2325,9 @@ void refresh_cmd_timeout(void)
void trace() {
//if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, 440);
_tone(BEEPER, 440);
_delay(25);
noTone(BEEPER);
_noTone(BEEPER);
_delay(20);
}
/*
@ -3124,9 +3124,9 @@ void gcode_M701()
load_filament_final_feed(); //slow sequence
st_synchronize();
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) tone(BEEPER, 500);
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE)) _tone(BEEPER, 500);
delay_keep_alive(50);
noTone(BEEPER);
_noTone(BEEPER);
if (!farm_mode && loading_flag) {
lcd_load_filament_color_check();
@ -3189,9 +3189,9 @@ static void gcode_PRUSA_SN()
putchar('\n');
#if 0
for (int b = 0; b < 3; b++) {
tone(BEEPER, 110);
_tone(BEEPER, 110);
_delay(50);
noTone(BEEPER);
_noTone(BEEPER);
_delay(50);
}
#endif
@ -6268,9 +6268,9 @@ Sigma_Exit:
{
#if BEEPER > 0
if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
tone(BEEPER, beepS);
_tone(BEEPER, beepS);
_delay(beepP);
noTone(BEEPER);
_noTone(BEEPER);
#endif
}
else
@ -7494,9 +7494,9 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
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);
noTone(BEEPER);
_noTone(BEEPER);
loading_flag = true;
enquecommand_front_P((PSTR("M701")));
}
@ -9233,9 +9233,9 @@ void M600_load_filament() {
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);
noTone(BEEPER);
_noTone(BEEPER);
break;
}
#endif //FILAMENT_SENSOR
@ -9252,9 +9252,9 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
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);
noTone(BEEPER);
_noTone(BEEPER);
#ifdef FSENSOR_QUALITY
fsensor_oq_meassure_stop();

View file

@ -11,10 +11,14 @@
#define _millis millis2
#define _micros micros2
#define _delay delay2
#define _tone tone2
#define _noTone noTone2
#else //SYSTEM_TIMER_2
#define _millis millis
#define _micros micros
#define _delay delay
#define _tone tone
#define _noTone noTone
#define timer02_set_pwm0(pwm0)
#endif //SYSTEM_TIMER_2

View file

@ -4,8 +4,10 @@
// original OVF handler is disabled
#include <avr/io.h>
#include <avr/interrupt.h>
#include <Arduino.h>
#include "Arduino.h"
#include "io_atmega2560.h"
#define BEEPER 84
uint8_t timer02_pwm0 = 0;
@ -154,3 +156,13 @@ void delay2(unsigned long ms)
}
}
}
void tone2(uint8_t _pin, unsigned int frequency/*, unsigned long duration*/)
{
PIN_SET(BEEPER);
}
void noTone2(uint8_t _pin)
{
PIN_CLR(BEEPER);
}

View file

@ -24,6 +24,10 @@ extern unsigned long micros2(void);
extern void delay2(unsigned long ms);
extern void tone2(uint8_t _pin, unsigned int frequency/*, unsigned long duration*/);
extern void noTone2(uint8_t _pin);
#if defined(__cplusplus)
}

View file

@ -296,14 +296,14 @@ bool show_upgrade_dialog_if_version_newer(const char *version_string)
lcd_putc(*c);
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);
noTone(BEEPER);
_noTone(BEEPER);
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);
noTone(BEEPER);
_noTone(BEEPER);
lcd_wait_for_click();
lcd_update_enable(true);
lcd_clear();