Browse Source

Changes supporting "Prussia3D" MK3 (#21617)

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
81ab756759
  1. 4
      Marlin/src/inc/Conditionals_post.h
  2. 12
      Marlin/src/lcd/dogm/dogm_Statusscreen.h
  3. 21
      Marlin/src/lcd/marlinui.cpp
  4. 19
      Marlin/src/module/settings.cpp
  5. 15
      Marlin/src/pins/rambo/pins_EINSY_RAMBO.h

4
Marlin/src/inc/Conditionals_post.h

@ -2539,7 +2539,9 @@
#endif
#if HAS_TEMPERATURE && EITHER(HAS_LCD_MENU, DWIN_CREALITY_LCD)
#ifdef PREHEAT_5_LABEL
#ifdef PREHEAT_6_LABEL
#define PREHEAT_COUNT 6
#elif defined(PREHEAT_5_LABEL)
#define PREHEAT_COUNT 5
#elif defined(PREHEAT_4_LABEL)
#define PREHEAT_COUNT 4

12
Marlin/src/lcd/dogm/dogm_Statusscreen.h

@ -281,7 +281,9 @@
#define STATUS_HOTEND8_WIDTH STATUS_HOTEND7_WIDTH
#endif
constexpr uint8_t status_hotend_width[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_WIDTH, STATUS_HOTEND2_WIDTH, STATUS_HOTEND3_WIDTH, STATUS_HOTEND4_WIDTH, STATUS_HOTEND5_WIDTH, STATUS_HOTEND6_WIDTH, STATUS_HOTEND7_WIDTH, STATUS_HOTEND8_WIDTH);
#define _SHNAME(N,T) STATUS_HOTEND##N##_##T,
constexpr uint8_t status_hotend_width[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, WIDTH) };
#define STATUS_HOTEND_WIDTH(N) status_hotend_width[N]
#ifndef STATUS_HOTEND1_BYTEWIDTH
@ -309,7 +311,7 @@
#define STATUS_HOTEND8_BYTEWIDTH BW(STATUS_HOTEND8_WIDTH)
#endif
constexpr uint8_t status_hotend_bytewidth[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_BYTEWIDTH, STATUS_HOTEND2_BYTEWIDTH, STATUS_HOTEND3_BYTEWIDTH, STATUS_HOTEND4_BYTEWIDTH, STATUS_HOTEND5_BYTEWIDTH, STATUS_HOTEND6_BYTEWIDTH, STATUS_HOTEND7_BYTEWIDTH, STATUS_HOTEND8_BYTEWIDTH);
constexpr uint8_t status_hotend_bytewidth[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, BYTEWIDTH) };
#define STATUS_HOTEND_BYTEWIDTH(N) status_hotend_bytewidth[N]
#ifndef STATUS_HOTEND1_X
@ -339,7 +341,7 @@
#define STATUS_HOTEND8_X STATUS_HOTEND7_X + STATUS_HEATERS_XSPACE
#endif
constexpr uint8_t status_hotend_x[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_X, STATUS_HOTEND2_X, STATUS_HOTEND3_X, STATUS_HOTEND4_X, STATUS_HOTEND5_X, STATUS_HOTEND6_X, STATUS_HOTEND7_X, STATUS_HOTEND8_X);
constexpr uint8_t status_hotend_x[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, X) };
#define STATUS_HOTEND_X(N) status_hotend_x[N]
#elif HAS_MULTI_HOTEND
#define STATUS_HOTEND_X(N) ((N) ? STATUS_HOTEND2_X : STATUS_HOTEND1_X)
@ -370,13 +372,15 @@
#ifndef STATUS_HOTEND8_TEXT_X
#define STATUS_HOTEND8_TEXT_X STATUS_HOTEND7_TEXT_X + STATUS_HEATERS_XSPACE
#endif
constexpr uint8_t status_hotend_text_x[] = ARRAY_N(HOTENDS, STATUS_HOTEND1_TEXT_X, STATUS_HOTEND2_TEXT_X, STATUS_HOTEND3_TEXT_X, STATUS_HOTEND4_TEXT_X, STATUS_HOTEND5_TEXT_X, STATUS_HOTEND6_TEXT_X, STATUS_HOTEND7_TEXT_X, STATUS_HOTEND8_TEXT_X);
constexpr uint8_t status_hotend_text_x[HOTENDS] = { REPEAT2_S(1, INCREMENT(HOTENDS), _SHNAME, TEXT_X) };
#define STATUS_HOTEND_TEXT_X(N) status_hotend_text_x[N]
#else
#define STATUS_HOTEND_TEXT_X(N) (STATUS_HOTEND1_X + 6 + (N) * (STATUS_HEATERS_XSPACE))
#endif
#endif
#undef _SHNAME
#if STATUS_HOTEND_BITMAPS > 1 && DISABLED(STATUS_HOTEND_NUMBERLESS)
#define TEST_BITMAP_OFF status_hotend1_a_bmp
#define TEST_BITMAP_ON status_hotend1_b_bmp

21
Marlin/src/lcd/marlinui.cpp

@ -112,25 +112,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
#if PREHEAT_COUNT
preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load()
PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
#ifdef PREHEAT_1_LABEL
static PGMSTR(preheat_0_label, PREHEAT_1_LABEL);
#endif
#ifdef PREHEAT_2_LABEL
static PGMSTR(preheat_1_label, PREHEAT_2_LABEL);
#endif
#ifdef PREHEAT_3_LABEL
static PGMSTR(preheat_2_label, PREHEAT_3_LABEL);
#endif
#ifdef PREHEAT_4_LABEL
static PGMSTR(preheat_3_label, PREHEAT_4_LABEL);
#endif
#ifdef PREHEAT_5_LABEL
static PGMSTR(preheat_4_label, PREHEAT_5_LABEL);
#endif
#define _PDEF(N) static PGMSTR(preheat_##N##_label, PREHEAT_##N##_LABEL);
#define _PLBL(N) preheat_##N##_label,
static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT(PREHEAT_COUNT, _PLBL) };
REPEAT_S(1, INCREMENT(PREHEAT_COUNT), _PDEF);
static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT_S(1, INCREMENT(PREHEAT_COUNT), _PLBL) };
return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
}
#endif

19
Marlin/src/module/settings.cpp

@ -2780,25 +2780,20 @@ void MarlinSettings::reset() {
// Preheat parameters
//
#if PREHEAT_COUNT
#define _PITEM(N,T) PREHEAT_##N##_##T,
#if HAS_HOTEND
constexpr uint16_t hpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND, PREHEAT_3_TEMP_HOTEND, PREHEAT_4_TEMP_HOTEND, PREHEAT_5_TEMP_HOTEND);
constexpr uint16_t hpre[] = { REPEAT2_S(1, INCREMENT(PREHEAT_COUNT), _PITEM, TEMP_HOTEND) };
#endif
#if HAS_HEATED_BED
constexpr uint16_t bpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED, PREHEAT_3_TEMP_BED, PREHEAT_4_TEMP_BED, PREHEAT_5_TEMP_BED);
constexpr uint16_t bpre[] = { REPEAT2_S(1, INCREMENT(PREHEAT_COUNT), _PITEM, TEMP_BED) };
#endif
#if HAS_FAN
constexpr uint8_t fpre[] = ARRAY_N(PREHEAT_COUNT, PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED, PREHEAT_3_FAN_SPEED, PREHEAT_4_FAN_SPEED, PREHEAT_5_FAN_SPEED);
constexpr uint8_t fpre[] = { REPEAT2_S(1, INCREMENT(PREHEAT_COUNT), _PITEM, FAN_SPEED) };
#endif
LOOP_L_N(i, PREHEAT_COUNT) {
#if HAS_HOTEND
ui.material_preset[i].hotend_temp = hpre[i];
#endif
#if HAS_HEATED_BED
ui.material_preset[i].bed_temp = bpre[i];
#endif
#if HAS_FAN
ui.material_preset[i].fan_speed = fpre[i];
#endif
TERN_(HAS_HOTEND, ui.material_preset[i].hotend_temp = hpre[i]);
TERN_(HAS_HEATED_BED, ui.material_preset[i].bed_temp = bpre[i]);
TERN_(HAS_FAN, ui.material_preset[i].fan_speed = fpre[i]);
}
#endif

15
Marlin/src/pins/rambo/pins_EINSY_RAMBO.h

@ -28,6 +28,9 @@
#include "env_validate.h"
#define BOARD_INFO_NAME "Einsy Rambo"
#define DEFAULT_MACHINE_NAME "Prusa MK3"
//#define MK3_FAN_PINS
//
// TMC2130 Configuration_adv defaults for EinsyRambo
@ -123,11 +126,19 @@
#define HEATER_BED_PIN 4
#ifndef FAN_PIN
#ifdef MK3_FAN_PINS
#define FAN_PIN 6
#else
#define FAN_PIN 8
#endif
#endif
#ifndef FAN1_PIN
#define FAN1_PIN 6
#ifdef MK3_FAN_PINS
#define FAN_PIN -1
#else
#define FAN_PIN 6
#endif
#endif
//
@ -192,3 +203,5 @@
#endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL
#endif // HAS_WIRED_LCD
#undef MK3_FAN_PINS

Loading…
Cancel
Save