Browse Source

Clean up the code a bit

pull/1/head
João Brázio 9 years ago
parent
commit
793cd0ae3b
  1. 9
      Marlin/Marlin_main.cpp
  2. 4
      Marlin/dogm_lcd_implementation.h
  3. 4
      Marlin/ultralcd_implementation_hitachi_HD44780.h

9
Marlin/Marlin_main.cpp

@ -3837,7 +3837,7 @@ inline void gcode_M104() {
// Detect if a print job has finished.
// When the target temperature for all extruders is zero then we must have
// finished printing.
if( print_job_start_ms != 0 ) {
if (print_job_start_ms) {
bool all_extruders_cooling = true;
for (int i = 0; i < EXTRUDERS; i++) if( degTargetHotend(i) > 0 ) {
all_extruders_cooling = false;
@ -3957,7 +3957,6 @@ inline void gcode_M105() {
* Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
*/
inline void gcode_M109() {
float temp;
bool no_wait_for_cooling = true;
if (setTargetedHotend(109)) return;
@ -3965,16 +3964,16 @@ inline void gcode_M109() {
no_wait_for_cooling = code_seen('S');
if (no_wait_for_cooling || code_seen('R')) {
temp = code_value();
float temp = code_value();
setTargetHotend(temp, target_extruder);
#if ENABLED(DUAL_X_CARRIAGE)
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
#endif
}
// Only makes sense to show the heating message if we're in fact heating.
if( temp > 0 ) LCD_MESSAGEPGM(MSG_HEATING);
if (temp > 0) LCD_MESSAGEPGM(MSG_HEATING);
}
#if ENABLED(AUTOTEMP)
autotemp_enabled = code_seen('F');

4
Marlin/dogm_lcd_implementation.h

@ -306,8 +306,8 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(80,48);
if (print_job_start_ms != 0) {
uint16_t time = ((print_job_stop_ms > print_job_start_ms)
? print_job_stop_ms : millis()) / 60000 - print_job_start_ms / 60000;
uint16_t time = (((print_job_stop_ms > print_job_start_ms)
? print_job_stop_ms : millis()) - print_job_start_ms) / 60000;
lcd_print(itostr2(time/60));
lcd_print(':');
lcd_print(itostr2(time%60));

4
Marlin/ultralcd_implementation_hitachi_HD44780.h

@ -707,8 +707,8 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(LCD_WIDTH - 6, 2);
lcd.print(LCD_STR_CLOCK[0]);
if (print_job_start_ms != 0) {
uint16_t time = ((print_job_stop_ms > print_job_start_ms)
? print_job_stop_ms : millis()) / 60000 - print_job_start_ms / 60000;
uint16_t time = (((print_job_stop_ms > print_job_start_ms)
? print_job_stop_ms : millis()) - print_job_start_ms) / 60000;
lcd.print(itostr2(time / 60));
lcd.print(':');
lcd.print(itostr2(time % 60));

Loading…
Cancel
Save