Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2.0.x #3

Merged
merged 23 commits into from
Apr 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4961d8a
Update G28.cpp (#13539)
InsanityAutomation Apr 1, 2019
5de7b5b
Games, for fun (and stress-testing) (#13464)
thinkyhead Apr 1, 2019
9dd4252
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
Bob-the-Kuhn Apr 13, 2019
57aaa91
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
Bob-the-Kuhn Apr 14, 2019
520585c
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
Bob-the-Kuhn Apr 17, 2019
04ae3ba
Major update to French language (#13784)
tpruvot Apr 22, 2019
0c4d3e6
Improve M906 description
thinkyhead Apr 22, 2019
6ff81a3
Provide JSON values for SOFT_PWM_SCALE
thinkyhead Apr 22, 2019
ca7f6ff
Fix MSG_En messages for consistency (#13788)
marcio-ao Apr 23, 2019
d77ef43
Fix warning for redefined DEBUG_PRINT_P (#13789)
GMagician Apr 23, 2019
0f9c49c
Update Italian language (#13790)
GMagician Apr 23, 2019
e2dd226
Add a Z raise-between-probes to G34 (#13791)
GMagician Apr 23, 2019
c663292
Force no move on IDEX full control mode (#13797)
InsanityAutomation Apr 23, 2019
63f6ad3
Basic RAMPS SD_DETECT_PIN override
thinkyhead Apr 21, 2019
5051909
Update do_select_screen for general use (#13800)
thinkyhead Apr 24, 2019
73726d5
Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marl…
Bob-the-Kuhn Apr 25, 2019
503905c
bring my copy up to date
Bob-the-Kuhn Apr 25, 2019
db89fc0
Revert "bring my copy up to date"
Bob-the-Kuhn Apr 25, 2019
610fb46
Fix some ExtUI issues (#13799)
InsanityAutomation Apr 26, 2019
ed9eaa1
Fix a comment in fwretract.cpp (#13802)
chai-md Apr 26, 2019
b6279ab
Better THERMAL_PROTECTION_GRACE_PERIOD
thinkyhead Apr 27, 2019
9ccbd38
Update Watchdog description
thinkyhead Apr 27, 2019
e43afb1
Clean up SKR pins
thinkyhead Apr 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,7 @@
// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
// However, control resolution will be halved for each increment;
// at zero value, there are 128 effective control positions.
// :[0,1,2,3,4,5,6,7]
#define SOFT_PWM_SCALE 0

// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can
Expand Down
20 changes: 14 additions & 6 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -995,18 +995,26 @@
//#define MARLIN_INVADERS
//#define MARLIN_SNAKE

// Frivolous Game Options
//#define MARLIN_BRICKOUT
//#define MARLIN_INVADERS
//#define MARLIN_SNAKE

#endif // HAS_GRAPHICAL_LCD

// @section safety

// The hardware watchdog should reset the microcontroller disabling all outputs,
// in case the firmware gets stuck and doesn't do temperature regulation.
/**
* The watchdog hardware timer will do a reset and disable all outputs
* if the firmware gets too overloaded to read the temperature sensors.
*
* If you find that watchdog reboot causes your AVR board to hang forever,
* enable WATCHDOG_RESET_MANUAL to use a custom timer instead of WDTO.
* NOTE: This method is less reliable as it can only catch hangups while
* interrupts are enabled.
*/
#define USE_WATCHDOG

#if ENABLED(USE_WATCHDOG)
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
//#define WATCHDOG_RESET_MANUAL
#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void watchdog_init() {
#define WDTO_NS WDTO_4S
#endif
#if ENABLED(WATCHDOG_RESET_MANUAL)
// We enable the watchdog timer, but only for the interrupt.
// Enable the watchdog timer, but only for the interrupt.
// Take care, as this requires the correct order of operation, with interrupts disabled.
// See the datasheet of any AVR chip for details.
wdt_reset();
Expand All @@ -65,7 +65,7 @@ void watchdog_init() {
SERIAL_ERROR_MSG(MSG_WATCHDOG_FIRED);
minkill(); // interrupt-safe final kill and infinite loop
}
#endif // WATCHDOG_RESET_MANUAL
#endif

#endif // USE_WATCHDOG
#endif // __AVR__
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
#define HAL_ADC_READY() FilteredADC::finished_conversion()

// A grace period for the ADC readings to stabilize before they start causing thermal protection errors.
#define THERMAL_PROTECTION_GRACE_PERIOD 500
#define THERMAL_PROTECTION_GRACE_PERIOD 800

// Parse a G-code word into a pin index
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/debug_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
// (or not) in a given .cpp file
//

#undef DEBUG_PRINT_P
#undef DEBUG_ECHO_START
#undef DEBUG_ERROR_START
#undef DEBUG_CHAR
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@
#define MSG_LCD_N3 " 4"
#define MSG_LCD_N4 " 5"
#define MSG_LCD_N5 " 6"
#define MSG_E0 "E0"
#define MSG_E1 "E1"
#define MSG_E2 "E2"
#define MSG_E3 "E3"
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/feature/bedlevel/abl/abl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extensible_ui/ui_api.h"
#endif

int bilinear_grid_spacing[2], bilinear_start[2];
float bilinear_grid_factor[2],
z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/feature/bedlevel/bedlevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../core/debug_out.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extensible_ui/ui_api.h"
#endif

bool leveling_is_valid() {
return
#if ENABLED(MESH_BED_LEVELING)
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/feature/fwretract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void FWRetract::retract(const bool retracting

// Prevent two swap-retract or recovers in a row
#if EXTRUDERS > 1
// Allow G10 S1 only after G10
// Allow G10 S1 only after G11
if (swapping && retracted_swap[active_extruder] == retracting) return;
// G11 priority to recover the long retract if activated
if (!retracting) swapping = retracted_swap[active_extruder];
Expand All @@ -114,8 +114,8 @@ void FWRetract::retract(const bool retracting
/* // debugging
SERIAL_ECHOLNPAIR(
"retracting ", retracting,
"swapping ", swapping
"active extruder ", active_extruder
" swapping ", swapping,
" active extruder ", active_extruder
);
for (uint8_t i = 0; i < EXTRUDERS; ++i) {
SERIAL_ECHOLNPAIR("retracted[", i, "] ", retracted[i]);
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,9 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
// Resume the print job timer if it was running
if (print_job_timer.isPaused()) print_job_timer.start();

ui.reset_status();
#if HAS_LCD_MENU
ui.return_to_status();
#endif
}

#endif // ADVANCED_PAUSE_FEATURE
13 changes: 9 additions & 4 deletions Marlin/src/gcode/bedlevel/M420.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include "../../module/configuration_store.h"
#endif

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extensible_ui/ui_api.h"
#endif

//#define M420_C_USE_MEAN

/**
Expand Down Expand Up @@ -175,14 +179,15 @@ void GcodeSuite::M420() {
set_bed_leveling_enabled(false);
// Subtract the mean from all values
for (uint8_t x = GRID_MAX_POINTS_X; x--;)
for (uint8_t y = GRID_MAX_POINTS_Y; y--;)
for (uint8_t y = GRID_MAX_POINTS_Y; y--;) {
Z_VALUES(x, y) -= zmean;
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y));
#endif
}
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
bed_level_virt_interpolate();
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y));
#endif
}

#endif
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extensible_ui/ui_api.h"
#endif

#if ABL_GRID
#if ENABLED(PROBE_Y_FIRST)
#define PR_OUTER_VAR xCount
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/bedlevel/abl/M421.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include "../../gcode.h"
#include "../../../feature/bedlevel/abl/abl.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extensible_ui/ui_api.h"
#endif

/**
* M421: Set a single Mesh Bed Leveling Z coordinate
*
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/gcode/calibrate/G34_M422.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ void GcodeSuite::G34() {
extruder_duplication_enabled = false;
#endif

// Before moving other axes raise Z, if needed. Never lower Z.
if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Raise Z (before moving to probe pos) to ", Z_CLEARANCE_BETWEEN_PROBES);
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
}

// Remember corrections to determine errors on each iteration
float last_z_align_move[Z_STEPPER_COUNT] = ARRAY_N(Z_STEPPER_COUNT, 10000.0f, 10000.0f, 10000.0f),
z_measured[Z_STEPPER_COUNT] = { 0 };
Expand Down
13 changes: 0 additions & 13 deletions Marlin/src/gcode/eeprom/M500-M504.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,25 @@
#include "../../core/serial.h"
#include "../../inc/MarlinConfig.h"

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extensible_ui/ui_api.h"
#endif

/**
* M500: Store settings in EEPROM
*/
void GcodeSuite::M500() {
(void)settings.save();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStoreSettings();
#endif
}

/**
* M501: Read settings from EEPROM
*/
void GcodeSuite::M501() {
(void)settings.load();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onLoadSettings();
#endif
}

/**
* M502: Revert to default settings
*/
void GcodeSuite::M502() {
(void)settings.reset();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onFactoryReset();
#endif
}

#if DISABLED(DISABLE_M503)
Expand Down
14 changes: 12 additions & 2 deletions Marlin/src/gcode/feature/trinamic/M906.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@
#include "../../../module/stepper_indirection.h"

/**
* M906: Set motor current in milliamps using axis codes X, Y, Z, E
* Report driver currents when no axis specified
* M906: Set motor current in milliamps.
*
* Parameters:
* X[current] - Set mA current for X driver(s)
* Y[current] - Set mA current for Y driver(s)
* Z[current] - Set mA current for Z driver(s)
* E[current] - Set mA current for E driver(s)
*
* I[index] - Axis sub-index (Omit or 0 for X, Y, Z; 1 for X2, Y2, Z2; 2 for Z3.)
* T[index] - Extruder index (Zero-based. Omit for E0 only.)
*
* With no parameters report driver currents.
*/
void GcodeSuite::M906() {
#define TMC_SAY_CURRENT(Q) tmc_get_current(stepper##Q)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void GcodeSuite::process_parsed_command(
case 58: G58(); break;
case 59: G59(); break;
#endif

#if ENABLED(GCODE_MOTION_MODES)
case 80: G80(); break; // G80: Reset the current motion mode
#endif
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,7 @@ void MarlinUI::draw_status_screen() {
}

void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) {
SETCURSOR(0, 0); lcd_put_u8str_P(pref);
if (string) wrap_string(1, string);
if (suff) lcd_put_u8str_P(suff);
ui.draw_select_screen_prompt(pref, string, suff);
SETCURSOR(0, LCD_HEIGHT - 1);
lcd_put_wchar(yesno ? ' ' : '['); lcd_put_u8str_P(no); lcd_put_wchar(yesno ? ' ' : ']');
SETCURSOR_RJ(utf8_strlen_P(yes) + 2, LCD_HEIGHT - 1);
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/lcd/dogm/ultralcd_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
}

void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff) {
SETCURSOR(0, 0); lcd_put_u8str_P(pref);
if (string) wrap_string(1, string);
if (suff) lcd_put_u8str_P(suff);
ui.draw_select_screen_prompt(pref, string, suff);
draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno);
draw_boxed_string(LCD_WIDTH - (utf8_strlen_P(yes) + 1), LCD_HEIGHT - 1, yes, yesno);
}
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extensible_ui/ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ namespace ExtUI {
#if HAS_MESH
bool getMeshValid() { return leveling_is_valid(); }
bed_mesh_t getMeshArray() { return Z_VALUES_ARR; }
float getMeshPoint(const uint8_t xpos, const uint8_t ypos) { return Z_VALUES(xpos,ypos); }
void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) {
if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) {
Z_VALUES(xpos, ypos) = zoff;
Expand Down Expand Up @@ -748,10 +749,15 @@ namespace ExtUI {
enqueue_and_echo_commands_P(gcode);
}

bool commandsInQueue() { return (planner.movesplanned() || commands_in_queue); }

bool isAxisPositionKnown(const axis_t axis) {
return TEST(axis_known_position, axis);
}

bool isPositionKnown() { return all_axes_known(); }
bool isMachineHomed() { return all_axes_homed(); }

PGM_P getFirmwareName_str() {
static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION;
return firmware_name;
Expand Down
5 changes: 5 additions & 0 deletions Marlin/src/lcd/extensible_ui/ui_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ namespace ExtUI {

bool isMoving();
bool isAxisPositionKnown(const axis_t);
bool isPositionKnown(); // Axis position guaranteed, steppers active since homing
bool isMachineHomed(); // Axis position most likely correct, steppers may have deactivated
bool canMove(const axis_t);
bool canMove(const extruder_t);
void enqueueCommands_P(PGM_P const);
bool commandsInQueue();

/**
* Getters and setters
Expand Down Expand Up @@ -110,8 +113,10 @@ namespace ExtUI {
bool getLevelingActive();
void setLevelingActive(const bool);
#if HAS_MESH
#include "../../feature/bedlevel/bedlevel.h"
bool getMeshValid();
bed_mesh_t getMeshArray();
float getMeshPoint(const uint8_t xpos, const uint8_t ypos);
void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval);
void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval);
#endif
Expand Down
15 changes: 15 additions & 0 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,12 +753,27 @@
#ifndef MSG_START_PRINT
#define MSG_START_PRINT _UxGT("Start print")
#endif
#ifndef MSG_BUTTON_NEXT
#define MSG_BUTTON_NEXT _UxGT("Next")
#endif
#ifndef MSG_BUTTON_INIT
#define MSG_BUTTON_INIT _UxGT("Init")
#endif
#ifndef MSG_BUTTON_STOP
#define MSG_BUTTON_STOP _UxGT("Stop")
#endif
#ifndef MSG_BUTTON_PRINT
#define MSG_BUTTON_PRINT _UxGT("Print")
#endif
#ifndef MSG_BUTTON_RESET
#define MSG_BUTTON_RESET _UxGT("Reset")
#endif
#ifndef MSG_BUTTON_CANCEL
#define MSG_BUTTON_CANCEL _UxGT("Cancel")
#endif
#ifndef MSG_BUTTON_DONE
#define MSG_BUTTON_DONE _UxGT("Done")
#endif
#ifndef MSG_PAUSE_PRINT
#define MSG_PAUSE_PRINT _UxGT("Pause print")
#endif
Expand Down
Loading