Skip to content

Commit 149e521

Browse files
committed
add sv06p
1 parent 06b1f85 commit 149e521

21 files changed

Lines changed: 3792 additions & 18 deletions

File tree

Marlin/src/MarlinCore.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
#include "lcd/e3v2/proui/dwin.h"
8282
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
8383
#include "lcd/e3v2/jyersui/dwin.h"
84+
#elif ENABLED(RTS_AVAILABLE)
85+
#include "lcd/sv06p/LCD_RTS.h"
8486
#endif
8587
#endif
8688

@@ -815,7 +817,13 @@ void idle(const bool no_stepper_sleep/*=false*/) {
815817
TERN_(HAS_BEEPER, buzzer.tick());
816818

817819
// Handle UI input / draw events
818-
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
820+
#if ENABLED(DWIN_CREALITY_LCD)
821+
DWIN_Update();
822+
#elif ENABLED(RTS_AVAILABLE)
823+
RTSUpdate();
824+
#else
825+
ui.update();
826+
#endif
819827

820828
// Run i2c Position Encoders
821829
#if ENABLED(I2C_POSITION_ENCODERS)
@@ -1143,6 +1151,12 @@ void setup() {
11431151
millis_t serial_connect_timeout = millis() + 1000UL;
11441152
while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
11451153

1154+
#if ENABLED(RTS_AVAILABLE)
1155+
LCD_SERIAL.begin(BAUDRATE);
1156+
serial_connect_timeout = millis() + 1000UL;
1157+
while (!LCD_SERIAL.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
1158+
#endif
1159+
11461160
#if HAS_MULTI_SERIAL && !HAS_ETHERNET
11471161
#ifndef BAUDRATE_2
11481162
#define BAUDRATE_2 BAUDRATE
@@ -1294,8 +1308,11 @@ void setup() {
12941308

12951309
// UI must be initialized before EEPROM
12961310
// (because EEPROM code calls the UI).
1297-
1298-
SETUP_RUN(ui.init());
1311+
#if ENABLED(RTS_AVAILABLE)
1312+
SETUP_RUN(RTSUpdate());
1313+
#else
1314+
SETUP_RUN(ui.init());
1315+
#endif
12991316

13001317
#if PIN_EXISTS(SAFE_POWER)
13011318
#if HAS_DRIVER_SAFE_POWER_PROTECT
@@ -1575,6 +1592,8 @@ void setup() {
15751592

15761593
#if HAS_DWIN_E3V2_BASIC
15771594
SETUP_RUN(DWIN_InitScreen());
1595+
#elif ENABLED(RTS_AVAILABLE)
1596+
SETUP_RUN(rtscheck.RTS_Init());
15781597
#endif
15791598

15801599
#if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC

Marlin/src/feature/pause.cpp

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
#include "../lcd/extui/ui_api.h"
6363
#elif ENABLED(DWIN_LCD_PROUI)
6464
#include "../lcd/e3v2/proui/dwin.h"
65+
#elif ENABLED(RTS_AVAILABLE)
66+
#include "../lcd/sv06p/LCD_RTS.h"
6567
#endif
6668

6769
#include "../lcd/marlinui.h"
@@ -147,7 +149,18 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
147149
#endif
148150

149151
ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); UNUSED(mode);
150-
152+
#if ENABLED(RTS_AVAILABLE)
153+
if(Mode_flag)
154+
{
155+
rtscheck.RTS_SndData(ExchangePageBase + 7, ExchangepageAddr);
156+
}
157+
else
158+
{
159+
rtscheck.RTS_SndData(ExchangePageBase + 62, ExchangepageAddr);
160+
}
161+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
162+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
163+
#endif
151164
if (wait) return thermalManager.wait_for_hotend(active_extruder);
152165

153166
// Allow interruption by Emergency Parser M108
@@ -275,6 +288,19 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
275288
// "Wait for filament purge"
276289
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
277290

291+
#if ENABLED(RTS_AVAILABLE)
292+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
293+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
294+
if(Mode_flag)
295+
{
296+
rtscheck.RTS_SndData(ExchangePageBase + 43, ExchangepageAddr);
297+
}
298+
else
299+
{
300+
rtscheck.RTS_SndData(ExchangePageBase + 98, ExchangepageAddr);
301+
}
302+
#endif
303+
278304
// Extrude filament to get into hotend
279305
unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
280306
}
@@ -290,6 +316,16 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
290316
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
291317
#else
292318
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
319+
#if ENABLED(RTS_AVAILABLE)
320+
if(Mode_flag)
321+
{
322+
rtscheck.RTS_SndData(ExchangePageBase + 44, ExchangepageAddr);
323+
}
324+
else
325+
{
326+
rtscheck.RTS_SndData(ExchangePageBase + 100, ExchangepageAddr);
327+
}
328+
#endif
293329
#endif
294330
while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
295331
}
@@ -352,6 +388,19 @@ bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
352388
}
353389

354390
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_UNLOAD, mode);
391+
392+
#if ENABLED(RTS_AVAILABLE)
393+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
394+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
395+
if(Mode_flag)
396+
{
397+
rtscheck.RTS_SndData(ExchangePageBase + 16, ExchangepageAddr);
398+
}
399+
else
400+
{
401+
rtscheck.RTS_SndData(ExchangePageBase + 71, ExchangepageAddr);
402+
}
403+
#endif
355404

