Skip to content

Commit 01f72a2

Browse files
committed
Merge branch 'feature/2.1.x'
2 parents 842058a + 4e02be3 commit 01f72a2

39 files changed

+933
-61
lines changed

Documentation/Changelog.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# BQ Marlin v2.1.0
2+
---
3+
### Bugfixes:
4+
* Fixed: Printing from SD stops if USB cable is disconnected (W2/H2).
5+
* Fixed: Changing filament, inherited feedrate can produce sliding on extruder (W/H/HXL/W2/H2).
6+
* Fixed serial printing from Cura 15.04 and possibly other host systems (W/H/HXL/W2/H2).
7+
* Skip temperature animation on manual levelling when temperature is already above preheat value (W2/H2).
8+
* Fixed: Printing position can be lost after a fast filament change (W2/H2).
9+
* Auto-levelling option can now be build on 1st generation printers (W/H/HXL).
10+
* Blower is now activated when a percent of speed (M106) is selected (always 100% of speed is used though) (W2/H2).
11+
* Fixed serial printing entering in inactivity state if M800 is not used.
12+
13+
### Improvements:
14+
* Reduce printing slowdown with very short segments due to screen updates (W2/H2).
15+
* Added board serial number to M115 response over serial (W2/H2).
16+
* Reduce one check on double homing (base detection) algorithm (W2).
17+
18+
### New features:
19+
* Added an error screen when special (non supported) characters are used on file names or folders (W2/H2).
20+
* Added a new statistics screen. Now printing time and successful/cancelled printings are stored on EEPROM (W2/H2).
21+
22+
### Translations:
23+
* Italian, Russian and Portuguese fixes (W2/H2).
24+
* Minor changes on all languages (W2/H2).
25+
126
# BQ Marlin v2.0.0
227
---
328
### Under the hood:

Marlin/ConfigurationStore.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
#include "ConfigurationStore.h"
7070

7171
#include "StorageManager.h"
72+
#include "StatsManager.h"
7273

7374
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
7475
uint8_t c;
@@ -414,6 +415,7 @@ void Config_ResetDefault() {
414415

415416
#ifdef DOGLCD
416417
lcd_contrast = DEFAULT_LCD_CONTRAST;
418+
StatsManager::single::instance().loadStats();
417419
#endif
418420

419421
#ifdef PIDTEMP

Marlin/GuiAction.cpp

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
#include "LightManager.h"
4545
#include "cardreader.h"
4646

47+
#ifdef DOGLCD
48+
#include "StatsManager.h"
49+
#endif
50+
4751
bool raised = false;
4852
extern bool home_all_axis;
4953
extern bool bed_leveling;
@@ -620,17 +624,7 @@ void action_start_print()
620624
if(PrintManager::single::instance().state() == PRINTING)
621625
{
622626
serial_printing = false;
623-
624-
strcpy(cmd, card.longFilename);
625-
for (c = &cmd[0]; *c; c++)
626-
{
627-
if ((uint8_t)*c > 127)
628-
{
629-
SERIAL_ECHOLN(MSG_SD_BAD_FILENAME);
630-
return;
631-
}
632-
}
633-
627+
634628
sprintf_P(cmd, PSTR("M23 %s"), card.filename);
635629
}
636630

@@ -660,6 +654,7 @@ void action_start_print()
660654

661655
#ifdef DOGLCD
662656
PrintManager::single::instance().state(READY);
657+
StatsManager::single::instance().increaseTotalPrints();
663658
#endif //DOGLCD
664659

665660
enquecommand_P(PSTR("G90"));
@@ -763,12 +758,20 @@ void action_stop_print()
763758
PrintManager::knownPosition(true);
764759

765760
stop_buffer = false;
761+
762+
#ifdef DOGLCD
763+
Time_t printTime = PrintManager::single::instance().printingTime();
764+
StatsManager::single::instance().updateTotalTime(printTime);
765+
#endif
766766
}
767767

768768
void action_finish_print()
769769
{
770770
action_stop_print();
771771
action_cooldown();
772+
#ifdef DOGLCD
773+
StatsManager::single::instance().increaseSuccededPrints();
774+
#endif
772775
}
773776

774777
extern float target[4];
@@ -998,3 +1001,12 @@ bool action_check_auto_gcode()
9981001
}
9991002
return false;
10001003
}
1004+
1005+
bool action_check_pause_state()
1006+
{
1007+
if(PrintManager::single::instance().state() == PrinterState_t::PAUSED)
1008+
{
1009+
return true;
1010+
}
1011+
return false;
1012+
}

Marlin/GuiAction.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,6 @@ extern void action_reset_wizard();
7878

7979
extern bool action_check_auto_gcode();
8080

81-
#endif // GUI_ACTION_H
81+
extern bool action_check_pause_state();
82+
83+
#endif // GUI_ACTION_H

Marlin/Language.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,11 @@ TR(TEMP_OFF)
218218
TR(TOTAL_TIME)
219219
TR(SCREEN_PRINT_STOP_TITLE)
220220
TR(SCREEN_PRINT_STOP_TEXT)
221+
TR(SCREEN_CHANGE_WAIT_PAUSE_TITLE)
222+
TR(SCREEN_CHANGE_WAIT_PAUSE_TEXT)
223+
TR(OPTION_STATS)
224+
TR(SCREEN_VIEW_STATS_TITLE)
225+
TR(SCREEN_VIEW_STATS_TEXT1)
226+
TR(SCREEN_VIEW_STATS_TEXT2)
227+
TR(SCREEN_VIEW_STATS_TEXT3)
228+
TR(SCREEN_NAME_ERROR_TEXT)

