Skip to content

Commit bbb8275

Browse files
saddfoxthinkyhead
andauthored
✨ Sovol SV06 Plus Touchscreen (#25864)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
1 parent 2afc2f2 commit bbb8275

23 files changed

Lines changed: 2344 additions & 21 deletions

Marlin/Configuration.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,11 @@
32443244
//
32453245
//#define ANYCUBIC_LCD_VYPER
32463246

3247+
//
3248+
// Sovol SV-06 Resistive Touch Screen
3249+
//
3250+
//#define SOVOL_SV06_RTS
3251+
32473252
//
32483253
// 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
32493254
//

Marlin/src/MarlinCore.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
#include "lcd/e3v2/creality/dwin.h"
8080
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
8181
#include "lcd/e3v2/jyersui/dwin.h"
82+
#elif ENABLED(SOVOL_SV06_RTS)
83+
#include "lcd/sovol_rts/sovol_rts.h"
8284
#endif
8385
#endif
8486

@@ -825,7 +827,11 @@ void idle(const bool no_stepper_sleep/*=false*/) {
825827
TERN_(HAS_BEEPER, buzzer.tick());
826828

827829
// Handle UI input / draw events
828-
ui.update();
830+
#if ENABLED(SOVOL_SV06_RTS)
831+
RTS_Update();
832+
#else
833+
ui.update();
834+
#endif
829835

830836
// Run i2c Position Encoders
831837
#if ENABLED(I2C_POSITION_ENCODERS)
@@ -1162,6 +1168,12 @@ void setup() {
11621168
millis_t serial_connect_timeout = millis() + 1000UL;
11631169
while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
11641170

1171+
#if ENABLED(SOVOL_SV06_RTS)
1172+
LCD_SERIAL.begin(BAUDRATE);
1173+
serial_connect_timeout = millis() + 1000UL;
1174+
while (!LCD_SERIAL.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ }
1175+
#endif
1176+
11651177
#if HAS_MULTI_SERIAL && !HAS_ETHERNET
11661178
#ifndef BAUDRATE_2
11671179
#define BAUDRATE_2 BAUDRATE
@@ -1319,8 +1331,11 @@ void setup() {
13191331

13201332
// UI must be initialized before EEPROM
13211333
// (because EEPROM code calls the UI).
1322-
1323-
SETUP_RUN(ui.init());
1334+
#if ENABLED(SOVOL_SV06_RTS)
1335+
SETUP_RUN(RTS_Update());
1336+
#else
1337+
SETUP_RUN(ui.init());
1338+
#endif
13241339

13251340
#if PIN_EXISTS(SAFE_POWER)
13261341
#if HAS_DRIVER_SAFE_POWER_PROTECT
@@ -1609,6 +1624,8 @@ void setup() {
16091624

16101625
#if ENABLED(DWIN_CREALITY_LCD)
16111626
SETUP_RUN(dwinInitScreen());
1627+
#elif ENABLED(SOVOL_SV06_RTS)
1628+
SETUP_RUN(rts.init());
16121629
#endif
16131630

16141631
#if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)

Marlin/src/feature/pause.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262

6363
#if ENABLED(EXTENSIBLE_UI)
6464
#include "../lcd/extui/ui_api.h"
65+
#elif ENABLED(SOVOL_SV06_RTS)
66+
#include "../lcd/sovol_rts/sovol_rts.h"
6567
#endif
6668

6769
#include "../lcd/marlinui.h"
@@ -150,6 +152,11 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
150152

151153
ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode);
152154

155+
#if ENABLED(SOVOL_SV06_RTS)
156+
rts.gotoPage(ID_Cold_L, ID_Cold_D);
157+
rts.updateTempE0();
158+
#endif
159+
153160
if (wait) return thermalManager.wait_for_hotend(active_extruder);
154161

155162
// Allow interruption by Emergency Parser M108
@@ -277,6 +284,11 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
277284
// "Wait for filament purge"
278285
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
279286

287+
#if ENABLED(SOVOL_SV06_RTS)
288+
rts.updateTempE0();
289+
rts.gotoPage(ID_Purge_L, ID_Purge_D);
290+
#endif
291+
280292
// Extrude filament to get into hotend
281293
unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
282294
}
@@ -292,6 +304,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
292304
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR
293305
#else
294306
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
307+
TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_PurgeMore_L, ID_PurgeMore_D));
295308
#endif
296309
while (pause_menu_response == PAUSE_RESPONSE_WAIT_FOR) idle_no_sleep();
297310
}
@@ -355,6 +368,11 @@ bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
355368

