Skip to content

Commit e137fd1

Browse files
committed
Merge tag '2.5.0'
BQ Marlin firmware version 2.5.0
2 parents 94a7aee + 1319aa3 commit e137fd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+6035
-107
lines changed

Documentation/Changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11

2+
# BQ Marlin v2.4.0
3+
---
4+
### Bugfixes:
5+
* Added support for box fan when printing through serial (W2).
6+
7+
### New hardware support:
8+
* Support for new printer Hephestos with BQ-Zum Mega3D board (HZ).
9+
210
# BQ Marlin v2.3.1
311
---
412
### Bugfixes:

Marlin/GuiAction.cpp

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646

4747
#ifdef DOGLCD
4848
#include "StatsManager.h"
49+
#include "HeatedbedManager.h"
50+
#include "FanManager.h"
4951
#endif
5052

5153
bool raised = false;
@@ -83,9 +85,11 @@ void action_preheat()
8385

8486
void action_cooldown()
8587
{
86-
8788
temp::TemperatureManager::single::instance().setBlowerControlState(true);
8889
temp::TemperatureManager::single::instance().setTargetTemperature(0);
90+
#if HEATER_BED_PIN > -1
91+
temp::TemperatureManager::single::instance().setBedTargetTemperature(0);
92+
#endif
8993
}
9094

9195
void action_filament_unload()
@@ -288,10 +292,34 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float
288292