356405
// Retract filament
357406
unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
@@ -503,6 +552,19 @@ void show_continue_prompt(const bool is_reload) {
503552
DEBUG_ECHOLNPGM("... is_reload:", is_reload);
504553

505554
ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING);
555+
#if ENABLED(RTS_AVAILABLE)
556+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
557+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
558+
if(Mode_flag)
559+
{
560+
rtscheck.RTS_SndData(ExchangePageBase + 17, ExchangepageAddr);
561+
}
562+
else
563+
{
564+
rtscheck.RTS_SndData(ExchangePageBase + 72, ExchangepageAddr);
565+
}
566+
rtscheck.RTS_SndData(Beep, SoundAddr);
567+
#endif
506568
SERIAL_ECHO_START();
507569
SERIAL_ECHOF(is_reload ? F(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : F(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n"));
508570
}
@@ -544,6 +606,18 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
544606
// re-heat the nozzle, re-show the continue prompt, restart idle timers, start over
545607
if (nozzle_timed_out) {
546608
ui.pause_show_message(PAUSE_MESSAGE_HEAT);
609+
#if ENABLED(RTS_AVAILABLE)
610+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
611+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
612+
if(Mode_flag)
613+
{
614+
rtscheck.RTS_SndData(ExchangePageBase + 45, ExchangepageAddr);
615+
}
616+
else
617+
{
618+
rtscheck.RTS_SndData(ExchangePageBase + 99, ExchangepageAddr);
619+
}
620+
#endif
547621
SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
548622

549623
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
@@ -687,6 +761,26 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
687761
planner.set_e_position_mm((destination.e = current_position.e = resume_position.e));
688762

689763
ui.pause_show_message(PAUSE_MESSAGE_STATUS);
764+
#if ENABLED(RTS_AVAILABLE)
765+
if(Mode_flag && pause_flag == 0)
766+
{
767+
rtscheck.RTS_SndData(1, Time_VP);
768+
rtscheck.RTS_SndData(ExchangePageBase + 11, ExchangepageAddr);
769+
}
770+
else if(!Mode_flag && !pause_flag == 0)
771+
{
772+
rtscheck.RTS_SndData(1, Time1_VP);
773+
rtscheck.RTS_SndData(ExchangePageBase + 66, ExchangepageAddr);
774+
}
775+
else if(Mode_flag && pause_flag == 1)
776+
{
777+
rtscheck.RTS_SndData(ExchangePageBase + 12, ExchangepageAddr);
778+
}
779+
else if(!Mode_flag && pause_flag == 1)
780+
{
781+
rtscheck.RTS_SndData(ExchangePageBase + 67, ExchangepageAddr);
782+
}
783+
#endif
690784

691785
#ifdef ACTION_ON_RESUMED
692786
hostui.resumed();

Marlin/src/feature/powerloss.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0
6262
#include "../module/probe.h"
6363
#endif
6464

65+
#if ENABLED(RTS_AVAILABLE)
66+
#include "../lcd/sv06p/LCD_RTS.h"
67+
#endif
68+
6569
#if ENABLED(FWRETRACT)
6670
#include "fwretract.h"
6771
#endif
@@ -608,6 +612,20 @@ void PrintJobRecovery::resume() {
608612
PROCESS_SUBCOMMANDS_NOW(cmd);
609613
sprintf_P(cmd, PSTR("M24S%ldT%ld"), resume_sdpos, info.print_job_elapsed);
610614
PROCESS_SUBCOMMANDS_NOW(cmd);
615+
616+
#if ENABLED(RTS_AVAILABLE)
617+
if(Mode_flag && PrintFlag != 0)
618+
{
619+
rtscheck.RTS_SndData(1, Time_VP);
620+
rtscheck.RTS_SndData(ExchangePageBase + 11, ExchangepageAddr);
621+
}
622+
else if(!Mode_flag && PrintFlag != 0)
623+
{
624+
rtscheck.RTS_SndData(1, Time1_VP);
625+
rtscheck.RTS_SndData(ExchangePageBase + 66, ExchangepageAddr);
626+
}
627+
StartPrintFlag = 0;
628+
#endif
611629
}
612630

613631
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)

Marlin/src/feature/tmc_util.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include "../libs/duration_t.h"
3333
#include "../gcode/gcode.h"
3434

35+
#if ENABLED(RTS_AVAILABLE)
36+
#include "../lcd/sv06p/LCD_RTS.h"
37+
#endif
38+
3539
#if ENABLED(TMC_DEBUG)
3640
#include "../libs/hex_print.h"
3741
#if ENABLED(MONITOR_DRIVER_STATUS)
@@ -207,6 +211,16 @@
207211
if (data.is_ot) SERIAL_ECHOLNPGM("overtemperature");
208212
if (data.is_s2g) SERIAL_ECHOLNPGM("coil short circuit");
209213
TERN_(TMC_DEBUG, tmc_report_all());
214+
#if ENABLED(RTS_AVAILABLE)
215+
if(Mode_flag)
216+
{
217+
rtscheck.RTS_SndData(ExchangePageBase + 112, ExchangepageAddr);
218+
}
219+
else
220+
{
221+
rtscheck.RTS_SndData(ExchangePageBase + 118, ExchangepageAddr);
222+
}
223+
#endif
210224
kill(F("Driver error"));
211225
}
212226
#endif

Marlin/src/gcode/bedlevel/abl/G29.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include "../../../module/motion.h"
3434
#include "../../../module/planner.h"
3535
#include "../../../module/probe.h"
36+
//#include "../../../module/settings.h"
37+
#include "../../../module/temperature.h"
3638
#include "../../queue.h"
3739

3840
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
@@ -50,6 +52,8 @@
5052
#include "../../../lcd/e3v2/creality/dwin.h"
5153
#elif ENABLED(DWIN_LCD_PROUI)
5254
#include "../../../lcd/e3v2/proui/dwin.h"
55+
#elif ENABLED(RTS_AVAILABLE)
56+
#include "../../../lcd/sv06p/LCD_RTS.h"
5357
#endif
5458

5559
#if HAS_MULTI_HOTEND
@@ -435,6 +439,26 @@ G29_TYPE GcodeSuite::G29() {
435439
remember_feedrate_scaling_off();
436440

437441
#if ENABLED(PREHEAT_BEFORE_LEVELING)
442+
#if ENABLED(RTS_AVAILABLE)
443+
if(Mode_flag)
444+
{
445+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
446+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
447+
rtscheck.RTS_SndData(thermalManager.temp_bed.celsius, BED_CURRENT_TEMP_VP);
448+
rtscheck.RTS_SndData(thermalManager.temp_bed.target, BED_SET_TEMP_VP);
449+
rtscheck.RTS_SndData(1, Wait_VP);
450+
rtscheck.RTS_SndData(ExchangePageBase + 123, ExchangepageAddr);
451+
}
452+
else
453+
{
454+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].celsius, HEAD0_CURRENT_TEMP_VP);
455+
rtscheck.RTS_SndData(thermalManager.temp_hotend[0].target, HEAD0_SET_TEMP_VP);
456+
rtscheck.RTS_SndData(thermalManager.temp_bed.celsius, BED_CURRENT_TEMP_VP);
457+
rtscheck.RTS_SndData(thermalManager.temp_bed.target, BED_SET_TEMP_VP);
458+
rtscheck.RTS_SndData(1, Wait_VP);
459+
rtscheck.RTS_SndData(ExchangePageBase + 124, ExchangepageAddr);
460+
}
461+
#endif
438462
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
439463
#if BOTH(DWIN_LCD_PROUI, HAS_HEATED_BED)
440464
HMI_data.BedLevT
@@ -715,6 +739,21 @@ G29_TYPE GcodeSuite::G29() {
715739
const float z = abl.measured_z + abl.Z_offset;
716740
abl.z_values[abl.meshCount.x][abl.meshCount.y] = z;
717741
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, z));
742+
#if ENABLED(RTS_AVAILABLE)
743+
if((pt_index) <= GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y)
744+
{
745+
rtscheck.RTS_SndData(pt_index, AUTO_BED_LEVEL_ICON_VP);
746+
}
747+
rtscheck.RTS_SndData(z*100, AUTO_BED_LEVEL_1POINT_VP + (pt_index - 1) * 2);
748+
if(Mode_flag)
749+
{
750+
rtscheck.RTS_SndData(ExchangePageBase + 38, ExchangepageAddr);
751+
}
752+
else
753+
{
754+
rtscheck.RTS_SndData(ExchangePageBase + 93, ExchangepageAddr);
755+
}
756+
#endif
718757