356369
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_UNLOAD, mode);
357370

371+
#if ENABLED(SOVOL_SV06_RTS)
372+
rts.updateTempE0();
373+
rts.gotoPage(ID_Unload_L, ID_Unload_D);
374+
#endif
375+
358376
// Retract filament
359377
unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
360378

@@ -503,6 +521,11 @@ void show_continue_prompt(const bool is_reload) {
503521
DEBUG_ECHOLNPGM("... is_reload:", is_reload);
504522

505523
ui.pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING);
524+
#if ENABLED(SOVOL_SV06_RTS)
525+
rts.updateTempE0();
526+
rts.gotoPage(ID_Insert_L, ID_Insert_D);
527+
rts.sendData(Beep, SoundAddr);
528+
#endif
506529
SERIAL_ECHO_START();
507530
SERIAL_ECHO(is_reload ? F(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : F(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n"));
508531
}
@@ -544,6 +567,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
544567
// re-heat the nozzle, re-show the continue prompt, restart idle timers, start over
545568
if (nozzle_timed_out) {
546569
ui.pause_show_message(PAUSE_MESSAGE_HEAT);
570+
#if ENABLED(SOVOL_SV06_RTS)
571+
rts.updateTempE0();
572+
rts.gotoPage(ID_HeatNozzle_L, ID_HeatNozzle_D);
573+
#endif
547574
SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT));
548575

549576
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_do(PROMPT_USER_CONTINUE, GET_TEXT_F(MSG_HEATER_TIMEOUT), GET_TEXT_F(MSG_REHEAT)));
@@ -709,6 +736,12 @@ void resume_print(
709736
planner.set_e_position_mm((destination.e = current_position.e = resume_position.e));
710737

711738
ui.pause_show_message(PAUSE_MESSAGE_STATUS);
739+
#if ENABLED(SOVOL_SV06_RTS)
740+
if (pause_flag)
741+
rts.gotoPage(ID_PrintResume_L, ID_PrintResume_D);
742+
else
743+
rts.refreshTime();
744+
#endif
712745

713746
#ifdef ACTION_ON_RESUMED
714747
hostui.resumed();

Marlin/src/feature/powerloss.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0
6666
#include "../module/probe.h"
6767
#endif
6868

69+
#if ENABLED(SOVOL_SV06_RTS)
70+
#include "../lcd/sovol_rts/sovol_rts.h"
71+
#endif
72+
6973
#if ENABLED(FWRETRACT)
7074
#include "fwretract.h"
7175
#endif
@@ -584,6 +588,11 @@ void PrintJobRecovery::resume() {
584588
// Resume the SD file from the last position
585589
PROCESS_SUBCOMMANDS_NOW(MString<MAX_CMD_SIZE>(F("M23 "), info.sd_filename));
586590
PROCESS_SUBCOMMANDS_NOW(TS(F("M24S"), resume_sdpos, 'T', info.print_job_elapsed));
591+
592+
#if ENABLED(SOVOL_SV06_RTS)
593+
if (rts.print_state) rts.refreshTime();
594+
rts.start_print_flag = false;
595+
#endif
587596
}
588597

589598
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)

Marlin/src/feature/tmc_util.cpp

Lines changed: 5 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(SOVOL_SV06_RTS)
36+
#include "../lcd/sovol_rts/sovol_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,7 @@
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+
TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_DriverError_L, ID_DriverError_D));
210215
kill(F("Driver error"));
211216
}
212217
#endif

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "../../../module/motion.h"
3434
#include "../../../module/planner.h"
3535
#include "../../../module/probe.h"
36+
#include "../../../module/temperature.h"
3637
#include "../../queue.h"
3738

3839
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
@@ -51,6 +52,8 @@
5152
#include "../../../lcd/extui/ui_api.h"
5253
#elif ENABLED(DWIN_CREALITY_LCD)
5354
#include "../../../lcd/e3v2/creality/dwin.h"
55+
#elif ENABLED(SOVOL_SV06_RTS)
56+
#include "../../../lcd/sovol_rts/sovol_rts.h"
5457
#endif
5558

