Skip to content

Commit

Permalink
Merge commit 'afe4cb7fee73878917a55ccca7e67a24fea423f8' into ender3v2…
Browse files Browse the repository at this point in the history
…_bugfix

* commit 'afe4cb7fee73878917a55ccca7e67a24fea423f8':
  [cron] Bump distribution date (2021-09-12)
  🎨 Apply more HAS_DELTA_SENSORLESS_PROBING
  🐛 No probe enum for DELTA + SENSORLESS_PROBING
  🩹 Warn about user feedback requirement
  🐛 Followup to JyersUI
  🐛 Followup to E3V2 Enhanced
  🐛 Fix LPC1768 SD-based EEPROM debug
  🚸 Enhance FTDI Eve Touch UI file select dialog (MarlinFirmware#22742)
  [cron] Bump distribution date (2021-09-11)
  🩹 Fix TOUCH_UI_FTDI_EVE warnings
  🐛 Followup to JyersUI
  • Loading branch information
Michael authored and Michael committed Sep 12, 2021
2 parents db03b7a + afe4cb7 commit 28f6c5e
Show file tree
Hide file tree
Showing 35 changed files with 307 additions and 166 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 "2021-09-10"
//#define STRING_DISTRIBUTION_DATE "2021-09-12"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
42 changes: 26 additions & 16 deletions Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/**
* Marlin 3D Printer Firmware
*
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
* Copyright (c) 2015-2016 Nico Tonnhofer wurstnase.reprap@gmail.com
* Copyright (c) 2016 Victor Perez victor_pv@hotmail.com
*
* 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
Expand All @@ -20,12 +19,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

/**
* Implementation of EEPROM settings in SD Card
*/

#ifdef TARGET_LPC1768

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

#if ENABLED(SDCARD_EEPROM_EMULATION)

//#define DEBUG_SD_EEPROM_EMULATION

#include "../shared/eeprom_api.h"

#include <chanfs/diskio.h>
Expand All @@ -38,9 +44,11 @@ FATFS fat_fs;
FIL eeprom_file;
bool eeprom_file_open = false;

#define EEPROM_FILENAME "eeprom.dat"
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
#endif

size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }

bool PersistentStore::access_start() {
Expand All @@ -50,7 +58,7 @@ bool PersistentStore::access_start() {
MSC_Release_Lock();
return false;
}
FRESULT res = f_open(&eeprom_file, "eeprom.dat", FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
FRESULT res = f_open(&eeprom_file, EEPROM_FILENAME, FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
if (res) MSC_Release_Lock();

if (res == FR_OK) {
Expand Down Expand Up @@ -81,18 +89,20 @@ bool PersistentStore::access_finish() {
// This extra chit-chat goes away soon, but is helpful for now
// to see errors that are happening in read_data / write_data
static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) {
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
SERIAL_CHAR(' ');
SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOLNPGM("_data(", pos, ",", value, ",", size, ", ...)");
if (total) {
SERIAL_ECHOPGM(" f_");
#if ENABLED(DEBUG_SD_EEPROM_EMULATION)
PGM_P const rw_str = write ? PSTR("write") : PSTR("read");
SERIAL_CHAR(' ');
SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOPGM("()=", s, "\n size=", size, "\n bytes_");
SERIAL_ECHOLNPGM_P(write ? PSTR("written=") : PSTR("read="), total);
}
else
SERIAL_ECHOLNPGM(" f_lseek()=", s);
SERIAL_ECHOLNPGM("_data(", pos, ",", *value, ",", size, ", ...)");
if (total) {
SERIAL_ECHOPGM(" f_");
SERIAL_ECHOPGM_P(rw_str);
SERIAL_ECHOPGM("()=", s, "\n size=", size, "\n bytes_");
SERIAL_ECHOLNPGM_P(write ? PSTR("written=") : PSTR("read="), total);
}
else
SERIAL_ECHOLNPGM(" f_lseek()=", s);
#endif
}

// File function return codes for type FRESULT. This goes away soon, but
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/MarlinCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

#include "inc/MarlinConfig.h"

#ifdef DEBUG_GCODE_PARSER
#include "gcode/parser.h"
#endif

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/core/debug_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "debug_section.h"
#define DEBUG_SECTION(N,S,D) SectionLog N(PSTR(S),D)

#define DEBUG_ECHOPGM_P(P) SERIAL_ECHOPGM_P(P)
#define DEBUG_ECHO_START SERIAL_ECHO_START
#define DEBUG_ERROR_START SERIAL_ERROR_START
#define DEBUG_CHAR SERIAL_CHAR
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu/mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
BUZZ(200, 404);
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")));
wait_for_user_response();
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response());
BUZZ(200, 404);
BUZZ(200, 404);

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep

TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_HEATER_TIMEOUT)));

wait_for_user_response(0, true); // Wait for LCD click or M108
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(0, true)); // Wait for LCD click or M108

TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_INFO, GET_TEXT(MSG_REHEATING)));

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ void GcodeSuite::G33() {

const bool stow_after_each = parser.seen_test('E');

#if ENABLED(SENSORLESS_PROBING)
#if HAS_DELTA_SENSORLESS_PROBING
probe.test_sensitivity.x = !parser.seen_test('X');
TERN_(HAS_Y_AXIS, probe.test_sensitivity.y = !parser.seen_test('Y'));
TERN_(HAS_Z_AXIS, probe.test_sensitivity.z = !parser.seen_test('Z'));
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
*/
#pragma once

/**
* gcode.h - Temporary container for all gcode handlers
*/

/**
* -----------------
* G-Codes in Marlin
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/lcd/M0_M1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void GcodeSuite::M0_M1() {

TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR));

wait_for_user_response(ms);
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(ms));

TERN_(HAS_LCD_MENU, ui.reset_status());
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/sd/M1001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void GcodeSuite::M1001() {
printerEventLEDs.onPrintCompleted();
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE)));
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR));
wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30)));
TERN_(HAS_RESUME_CONTINUE, wait_for_user_response(SEC_TO_MS(TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30))));
printerEventLEDs.onResumeAfterWait();
}
#endif
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,10 @@
#if DISABLED(NOZZLE_AS_PROBE)
#define HAS_PROBE_XY_OFFSET 1
#endif
#if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && !BOTH(DELTA, SENSORLESS_PROBING)
#if BOTH(DELTA, SENSORLESS_PROBING)
#define HAS_DELTA_SENSORLESS_PROBING 1
#endif
#if NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, HAS_DELTA_SENSORLESS_PROBING)
#define USES_Z_MIN_PROBE_PIN 1
#endif
#if Z_HOME_TO_MIN && TERN1(USES_Z_MIN_PROBE_PIN, ENABLED(USE_PROBE_FOR_Z_HOMING))
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
#endif

#if !HAS_RESUME_CONTINUE && DISABLED(HOST_PROMPT_SUPPORT) && DISABLED(EXTENSIBLE_UI)
#warning "Your Configuration provides no method to acquire user feedback!"
#endif

/**
* Instant Freeze
*/
Expand Down
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 "2021-09-10"
#define STRING_DISTRIBUTION_DATE "2021-09-12"
#endif

/**
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/lcd/e3v2/creality/rotary_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#if ENCODER_5X_STEPS_PER_SEC
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#endif
}
EncoderRate.lastEncoderTime = ms;
}
Expand Down
Loading

0 comments on commit 28f6c5e

Please sign in to comment.