Skip to content

Commit

Permalink
Firmware V1.5CJ
Browse files Browse the repository at this point in the history
Updated to allow PAUSE and Continue function from filament change (M600).
  • Loading branch information
wabbitguy committed Mar 6, 2023
1 parent 249a815 commit 7dd74d8
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 44 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ eSteps for extrusion, any PID tuning may have to be redone
5. Max bed temp 120C - increased temp rise time to compensate for slow heating rate as temp rises (not all will achieve high temps)
6. Default feedrates and acceleration have been increased
7. Firmware version info indicates enabled items
8. For PREPARE, filament load/unload has been automated for release 1.3

CJ = Classic Jerk
LA = Linear Advance
Expand Down
4 changes: 4 additions & 0 deletions source/Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ PGMSTR(SP_X_LBL, " X:"); PGMSTR(SP_Y_LBL, " Y:"); PGMSTR(SP_Z_LBL, " Z:"); PGMST
volatile MarlinState marlin_state = MF_INITIALIZING;
volatile HomingState homing_state = NOT_HOMING;

// Define gcodeComment - MEL_MOD malebuffy
const char * gcodeComment = "G-Code Status Area";
bool activeFilamentChange = false;// MEL_MOD flag for M600 test

// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
bool wait_for_heatup = true;

Expand Down
3 changes: 2 additions & 1 deletion source/Marlin/src/MarlinCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#include <stdio.h>
#include <stdlib.h>


extern const char * gcodeComment;// MEL_MOD malebuffy
extern bool activeFilamentChange;// MEL_MOD testing to see if in filament change
extern char pause_steps ;

void stop();
Expand Down
4 changes: 3 additions & 1 deletion source/Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

#include "../../inc/MarlinConfig.h"

#include "../../../MarlinCore.h"// MEL_MOD
#include "../gcode.h"