Marlin/Language.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ enum class Label
285285
TOTAL_TIME,
286286
SCREEN_PRINT_STOP_TITLE,
287287
SCREEN_PRINT_STOP_TEXT,
288+
SCREEN_CHANGE_WAIT_PAUSE_TITLE,
289+
SCREEN_CHANGE_WAIT_PAUSE_TEXT,
290+
OPTION_STATS,
291+
SCREEN_VIEW_STATS_TITLE,
292+
SCREEN_VIEW_STATS_TEXT1,
293+
SCREEN_VIEW_STATS_TEXT2,
294+
SCREEN_VIEW_STATS_TEXT3,
295+
SCREEN_NAME_ERROR_TEXT,
288296
};
289297

290298
extern const char * MSG_SCREEN_EMERGENCY_TITLE();
@@ -475,5 +483,13 @@ extern const char * MSG_TEMP_OFF();
475483
extern const char * MSG_TOTAL_TIME();
476484
extern const char * MSG_SCREEN_PRINT_STOP_TITLE();
477485
extern const char * MSG_SCREEN_PRINT_STOP_TEXT();
486+
extern const char * MSG_SCREEN_CHANGE_WAIT_PAUSE_TITLE();
487+
extern const char * MSG_SCREEN_CHANGE_WAIT_PAUSE_TEXT();
488+
extern const char * MSG_OPTION_STATS();
489+
extern const char * MSG_SCREEN_VIEW_STATS_TITLE();
490+
extern const char * MSG_SCREEN_VIEW_STATS_TEXT1();
491+
extern const char * MSG_SCREEN_VIEW_STATS_TEXT2();
492+
extern const char * MSG_SCREEN_VIEW_STATS_TEXT3();
493+
extern const char * MSG_SCREEN_NAME_ERROR_TEXT();
478494

479495
#endif // ifndef LANGUAGE_H

Marlin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ ifeq ($(HARDWARE_DISPLAY), Graphic)
221221
CXXSRC += GuiManager.cpp \
222222
StepperClass.cpp Language.cpp
223223
CXXSRC += LightManager.cpp PrintManager.cpp SDManager.cpp SerialManager.cpp SteppersManager.cpp FanManager.cpp \
224-
TemperatureControl.cpp
224+
TemperatureControl.cpp StatsManager.cpp
225225
include ui/ui.mk
226226
VPATHTEMP += ui
227227
endif

Marlin/Marlin_main.cpp

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,16 @@ void get_command()
886886
}
887887
gcode_LastN = gcode_N;
888888
//if no errors, continue parsing
889-
890-
char *startchar = strchr(cmdbuffer[bufindw], ' ') + 1;
891-
strcpy(cmdbuffer[bufindw], startchar);
889+
890+
// Format proof parsing to remove line number
891+
char *startchar = &(cmdbuffer[bufindw][1]);
892+
while( (*startchar >= '0' && *startchar <= '9')
893+
|| (*startchar == ' '))
894+
{
895+
startchar++;
896+
}
897+
898+
strcpy(cmdbuffer[bufindw], startchar);
892899

893900
}
894901
else // if we don't receive 'N' but still see '*'
@@ -930,6 +937,11 @@ void get_command()
930937
buflen += 1;
931938

932939
serial_count = 0; //clear buffer
940+
941+
#ifdef DOGLCD
942+
//Reset inactivity timer on serial command read
943+
PrintManager::single::instance().resetInactivity();
944+
#endif // DOGLCD
933945
}
934946
else if(serial_char == '\\') { //Handle escapes
935947
SERIAL_ECHO("Escape char: ");
@@ -2466,7 +2478,14 @@ SERIAL_PROTOCOLPGM("\n\n");
24662478
case 106: //M106 Fan On
24672479
temp::TemperatureManager::single::instance().setBlowerControlState(false);
24682480
if (code_seen('S')){
2469-
fanSpeed=constrain(code_value(),0,255);
2481+
if(code_value() > 0)
2482+
{
2483+
fanSpeed=255;
2484+
}
2485+
else
2486+
{
2487+
fanSpeed=0;
2488+
}
24702489
}
24712490
else {
24722491
fanSpeed=255;

Marlin/SDCache.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,25 +238,38 @@ bool SDCache::updateCachePosition(int16_t index)
238238
}
239239

240240
CacheEntryType_t SDCache::press(uint16_t index)
241-
{
241+
{
242242
//first a check for possible update
243243
updateCachePosition(index);
244244

245+
char* c;
246+
char cmd[LONG_FILENAME_LENGTH];
247+
strcpy(cmd, window_cache_begin[m_selected_file].longFilename);
248+
249+
//check first for name validity
250+
for (c = &cmd[0]; *c; c++)
251+
{
252+
if ((uint8_t)*c > 127)
253+
{
254+
return CacheEntryType_t::INVALID_NAME;
255+
}
256+
}
257+
245258
switch(window_cache_begin[m_selected_file].type)
246259
{
247260
//cases handled outside of SDCache
248261
case FILE_ENTRY:
249262
card.getfilename(m_index-1);
250-
case BACK_ENTRY:
263+
case BACK_ENTRY:
251264
return window_cache_begin[m_selected_file].type;
252265
break;
253266

254267
//Cases handled internally
255268
case UPDIR_ENTRY:
256269
case FOLDER_ENTRY:
257-
changeDir();
258-
return CacheEntryType_t::NOACTION;
259-
break;
270+
changeDir();
271+
return CacheEntryType_t::NOACTION;
272+
break;
260273
}
261274
}
262275

Marlin/SDCache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef enum
3939
UPDIR_ENTRY,
4040
FOLDER_ENTRY,
4141
FILE_ENTRY,
42+
INVALID_NAME,
4243
} CacheEntryType_t;
4344

4445
typedef struct

0 commit comments

Comments
 (0)