Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' of github.com:MarlinFirmware/Marlin into …
Browse files Browse the repository at this point in the history
…leo_1S_S6_btt_mini
  • Loading branch information
JaxTheWolf committed May 28, 2024
2 parents 8ca1668 + e7c9cf3 commit a890587
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-05-23"
//#define STRING_DISTRIBUTION_DATE "2024-05-27"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move
#endif

#if ENABLED(ONE_CLICK_PRINT)
case 1003: M1003(); break; // M1003: [INTERNAL] Set the current dir to /
#endif

#if ENABLED(UBL_MESH_WIZARD)
case 1004: M1004(); break; // M1004: UBL Mesh Wizard
#endif
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,10 @@ class GcodeSuite {
static void M1002();
#endif

#if ENABLED(ONE_CLICK_PRINT)
static void M1003();
#endif

#if ENABLED(UBL_MESH_WIZARD)
static void M1004();
#endif
Expand Down
36 changes: 36 additions & 0 deletions Marlin/src/gcode/sd/M1003.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

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

#if ENABLED(ONE_CLICK_PRINT)

#include "../gcode.h"
#include "../../sd/cardreader.h"

/**
* M1003: Set the current dir to /. Should come after 'M24'.
* Prevents the SD menu getting stuck in the newest file's workDir.
*/
void GcodeSuite::M1003() { card.cdroot(); }

#endif // ONE_CLICK_PRINT
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-05-23"
#define STRING_DISTRIBUTION_DATE "2024-05-27"
#endif

/**
Expand Down
13 changes: 10 additions & 3 deletions Marlin/src/lcd/menu/menu_one_click_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
#if ENABLED(ONE_CLICK_PRINT)

#include "menu.h"
#include "../../gcode/queue.h"

static void one_click_print_done() {
ui.return_to_status();
ui.reset_status();
queue.enqueue_one_now(F("M1003")); // Make sure SD card browsing doesn't break!
}

void one_click_print() {
ui.goto_screen([]{
Expand All @@ -33,9 +40,9 @@ void one_click_print() {
GET_TEXT_F(MSG_BUTTON_PRINT), GET_TEXT_F(MSG_BUTTON_CANCEL),
[]{
card.openAndPrintFile(card.filename);
ui.return_to_status();
ui.reset_status();
}, nullptr,
one_click_print_done();
},
one_click_print_done,
GET_TEXT_F(MSG_START_PRINT), filename, F("?")
);
});
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@
#define LCD_BRIGHTNESS_DEFAULT TFT_BACKLIGHT_PWM
#endif

#if ENABLED(ONBOARD_SDIO)
#if SD_CONNECTION_IS(ONBOARD)
#define ONBOARD_SDIO
#define SD_SS_PIN -1 // else SDSS set to PA4 in M43 (spi_pins.h)
#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,11 +902,11 @@ void CardReader::write_command(char * const buf) {
* Select the newest file and ask the user if they want to print it.
*/
bool CardReader::one_click_check() {
const bool found = selectNewestFile();
const bool found = selectNewestFile(); // Changes the current workDir if found
if (found) {
//SERIAL_ECHO_MSG(" OCP File: ", longest_filename(), "\n");
//ui.init();
one_click_print();
one_click_print(); // Restores workkDir to root (eventually)
}
return found;
}
Expand Down
2 changes: 1 addition & 1 deletion buildroot/tests/rambo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TE
ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \
PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \
AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE ONE_CLICK_PRINT NO_SD_AUTOSTART \
BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
PSU_CONTROL LED_POWEROFF_TIMEOUT PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \
Expand Down
2 changes: 1 addition & 1 deletion ini/features.ini
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ HAS_MENU_LED = build_src_filter=+<src/lcd/menu/menu_le
HAS_MENU_MEDIA = build_src_filter=+<src/lcd/menu/menu_media.cpp>
HAS_MENU_MIXER = build_src_filter=+<src/lcd/menu/menu_mixer.cpp>
HAS_MENU_MMU2 = build_src_filter=+<src/lcd/menu/menu_mmu2.cpp>
HAS_MENU_ONE_CLICK_PRINT = build_src_filter=+<src/lcd/menu/menu_one_click_print.cpp>
HAS_MENU_ONE_CLICK_PRINT = build_src_filter=+<src/lcd/menu/menu_one_click_print.cpp> +<src/gcode/sd/M1003.cpp>
HAS_MENU_PASSWORD = build_src_filter=+<src/lcd/menu/menu_password.cpp>
HAS_MENU_POWER_MONITOR = build_src_filter=+<src/lcd/menu/menu_power_monitor.cpp>
HAS_MENU_CUTTER = build_src_filter=+<src/lcd/menu/menu_spindle_laser.cpp>
Expand Down

0 comments on commit a890587

Please sign in to comment.