289293
void action_get_plane()
290294
{
291-
292295
#if Z_MIN_PIN == -1
293296
#error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature!!! Z_MIN_PIN must point to a valid hardware pin."
294297
#endif
298+
299+
#ifdef DOGLCD
300+
#if HEATER_BED_PIN > -1
301+
if(HeatedbedManager::single::instance().detected())
302+
{
303+
temp::TemperatureManager::single::instance().setBedTargetTemperature(0);
304+
while(HeatedbedManager::single::instance().detected() && temp::TemperatureManager::single::instance().getBedCurrentTemperature() > BED_AUTOLEVEL_TEMP)
305+
{
306+
unsigned long curtime = millis();
307+
if(( millis() - curtime) > 1000 ) //Print Temp Reading every 1 second while heating up.
308+
{
309+
float tt=temp::TemperatureManager::single::instance().getCurrentTemperature();
310+
SERIAL_PROTOCOLPGM("T:");
311+
SERIAL_PROTOCOL(tt);
312+
SERIAL_PROTOCOLPGM(" E:");
313+
SERIAL_PROTOCOL((int)0);
314+
SERIAL_PROTOCOLPGM(" B:");
315+
SERIAL_PROTOCOL_F(temp::TemperatureManager::single::instance().getBedCurrentTemperature(),1);
316+
SERIAL_PROTOCOLLN("");
317+
curtime = millis();
318+
}
319+
};
320+
}
321+
#endif // HEATER_BED_PIN > -1
322+
#endif // DOGLCD
295323

296324
// Prevent user from running a G29 without first homing in X and Y
297325
if (! (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) )
@@ -626,7 +654,6 @@ void action_start_print()
626654

627655
char cmd[LONG_FILENAME_LENGTH];
628656
char* c;
629-
630657
if(PrintManager::single::instance().state() == PRINTING)
631658
{
632659
serial_printing = false;
@@ -671,6 +698,13 @@ void action_start_print()
671698
StatsManager::single::instance().increaseTotalPrints();
672699
#endif //DOGLCD
673700

701+
#ifdef FAN_BOX_PIN
702+
if(FanManager::single::instance().state() == true)
703+
{
704+
digitalWrite(FAN_BOX_PIN, HIGH);
705+
}
706+
#endif //FAN_BOX_PIN
707+
674708
enquecommand_P(PSTR("G90"));
675709
enquecommand_P(PSTR("G92 E0"));
676710
enquecommand_P(PSTR("G1 F1800")); // sets slow initial feedrate
@@ -771,6 +805,10 @@ void action_stop_print()
771805
enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
772806
}
773807
// autotempShutdown();
808+
809+
#if HEATER_BED_PIN > -1
810+
temp::TemperatureManager::single::instance().setBedTargetTemperature(0);
811+
#endif // HEATER_BED_PIN > -1
774812

775813
cancel_heatup = true;
776814

@@ -783,6 +821,13 @@ void action_stop_print()
783821
StatsManager::single::instance().updateTotalTime(printTime);
784822
#endif
785823

824+
#ifdef FAN_BOX_PIN
825+
if(FanManager::single::instance().state() == true)
826+
{
827+
digitalWrite(FAN_BOX_PIN, LOW);
828+
}
829+
#endif //FAN_BOX_PIN
830+
786831
for(int i=0; i != num_ok; i++)
787832
{
788833
SERIAL_PROTOCOLLNPGM(MSG_OK);

Marlin/HeatedbedManager.cpp

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
/// \file HeatedbedManager.cpp
3+
///
4+
/// \author Koldo Imanol de Miguel
5+
///
6+
/// \brief Management class for the state of the heated bed.
7+
///
8+
/// Copyright (c) 2016 BQ - Mundo Reader S.L.
9+
/// http://www.bq.com
10+
///
11+
/// This file is free software; you can redistribute it and/or modify
12+
/// it under the terms of either the GNU General Public License version 2 or
13+
/// later or the GNU Lesser General Public License version 2.1 or later, both
14+
/// as published by the Free Software Foundation.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19+
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22+
/// DEALINGS IN THE SOFTWARE.
23+
///////////////////////////////////////////////////////////////////////////////
24+
25+
#include "HeatedbedManager.h"
26+
27+
#include "TemperatureManager.h"
28+
#include "StorageManager.h"
29+
#include "Configuration.h"
30+
31+
HeatedbedManager::HeatedbedManager()
32+
: Subject<uint8_t>()
33+
, m_mode(0)
34+
{
35+
#if (HEATER_BED_PIN > -1) && (HBP_HEATER_AUX > -1)
36+
pinMode(HBP_HEATER_AUX, INPUT_PULLUP);
37+
m_bed_detected = !digitalRead(HBP_HEATER_AUX);
38+
39+
if(m_bed_detected)
40+
{
41+
m_mode = eeprom::StorageManager::single::instance().getHeatedbedMode();
42+
}
43+
else
44+
{
45+
m_mode = eeprom::HEATEDBED_OFF;
46+
}
47+
notify();
48+
#else
49+
m_bed_detected = false;
50+
m_mode = eeprom::HEATEDBED_OFF;
51+
#endif
52+
}
53+
54+
void HeatedbedManager::toggleMode()
55+
{
56+
HeatedbedManager::single::instance().mode();
57+
}
58+
59+
uint8_t HeatedbedManager::getMode()
60+
{
61+
#if HBP_HEATER_AUX > -1
62+
if(detected())
63+
{
64+
return m_mode;
65+
}
66+
#endif
67+
68+
return eeprom::HEATEDBED_OFF;
69+
}
70+
71+
bool HeatedbedManager::detected()
72+
{
73+
return m_bed_detected;
74+
}
75+
76+
void HeatedbedManager::disableHeatedbed()
77+
{
78+
m_bed_detected = false;
79+
m_mode = eeprom::HEATEDBED_OFF;
80+
temp::TemperatureManager::single::instance().configureSetup();
81+
notify();
82+
}
83+
84+
void HeatedbedManager::notify()
85+
{
86+
if (this->m_observer != 0)
87+
{
88+
this->m_observer->update(m_mode);
89+
}
90+
}
91+
92+
void HeatedbedManager::mode(uint8_t mode)
93+
{
94+
if(m_bed_detected)
95+
{
96+
m_mode = mode;
97+
eeprom::StorageManager::single::instance().setHeatedbedMode(m_mode);
98+
notify();
99+
}
100+
}
101+
102+
uint8_t HeatedbedManager::mode()
103+
{
104+
if(m_bed_detected)
105+
{
106+
uint8_t const num_modes = 3;
107+
108+
mode((m_mode+1) % num_modes);
109+
}
110+
return m_mode;
111+
}

Marlin/HeatedbedManager.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
/// \file HeatedbedManager.h
3+
///
4+
/// \author Koldo Imanol de Miguel
5+
///
6+
/// \brief Management class for the state of the heated bed.
7+
///
8+
/// Copyright (c) 2016 BQ - Mundo Reader S.L.
9+
/// http://www.bq.com
10+
///
11+
/// This file is free software; you can redistribute it and/or modify
12+
/// it under the terms of either the GNU General Public License version 2 or
13+
/// later or the GNU Lesser General Public License version 2.1 or later, both
14+
/// as published by the Free Software Foundation.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19+
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22+
/// DEALINGS IN THE SOFTWARE.
23+
///////////////////////////////////////////////////////////////////////////////
24+
25+
#ifndef HEATEDBED_MANAGER
26+
#define HEATEDBED_MANAGER
27+
28+
#include "Singleton.h"
29+
#include "Subject.h"
30+
31+
#include <stdint.h>
32+
33+
class HeatedbedManager : public Subject<uint8_t>
34+
{
35+
public:
36+
typedef Singleton<HeatedbedManager> single;
37+
38+
public:
39+
HeatedbedManager();
40+
41+
static void toggleMode();
42+
uint8_t getMode();
43+
44+
bool detected();
45+
void disableHeatedbed();
46+
47+
void notify();
48+
49+
private:
50+
void mode(uint8_t mode);
51+
uint8_t mode();
52+
53+
private:
54+
bool m_bed_detected;
55+
uint8_t m_mode;
56+
};
57+
58+
#endif // HEATEDBED_MANAGER

Marlin/Language.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,4 @@ TR(SCREEN_NAME_ERROR_TEXT)
229229
TR(SCREEN_BASE_ERROR_TEXT)
230230
TR(SCREEN_PTFE_TITLE)
231231
TR(SCREEN_PTFE_TEXT)
232+
TR(OPTION_HEATED_BED)

Marlin/Language.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ enum class Label
296296
SCREEN_BASE_ERROR_TEXT,
297297
SCREEN_PTFE_TITLE,
298298
SCREEN_PTFE_TEXT,
299+
OPTION_HEATED_BED,
299300
};
300301

301302
extern const char * MSG_SCREEN_EMERGENCY_TITLE();
@@ -497,5 +498,6 @@ extern const char * MSG_SCREEN_NAME_ERROR_TEXT();
497498
extern const char * MSG_SCREEN_BASE_ERROR_TEXT();
498499
extern const char * MSG_SCREEN_PTFE_TITLE();
499500
extern const char * MSG_SCREEN_PTFE_TEXT();
501+
extern const char * MSG_OPTION_HEATED_BED();
500502

501503
#endif // ifndef LANGUAGE_H

Marlin/Makefile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ else ifeq ($(MACHINE_MODEL), Hephestos)
170170
VPATHTEMP += config/hephestos
171171
else ifeq ($(MACHINE_MODEL), Hephestos XL)
172172
VPATHTEMP += config/hephestos_xl
173+
else ifeq ($(MACHINE_MODEL), Hephestos ZUM)
174+
VPATHTEMP += config/hephestos_zum
175+
else ifeq ($(MACHINE_MODEL), Hephestos ZUM XL)
176+
VPATHTEMP += config/hephestos_zum_xl
177+
else ifeq ($(MACHINE_MODEL), Hephestos ZUM Heated Bed)
178+
VPATHTEMP += config/hephestos_zum_heated_bed
173179
else ifeq ($(MACHINE_MODEL), Witbox 2)
174180
VPATHTEMP += config/witbox_2
175181
else ifeq ($(MACHINE_MODEL), Hephestos 2)
@@ -221,7 +227,7 @@ ifeq ($(HARDWARE_DISPLAY), Graphic)
221227
CXXSRC += GuiManager.cpp \
222228
StepperClass.cpp Language.cpp
223229
CXXSRC += LightManager.cpp PrintManager.cpp SDManager.cpp SerialManager.cpp SteppersManager.cpp FanManager.cpp \
224-
TemperatureControl.cpp StatsManager.cpp
230+
TemperatureControl.cpp StatsManager.cpp HeatedbedManager.cpp
225231
include ui/ui.mk
226232
VPATHTEMP += ui
227233
endif
@@ -236,7 +242,6 @@ CXXSRC += Action.cpp GuiAction.cpp AutoLevelManager.cpp OffsetManager.cpp Storag
236242

237243
CXXSRC += Marlin_main.cpp MarlinSerial.cpp SDCache.cpp
238244

239-
240245
# Define all object files.
241246
OBJ = ${patsubst %.c,$(BUILD_DIR)/%.o,${CSRC}}
242247
OBJ += ${patsubst %.cpp,$(BUILD_DIR)/%.o,${CXXSRC}}
@@ -427,6 +432,25 @@ hephestos_xl:
427432
$(L) $(COPY) config$(PATHSEP)hephestos_xl$(PATHSEP)Makefile .config_mach
428433
$(L) $(COPY) language$(PATHSEP)en$(PATHSEP)Makefile .config_lang
429434

435+
# 1st Generation printers with new board
436+
hephestos_zum:
437+
$(L) $(ECHO) Configurating for $@ printer...
438+
$(L) $(ECHO) Language selected: English [EN] \(by default\)
439+
$(L) $(COPY) config$(PATHSEP)hephestos_zum$(PATHSEP)Makefile .config_mach
440+
$(L) $(COPY) language$(PATHSEP)en$(PATHSEP)Makefile .config_lang
441+
442+
hephestos_zum_xl:
443+
$(L) $(ECHO) Configurating for $@ printer...
444+
$(L) $(ECHO) Language selected: English [EN] \(by default\)
445+
$(L) $(COPY) config$(PATHSEP)hephestos_zum_xl$(PATHSEP)Makefile .config_mach
446+
$(L) $(COPY) language$(PATHSEP)en$(PATHSEP)Makefile .config_lang
447+
448+
hephestos_zum_heated_bed:
449+
$(L) $(ECHO) Configurating for $@ printer...
450+
$(L) $(ECHO) Language selected: English [EN] \(by default\)
451+
$(L) $(COPY) config$(PATHSEP)hephestos_zum_heated_bed$(PATHSEP)Makefile .config_mach
452+
$(L) $(COPY) language$(PATHSEP)en$(PATHSEP)Makefile .config_lang
453+
430454
# 2nd Generation printers
431455
witbox_2:
432456
$(L) $(ECHO) Configurating for $@ printer...

Marlin/Marlin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,6 @@ extern void calculate_volumetric_multipliers();
327327
void filrunout();
328328
#endif // FILAMENT_RUNOUT_SENSOR
329329

330+
extern bool long_command;
331+
330332
#endif

0 commit comments

Comments
 (0)