5659
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -438,6 +441,12 @@ G29_TYPE GcodeSuite::G29() {
438441
remember_feedrate_scaling_off();
439442

440443
#if ENABLED(PREHEAT_BEFORE_LEVELING)
444+
#if ENABLED(SOVOL_SV06_RTS)
445+
rts.updateTempE0();
446+
rts.updateTempBed();
447+
rts.sendData(1, Wait_VP);
448+
rts.gotoPage(ID_ABL_HeatWait_L, ID_ABL_HeatWait_D);
449+
#endif
441450
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
442451
TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP)
443452
);
@@ -775,6 +784,12 @@ G29_TYPE GcodeSuite::G29() {
775784
abl.z_values[abl.meshCount.x][abl.meshCount.y] = z;
776785
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, z));
777786

787+
#if ENABLED(SOVOL_SV06_RTS)
788+
if (pt_index <= GRID_MAX_POINTS) rts.sendData(pt_index, AUTO_BED_LEVEL_ICON_VP);
789+
rts.sendData(z * 100.0f, AUTO_BED_LEVEL_1POINT_VP + (pt_index - 1) * 2);
790+
rts.gotoPage(ID_ABL_Wait_L, ID_ABL_Wait_D);
791+
#endif
792+
778793
#endif
779794

780795
abl.reenable = false; // Don't re-enable after modifying the mesh
@@ -992,6 +1007,8 @@ G29_TYPE GcodeSuite::G29() {
9921007
process_subcommands_now(F(EVENT_GCODE_AFTER_G29));
9931008
#endif
9941009

1010+
TERN_(SOVOL_SV06_RTS, RTS_AutoBedLevelPage());
1011+
9951012
probe.use_probing_tool(false);
9961013

9971014
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/extui/ui_api.h"
5959
#elif ENABLED(DWIN_CREALITY_LCD)
6060
#include "../../lcd/e3v2/creality/dwin.h"
61+
#elif ENABLED(SOVOL_SV06_RTS)
62+
#include "../../lcd/sovol_rts/sovol_rts.h"
6163
#endif
6264

6365
#if ENABLED(LASER_FEATURE)
@@ -555,6 +557,7 @@ void GcodeSuite::G28() {
555557

556558
ui.refresh();
557559

560+
TERN_(SOVOL_SV06_RTS, RTS_MoveAxisHoming());
558561
TERN_(DWIN_CREALITY_LCD, dwinHomingDone());
559562
TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone());
560563

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(SOVOL_SV06_RTS)
31+
#include "../../../lcd/sovol_rts/sovol_rts.h"
32+
#endif
3033

3134
/**
3235
* G27: Park the nozzle according with the given style
@@ -42,6 +45,7 @@ void GcodeSuite::G27() {
4245
// Don't allow nozzle parking without homing first
4346
if (homing_needed_error()) return;
4447
nozzle.park(parser.ushortval('P'));
48+
TERN_(SOVOL_SV06_RTS, RTS_MoveAxisHoming());
4549
}
4650

4751
#endif // NOZZLE_PARK_FEATURE

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
#include "../../../feature/pause.h"
2929
#include "../../../module/motion.h"
3030
#include "../../../module/printcounter.h"
31+
3132
#include "../../../lcd/marlinui.h"
33+
#if ENABLED(SOVOL_SV06_RTS)
34+
#include "../../../lcd/sovol_rts/sovol_rts.h"
35+
#endif
3236

3337
#if HAS_MULTI_EXTRUDER
3438
#include "../../../module/tool_change.h"
@@ -115,6 +119,8 @@ void GcodeSuite::M600() {
115119
if (standardM600)
116120
ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
117121

122+
TERN_(SOVOL_SV06_RTS, rts.gotoPage(ID_ChangeWait_L, ID_ChangeWait_D)); //given the context it seems this likely should have been pages 6 & 61
123+
118124
// If needed, home before parking for filament change
119125
TERN_(HOME_BEFORE_FILAMENT_CHANGE, home_if_needed(true));
120126

Marlin/src/gcode/motion/G0_G1.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#include "../../module/planner.h"
3636
#endif
3737

38+
#if ENABLED(SOVOL_SV06_RTS)
39+
#include "../../lcd/sovol_rts/sovol_rts.h"
40+
#endif
41+
3842
extern xyze_pos_t destination;
3943

4044
#if ENABLED(VARIABLE_G0_FEEDRATE)
@@ -116,4 +120,6 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
116120
#else
117121
TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
118122
#endif
123+
124+
TERN_(SOVOL_SV06_RTS, RTS_PauseMoveAxisPage());
119125
}

0 commit comments

Comments
 (0)