Commit 53a451a0 authored by MagoKimbra's avatar MagoKimbra

Fix language and delete class timer

parent 935c8981
...@@ -454,40 +454,6 @@ bool target_direction; ...@@ -454,40 +454,6 @@ bool target_direction;
//=========================================================================== //===========================================================================
//================================ Functions ================================ //================================ Functions ================================
//=========================================================================== //===========================================================================
class Timer
{
public:
Timer(void);
void set_max_delay(unsigned long v);
void set(void);
boolean check(void);
private:
unsigned long max_delay;
unsigned long last_set;
};
Timer::Timer(void)
{
max_delay = 3600000UL; // default 1 hour
}
void Timer::set_max_delay(unsigned long v)
{
max_delay = v;
set();
}
void Timer::set()
{
last_set = millis();
}
boolean Timer::check()
{
unsigned long now = millis();
if (now - last_set > max_delay) {
last_set = now;
return true;
}
return false;
}
Timer timer;
void get_arc_coordinates(); void get_arc_coordinates();
bool setTargetedHotend(int code); bool setTargetedHotend(int code);
...@@ -2500,7 +2466,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position, ...@@ -2500,7 +2466,7 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
inline void lcd_beep(int number_beep = 3) { inline void lcd_beep(int number_beep = 3) {
#ifdef LCD_USE_I2C_BUZZER #ifdef LCD_USE_I2C_BUZZER
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) #if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
for(int8_t i=0;i<3;i++) { for(int8_t i = 0; i < 3; i++) {
lcd_buzz(1000/6,100); lcd_buzz(1000/6,100);
} }
#else #else
...@@ -2511,14 +2477,14 @@ inline void lcd_beep(int number_beep = 3) { ...@@ -2511,14 +2477,14 @@ inline void lcd_beep(int number_beep = 3) {
#elif defined(BEEPER) && BEEPER > -1 #elif defined(BEEPER) && BEEPER > -1
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) #if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
for(int8_t i=0;i<number_beep;i++) { for(int8_t i = 0; i < number_beep; i++) {
WRITE(BEEPER,HIGH); WRITE(BEEPER,HIGH);
delay(100); delay(100);
WRITE(BEEPER,LOW); WRITE(BEEPER,LOW);
delay(100); delay(100);
} }
#else #else
for(int8_t i=0;i<number_beep;i++) { for(int8_t i = 0; i < number_beep; i++) {
WRITE(BEEPER,HIGH); WRITE(BEEPER,HIGH);
delay(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2); delay(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
WRITE(BEEPER,LOW); WRITE(BEEPER,LOW);
...@@ -5366,27 +5332,27 @@ inline void gcode_M503() { ...@@ -5366,27 +5332,27 @@ inline void gcode_M503() {
old_target_temperature[e] = target_temperature[e]; old_target_temperature[e] = target_temperature[e];
} }
int old_target_temperature_bed = target_temperature_bed; int old_target_temperature_bed = target_temperature_bed;
timer.set_max_delay(60000); // 1 minute millis_t last_set = millis();
PRESSBUTTON: PRESSBUTTON:
LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE); LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
while (!lcd_clicked()) { while (!lcd_clicked()) {
manage_heater(); manage_heater();
manage_inactivity(true); manage_inactivity(true);
lcd_update(); lcd_update();
if (timer.check() && cnt <= FILAMENTCHANGE_PRINTEROFF) beep = true; if ((millis() - last_set > 60000) && cnt <= FILAMENTCHANGE_PRINTEROFF) beep = true;
if (cnt >= FILAMENTCHANGE_PRINTEROFF && !sleep) { if (cnt >= FILAMENTCHANGE_PRINTEROFF && !sleep) {
disable_all_heaters(); disable_all_heaters();
disable_x(); disable_x();
disable_y(); disable_y();
disable_z(); disable_z();
disable_e(); disable_e();
sleep = true; sleep = true;
lcd_reset_alert_level(); lcd_reset_alert_level();
LCD_ALERTMESSAGEPGM("Zzzz Zzzz Zzzz"); LCD_ALERTMESSAGEPGM("Zzzz Zzzz Zzzz");
} }
if (beep) { if (beep) {
timer.set(); last_set = millis();
lcd_beep(3); lcd_beep(3);
beep = false; beep = false;
cnt += 1; cnt += 1;
......
...@@ -8,10 +8,14 @@ ...@@ -8,10 +8,14 @@
#ifndef LANGUAGE_IT_H #ifndef LANGUAGE_IT_H
#define LANGUAGE_IT_H #define LANGUAGE_IT_H
#define MAPPER_NON #if !( defined(MAPPER_NON)|| defined(MAPPER_C2C3)|| defined(MAPPER_D0D1)|| defined(MAPPER_D0D1_MOD)|| defined(MAPPER_E382E383) )
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h #define MAPPER_NON // For direct asci codes
//#define SIMULATE_ROMFONT #endif
#define DISPLAY_CHARSET_ISO10646_1
//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays
#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA) )
#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
#endif
#define WELCOME_MSG MACHINE_NAME " pronta." #define WELCOME_MSG MACHINE_NAME " pronta."
#define MSG_SD_INSERTED "SD Card inserita" #define MSG_SD_INSERTED "SD Card inserita"
...@@ -138,7 +142,8 @@ ...@@ -138,7 +142,8 @@
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Finecorsa abort" #define MSG_ENDSTOP_ABORT "Finecorsa abort"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
#define MSG_HEATING_FAILED_LCD "Heating failed" #define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR" #define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" #define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
...@@ -146,8 +151,6 @@ ...@@ -146,8 +151,6 @@
#define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
#ifdef DELTA #ifdef DELTA
#define MSG_DELTA_CALIBRATE "Calibraz. Delta" #define MSG_DELTA_CALIBRATE "Calibraz. Delta"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment