Skip to content

Commit

Permalink
Merge branch 'vanilla_fb_2.1.x' into FB4S_WIFI
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey1560 committed Jan 4, 2023
2 parents c87862d + d873618 commit a1319c7
Show file tree
Hide file tree
Showing 15 changed files with 281 additions and 244 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class mesh_bed_leveling {
static float get_z_correction(const xy_pos_t &pos) {
const xy_int8_t ind = cell_indexes(pos);
const float x1 = index_to_xpos[ind.x], x2 = index_to_xpos[ind.x+1],
y1 = index_to_xpos[ind.y], y2 = index_to_xpos[ind.y+1],
y1 = index_to_ypos[ind.y], y2 = index_to_ypos[ind.y+1],
z1 = calc_z0(pos.x, x1, z_values[ind.x][ind.y ], x2, z_values[ind.x+1][ind.y ]),
z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]),
zf = calc_z0(pos.y, y1, z1, y2, z2);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/feature/input_shaping/M593.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
* X Set the given parameters only for the X axis.
* Y Set the given parameters only for the Y axis.
*/
void GcodeSuite::M593() {
if (!parser.seen_any()) return M593_report();
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,10 @@
/**
* Set flags for any form of bed probe
*/
#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE)
#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE)
#define HAS_STOWABLE_PROBE 1
#endif
#if ANY(HAS_STOWABLE_PROBE, HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE)
#if ANY(HAS_STOWABLE_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE)
#define HAS_BED_PROBE 1
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
#endif

#if ENABLED(EMIT_CREALITY_422_WARNING) && DISABLED(NO_CREALITY_422_DRIVER_WARNING)
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225, H8=HR4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#endif

#if PRINTCOUNTER_SYNC
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,19 +640,19 @@ void menu_advanced_steps_per_mm() {
BACK_ITEM(MSG_ADVANCED_SETTINGS);

LOOP_NUM_AXES(a)
EDIT_ITEM_FAST_N(float61, a, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[a], 5, 9999, []{ planner.refresh_positioning(); });
EDIT_ITEM_FAST_N(float72, a, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[a], 5, 9999, []{ planner.refresh_positioning(); });

#if ENABLED(DISTINCT_E_FACTORS)
LOOP_L_N(n, E_STEPPERS)
EDIT_ITEM_FAST_N(float61, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{
EDIT_ITEM_FAST_N(float72, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{
const uint8_t e = MenuItemBase::itemIndex;
if (e == active_extruder)
planner.refresh_positioning();
else
planner.mm_per_step[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)];
});
#elif E_STEPPERS
EDIT_ITEM_FAST_N(float61, E_AXIS, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
EDIT_ITEM_FAST_N(float72, E_AXIS, MSG_N_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); });
#endif

END_MENU();
Expand Down Expand Up @@ -695,7 +695,7 @@ void menu_advanced_settings() {

// M593 - Acceleration items
#if ENABLED(SHAPING_MENU)
SUBMENU(MSG_INPUT_SHAPING, menu_advanced_input_shaping);
if (!is_busy) SUBMENU(MSG_INPUT_SHAPING, menu_advanced_input_shaping);
#endif

#if HAS_CLASSIC_JERK
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/menu/menu_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(float4 ,float ,ftostr4sign , 1 );
DEFINE_MENU_EDIT_ITEM_TYPE(float5 ,float ,ftostr5rj , 1 ); // 12345 right-justified
DEFINE_MENU_EDIT_ITEM_TYPE(float5_25 ,float ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment)
DEFINE_MENU_EDIT_ITEM_TYPE(float61 ,float ,ftostr61rj , 10 ); // 12345.6 right-justified
DEFINE_MENU_EDIT_ITEM_TYPE(float72 ,float ,ftostr72rj , 100 ); // 12345.67 right-justified
DEFINE_MENU_EDIT_ITEM_TYPE(float31sign ,float ,ftostr31sign , 10 ); // +12.3
DEFINE_MENU_EDIT_ITEM_TYPE(float41sign ,float ,ftostr41sign , 10 ); // +123.4
DEFINE_MENU_EDIT_ITEM_TYPE(float51sign ,float ,ftostr51sign , 10 ); // +1234.5
Expand Down
98 changes: 60 additions & 38 deletions Marlin/src/lcd/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,38 @@ void menu_main() {
START_MENU();
BACK_ITEM(MSG_INFO_SCREEN);

#if ENABLED(SDSUPPORT)
#if ENABLED(SDSUPPORT) && !defined(MEDIA_MENU_AT_TOP) && !HAS_ENCODER_WHEEL
#define MEDIA_MENU_AT_TOP
#endif

#if !defined(MEDIA_MENU_AT_TOP) && !HAS_ENCODER_WHEEL
#define MEDIA_MENU_AT_TOP
if (busy) {
#if MACHINE_CAN_PAUSE
ACTION_ITEM(MSG_PAUSE_PRINT, ui.pause_print);
#endif
#if MACHINE_CAN_STOP
SUBMENU(MSG_STOP_PRINT, []{
MenuItem_confirm::select_screen(
GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK),
ui.abort_print, nullptr,
GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?")
);
});
#endif

#if ENABLED(GCODE_REPEAT_MARKERS)
if (repeat.is_active())
ACTION_ITEM(MSG_END_LOOPS, repeat.cancel);
#endif

auto sdcard_menu_items = [&]{
SUBMENU(MSG_TUNE, menu_tune);

#if ENABLED(CANCEL_OBJECTS) && DISABLED(SLIM_LCD_MENUS)
SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); });
#endif
}
else {
#if BOTH(SDSUPPORT, MEDIA_MENU_AT_TOP)
// BEGIN MEDIA MENU
#if ENABLED(MENU_ADDAUTOSTART)
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
#endif
Expand Down Expand Up @@ -278,39 +303,7 @@ void menu_main() {
GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media
#endif
}
};

#endif

if (busy) {
#if MACHINE_CAN_PAUSE
ACTION_ITEM(MSG_PAUSE_PRINT, ui.pause_print);
#endif
#if MACHINE_CAN_STOP
SUBMENU(MSG_STOP_PRINT, []{
MenuItem_confirm::select_screen(
GET_TEXT_F(MSG_BUTTON_STOP), GET_TEXT_F(MSG_BACK),
ui.abort_print, nullptr,
GET_TEXT_F(MSG_STOP_PRINT), (const char *)nullptr, F("?")
);
});
#endif

#if ENABLED(GCODE_REPEAT_MARKERS)
if (repeat.is_active())
ACTION_ITEM(MSG_END_LOOPS, repeat.cancel);
#endif

SUBMENU(MSG_TUNE, menu_tune);

#if ENABLED(CANCEL_OBJECTS) && DISABLED(SLIM_LCD_MENUS)
SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); });
#endif
}
else {

#if BOTH(SDSUPPORT, MEDIA_MENU_AT_TOP)
sdcard_menu_items();
// END MEDIA MENU
#endif

if (TERN0(MACHINE_CAN_PAUSE, printingIsPaused()))
Expand Down Expand Up @@ -390,7 +383,36 @@ void menu_main() {
#endif

#if ENABLED(SDSUPPORT) && DISABLED(MEDIA_MENU_AT_TOP)
sdcard_menu_items();
// BEGIN MEDIA MENU
#if ENABLED(MENU_ADDAUTOSTART)
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files
#endif

if (card_detected) {
if (!card_open) {
#if HAS_SD_DETECT
GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21")); // M21 Change Media
#else // - or -
ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media
queue.inject(F("M22"));
#if ENABLED(TFT_COLOR_UI)
// Menu display issue on item removal with multi language selection menu
if (encoderTopLine > 0) encoderTopLine--;
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
#endif
});
#endif
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
}
}
else {
#if HAS_SD_DETECT
ACTION_ITEM(MSG_NO_MEDIA, nullptr); // "No Media"
#else
GCODES_ITEM(MSG_ATTACH_MEDIA, F("M21")); // M21 Attach Media
#endif
}
// END MEDIA MENU
#endif

#if HAS_SERVICE_INTERVALS
Expand Down
Loading

0 comments on commit a1319c7

Please sign in to comment.