#include "../../module/stepper.h"
Expand Down Expand Up @@ -206,6 +206,8 @@
* Z Home to the Z endstop
*/
void GcodeSuite::G28() {

activeFilamentChange = false;// MEL_MOD any homing resets a filament change

homing_state = NOT_HOMING;

Expand Down
2 changes: 1 addition & 1 deletion source/Marlin/src/gcode/control/M108_M112_M410.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "../gcode.h"
#include "../../MarlinCore.h" // for wait_for_heatup, kill, M112_KILL_STR
#include "../../module/motion.h" // for quickstop_stepper
//#include "../../module/motion.h" // for quickstop_stepper

/**
* M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
Expand Down
3 changes: 3 additions & 0 deletions source/Marlin/src/gcode/feature/pause/M600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/

#include "../../../inc/MarlinConfig.h"
#include "../../../MarlinCore.h"// MEL_MOD


#if ENABLED(ADVANCED_PAUSE_FEATURE)

Expand Down Expand Up @@ -65,6 +67,7 @@
* Default values are used for omitted arguments.
*/
void GcodeSuite::M600() {
activeFilamentChange = true;// MEL_MOD set flag to show in filament change

#if ENABLED(MIXING_EXTRUDER)
const int8_t target_e_stepper = get_target_e_stepper_from_command();
Expand Down
18 changes: 17 additions & 1 deletion source/Marlin/src/gcode/lcd/M117.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,31 @@
*
*/


#include "../../inc/MarlinConfig.h"// MEL_MOD malebuffy
#include "../../../MarlinCore.h"// MEL_MOD malebuffy
#include "../gcode.h"
#include "../../lcd/marlinui.h"

#include <map>// MEL_MOD malebuffy
#include <string>// MEL_MOD malebuffy
#include <stack>// MEL_MOD malebuffy

/**
* M117: Set LCD Status Message
*/
void GcodeSuite::M117() {
if (parser.string_arg && parser.string_arg[0])

if (parser.string_arg && parser.string_arg[0]) {

if (parser.command_letter == 'M' && parser.codenum == 117) {// MEL_MOD malebuffy
std::string str(parser.string_arg,31);// MEL_MOD malebuffy
std::string first30Chars = str.substr(0, 30);// MEL_MOD malebuffy
gcodeComment = first30Chars.c_str();// MEL_MOD malebuffy
}
ui.set_status(parser.string_arg);
}
else
gcodeComment = "G-Code Status Area";// MEL_MOD malebuffy
ui.reset_status();
}
6 changes: 3 additions & 3 deletions source/Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "bugfix-2.0.x"
#define SHORT_BUILD_VERSION "2.0.8"
#endif

/**
Expand All @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE __DATE__
#define STRING_DISTRIBUTION_DATE "2021-04-29"
#endif

/**
Expand Down Expand Up @@ -73,7 +73,7 @@
* Define a generic printer name to be output to the LCD after booting Marlin.
*/
#ifndef MACHINE_NAME
#define MACHINE_NAME "3D Printer"
#define MACHINE_NAME "Kobra"
#endif

/**
Expand Down
66 changes: 38 additions & 28 deletions source/Marlin/src/lcd/extui/lib/anycubic_dgus/dgus_tft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ namespace Anycubic {
void DgusTFT::Startup() {
selectedfile[0] = '\0';
panel_command[0] = '\0';
gcodeComment = "G-Code Status Area";// MEL_MOD malebuffy
command_len = 0;
printer_state = AC_printer_idle;
pause_state = AC_paused_idle;
Expand Down Expand Up @@ -389,7 +390,7 @@ namespace Anycubic {

lcd_txtbox_page = 0;
if(lcd_txtbox_index) {
SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
lcd_txtbox_index = 0;
}

Expand All @@ -404,7 +405,7 @@ namespace Anycubic {

lcd_txtbox_page = 0;
if(lcd_txtbox_index) {
SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
lcd_txtbox_index = 0;
}

Expand Down Expand Up @@ -435,8 +436,8 @@ namespace Anycubic {
} break;

case AC_timer_paused: {
printer_state = AC_printer_paused;
pause_state = AC_paused_idle;
// printer_state = AC_printer_paused;
// pause_state = AC_paused_idle;
// SendtoTFTLN(AC_msg_paused);
}
break;
Expand Down Expand Up @@ -1129,6 +1130,7 @@ namespace Anycubic {
void DgusTFT::SelectFile() {
strncpy(selectedfile, panel_command + 4, command_len - 4);
selectedfile[command_len - 5] = '\0';
gcodeComment = "G-Code Status Area";// MEL_MOD malebuffy
#if ACDEBUG(AC_FILE)
SERIAL_ECHOLNPAIR_F(" Selected File: ",selectedfile);
#endif
Expand Down Expand Up @@ -1200,8 +1202,6 @@ namespace Anycubic {

temp=constrain((uint16_t)control_value, 0, BED_MAXTEMP);
setTargetTemp_celsius(temp, BED);
//sprintf(str_buf,"%u/%u",(uint16_t)thermalManager.degBed(),(uint16_t)control_value);
//SendTxtToTFT(str_buf,TXT_PRINT_BED );
}
else if(control_index==TXT_FAN_SPEED_TARGET)//fan speed
{
Expand Down Expand Up @@ -1344,15 +1344,14 @@ namespace Anycubic {

case 1: // main page, print
{

lcd_txtbox_page = 0;

if(lcd_txtbox_index) {
SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
lcd_txtbox_index = 0;
}
if (isPrinting()) {
ChangePageOfTFT(PAGE_STATUS2);// MEL MOD
ChangePageOfTFT(PAGE_STATUS2);// MEL_MOD changes to PRINT page if printing via USB
} else {
ChangePageOfTFT(PAGE_FILE);
SendFileList(0);
Expand Down Expand Up @@ -1422,7 +1421,7 @@ namespace Anycubic {
case 1: // return
{
ChangePageOfTFT(PAGE_MAIN);
SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
}
break;

Expand All @@ -1431,7 +1430,7 @@ namespace Anycubic {
if(lcd_txtbox_page > 0) {
lcd_txtbox_page--;

SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
lcd_txtbox_index = 0;

SendFileList(lcd_txtbox_page*5);
Expand All @@ -1444,7 +1443,7 @@ namespace Anycubic {
if((lcd_txtbox_page+1) * 5 < filenavigator.getFileNum()) {
lcd_txtbox_page++;

SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
lcd_txtbox_index = 0;

SendFileList(lcd_txtbox_page*5);
Expand All @@ -1463,7 +1462,7 @@ namespace Anycubic {

lcd_txtbox_page = 0;
if(lcd_txtbox_index) {
SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
lcd_txtbox_index = 0;
}

Expand All @@ -1479,7 +1478,7 @@ namespace Anycubic {

if(filenavigator.filelist.seek(lcd_txtbox_page*5+(lcd_txtbox_index-1))) {

SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));

#if ENABLED(CASE_LIGHT_ENABLE)
setCaseLightState(1);
Expand Down Expand Up @@ -1512,7 +1511,7 @@ namespace Anycubic {
SERIAL_ECHOLNPAIR("start print: ", filenavigator.filelist.longFilename());
#endif

SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0+0x30*(lcd_txtbox_index-1));

// Allows printer to restart the job if we dont want to recover
if (printer_state == AC_printer_resuming_from_power_outage) {
Expand Down Expand Up @@ -1541,7 +1540,8 @@ namespace Anycubic {
sprintf(str_buf, "%s H ", utostr3(time/60));
sprintf(str_buf+strlen(str_buf), "%s M", utostr3(time%60));
SendTxtToTFT(str_buf, TXT_PRINT_TIME);

gcodeComment = "G-Code Status Area";// MEL_MOD malebuffy
SendTxtToTFT(gcodeComment, TXT_PRINT_COMMENT);
ChangePageOfTFT(PAGE_STATUS2);
}
}
Expand Down Expand Up @@ -1577,7 +1577,7 @@ namespace Anycubic {
SendColorToTFT(COLOR_RED, TXT_DISCRIBE_0 + 0x30*(lcd_txtbox_index-1));

if(lcd_txtbox_index_last && lcd_txtbox_index_last != lcd_txtbox_index) { // 1~5
SendColorToTFT(COLOR_BLUE, TXT_DISCRIBE_0 + 0x30*(lcd_txtbox_index_last-1));
SendColorToTFT(COLOUR_WHITE, TXT_DISCRIBE_0 + 0x30*(lcd_txtbox_index_last-1));
}
lcd_txtbox_index_last = lcd_txtbox_index;
}
Expand Down Expand Up @@ -1677,6 +1677,7 @@ namespace Anycubic {
sprintf(str_buf, "%s H ", utostr3(time/60));
sprintf(str_buf+strlen(str_buf), "%s M", utostr3(time%60));
SendTxtToTFT(str_buf, TXT_PRINT_TIME);
SendTxtToTFT(gcodeComment, TXT_PRINT_COMMENT);// MEL_MOD malebuffy
}

void DgusTFT::page4_handle(void)
Expand All @@ -1701,17 +1702,25 @@ namespace Anycubic {
}
break;

case 2: // print pause (or continue)
// if(isPrintingFromMedia()) {
// pausePrint();
// printer_state = AC_printer_pausing;
// pause_state = AC_paused_idle;
// ChangePageOfTFT(PAGE_WAIT_PAUSE);
// injectCommands_P(PSTR("M108")); // stop waiting temperature M109
// } else {
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);// MEL MOD
wait_for_heatup = false;
//}
case 2: // print pause (or continue) MEL_MOD
if(isPrintingFromMedia()) {
if (activeFilamentChange == true) {
activeFilamentChange = false;// reset the flag so PAUSE works again
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);// MEL_MOD
wait_for_heatup = false;
} else {
pausePrint();
printer_state = AC_printer_pausing;
pause_state = AC_paused_idle;
ChangePageOfTFT(PAGE_WAIT_PAUSE);
}
} else {
if (activeFilamentChange == true) {
activeFilamentChange = false;// reset the flag so PAUSE works again
TERN_(HAS_RESUME_CONTINUE, wait_for_user = false);// MEL_MOD
wait_for_heatup = false;
}
}
break;

case 3: // print stop
Expand Down Expand Up @@ -1767,6 +1776,7 @@ namespace Anycubic {
sprintf(str_buf, "%s H ", utostr3(time/60));
sprintf(str_buf+strlen(str_buf), "%s M", utostr3(time%60));
SendTxtToTFT(str_buf, TXT_PRINT_TIME);
SendTxtToTFT(gcodeComment, TXT_PRINT_COMMENT);// MEL_MOD malebuffy
}

void DgusTFT::page5_handle(void) // print settings
Expand Down
24 changes: 15 additions & 9 deletions source/Marlin/src/lcd/extui/lib/anycubic_dgus/dgus_tft.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
#include "../../../../inc/MarlinConfigPre.h"
#include "../../ui_api.h"

#define DEVICE_NAME "Bullwinkle"
#define DEVICE_NAME "Rocky"
//#define FIRMWARE_VER "Marlin V2.0.8.1"
#if ENABLED(CLASSIC_JERK)
#define FIRMWARE_VER "WabbitWare 1.31CJ"
#define FIRMWARE_VER "WabbitWare 1.5CJ"
#if ENABLED(LIN_ADVANCE)
#define FIRMWARE_VER "WabbitWare 1.31LACJ"
#define FIRMWARE_VER "WabbitWare 1.5LACJ"
#else
#define FIRMWARE_VER "WabbitWare 1.31CJ"
#define FIRMWARE_VER "WabbitWare 1.5CJ"
#endif
#else
#if ENABLED(LIN_ADVANCE)
#define FIRMWARE_VER "WabbitWare 1.31LAJD"
#define FIRMWARE_VER "WabbitWare 1.5LAJD"
#else
#define FIRMWARE_VER "WabbitWare 1.31JD"
#define FIRMWARE_VER "WabbitWare 1.4JD"
#endif
#endif

Expand Down Expand Up @@ -178,6 +178,7 @@
#define TXT_PRINT_SPEED 0x2000+9*0x30
#define TXT_PRINT_TIME 0x2000+10*0x30
#define TXT_PRINT_PROGRESS 0x2000+11*0x30
#define TXT_PRINT_COMMENT 0x2000+12*0x30// MEL_MOD malebuffy

// PRINT ADJUST TXT

Expand Down Expand Up @@ -229,7 +230,9 @@
#define TXT_OUTAGE_RECOVERY_PROGRESS 0x2210
#define TXT_OUTAGE_RECOVERY_FILE 0x2180


//PREVIEW PAGE
#define TXT_BASE64 0x3020
#define TXT_VAR_IMAGE 0x7FFE

#define ADDRESS_SYSTEM_AUDIO 0x0080

Expand Down Expand Up @@ -374,8 +377,7 @@

#define COLOR_RED 0xf800
#define COLOR_BLUE 0x0210


#define COLOUR_WHITE 0xffff


namespace Anycubic {
Expand Down Expand Up @@ -517,6 +519,10 @@ namespace Anycubic {
static void ChangePageOfTFT(uint32_t page_index);
static void FakeChangePageOfTFT(uint32_t page_index);
static void LcdAudioSet(ExtUI::audio_t audio);

//PREVIEW PAGE
static void page213_handle(void);// MEL_MOD malebuffy
static void SendVarIconToTFT(const char *vdata, uint32_t address);// MEL_MOD malebuffy

private:

Expand Down
Binary file modified workspace/firmware.bin
Binary file not shown.

0 comments on commit 7dd74d8

Please sign in to comment.