719758
#endif
720759

@@ -933,6 +972,10 @@ G29_TYPE GcodeSuite::G29() {
933972
process_subcommands_now(F(Z_PROBE_END_SCRIPT));
934973
#endif
935974

975+
#if ENABLED(RTS_AVAILABLE)
976+
RTS_AutoBedLevelPage();
977+
#endif
978+
936979
probe.use_probing_tool(false);
937980

938981
report_current_position();

Marlin/src/gcode/calibrate/G28.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
#include "../../lcd/e3v2/creality/dwin.h"
5959
#elif ENABLED(DWIN_LCD_PROUI)
6060
#include "../../lcd/e3v2/proui/dwin.h"
61+
#elif ENABLED(RTS_AVAILABLE)
62+
#include "../../lcd/sv06p/LCD_RTS.h"
6163
#endif
6264

6365
#if ENABLED(LASER_FEATURE)
@@ -650,6 +652,7 @@ void GcodeSuite::G28() {
650652
ui.refresh();
651653

652654
TERN_(HAS_DWIN_E3V2_BASIC, DWIN_HomingDone());
655+
TERN_(RTS_AVAILABLE, RTS_MoveAxisHoming());
653656
TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone());
654657

655658
report_current_position();

Marlin/src/gcode/feature/pause/G27.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#include "../../gcode.h"
2828
#include "../../../libs/nozzle.h"
2929
#include "../../../module/motion.h"
30+
#if ENABLED(RTS_AVAILABLE)
31+
#include "../../../lcd/sv06p/LCD_RTS.h"
32+
#endif
3033

3134
/**
3235
* G27: Park the nozzle
@@ -35,6 +38,7 @@ void GcodeSuite::G27() {
3538
// Don't allow nozzle parking without homing first
3639
if (homing_needed_error()) return;
3740
nozzle.park(parser.ushortval('P'));
41+
TERN_(RTS_AVAILABLE, RTS_MoveAxisHoming());
3842
}
3943

4044
#endif // NOZZLE_PARK_FEATURE

0 commit comments

Comments
 (0)