Baseline ExtUI Additions
This commit is contained in:
@@ -141,7 +141,7 @@ typedef Servo hal_servo_t;
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3."
|
||||
#endif
|
||||
#define LCD_SERIAL lcdSerial
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(EXTENSIBLE_UI)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
|
||||
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
|
||||
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
|
||||
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(EXTENSIBLE_UI)
|
||||
template<typename Cfg>
|
||||
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
|
||||
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
static ring_buffer_pos_t available();
|
||||
static void write(const uint8_t c);
|
||||
static void flushTX();
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(EXTENSIBLE_UI)
|
||||
static ring_buffer_pos_t get_tx_buffer_free();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ extern DefaultSerial1 USBSerial;
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(EXTENSIBLE_UI)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
#else
|
||||
#error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(EXTENSIBLE_UI)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
|
||||
|
||||
void _rx_complete_irq(serial_t *obj);
|
||||
FORCE_INLINE static uint8_t buffer_overruns() { return 0; } // Not implemented, but set as void to avoid platform dependant code
|
||||
|
||||
protected:
|
||||
usart_rx_callback_t _rx_callback;
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
#define LCD_SERIAL MSERIAL(1) // dummy port
|
||||
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
|
||||
#endif
|
||||
#if HAS_DGUS_LCD
|
||||
#if HAS_DGUS_LCD || ENABLED(EXTENSIBLE_UI)
|
||||
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -288,7 +288,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
|
||||
// Show "Purge More" / "Resume" menu and wait for reply
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = false;
|
||||
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
|
||||
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI, EXTENSIBLE_UI)
|
||||
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
|
||||
#else
|
||||
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
|
||||
|
||||
@@ -993,6 +993,8 @@ G29_TYPE GcodeSuite::G29() {
|
||||
process_subcommands_now(F(EVENT_GCODE_AFTER_G29));
|
||||
#endif
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
|
||||
|
||||
probe.use_probing_tool(false);
|
||||
|
||||
report_current_position();
|
||||
|
||||
@@ -83,7 +83,7 @@ void GcodeSuite::G30() {
|
||||
F( " Z:"), p_float_t(measured_z, 3)
|
||||
);
|
||||
msg.echoln();
|
||||
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
|
||||
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI)
|
||||
ui.set_status(msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3568,7 +3568,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
|
||||
#error "LED_CONTROL_MENU requires an LCD controller that implements the menu."
|
||||
#endif
|
||||
|
||||
#if ENABLED(CUSTOM_MENU_MAIN) && NONE(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, TFT_LVGL_UI)
|
||||
#if ENABLED(CUSTOM_MENU_MAIN) && NONE(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, TFT_LVGL_UI, EXTENSIBLE_UI)
|
||||
#error "CUSTOM_MENU_MAIN requires an LCD controller that implements the menu."
|
||||
#endif
|
||||
|
||||
|
||||
@@ -765,6 +765,26 @@ namespace ExtUI {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_SHAPING
|
||||
float getShapingZeta(const axis_t axis) {
|
||||
return stepper.get_shaping_damping_ratio(AxisEnum(axis));
|
||||
}
|
||||
void setShapingZeta(const float zeta, const axis_t axis) {
|
||||
if (WITHIN(zeta, 0, 1)) {
|
||||
stepper.set_shaping_damping_ratio(AxisEnum(axis), zeta);
|
||||
}
|
||||
}
|
||||
float getShapingFrequency(const axis_t axis) {
|
||||
return stepper.get_shaping_frequency(AxisEnum(axis));
|
||||
}
|
||||
void setShapingFrequency(const float freq, const axis_t axis) {
|
||||
constexpr float min_freq = float(uint32_t(STEPPER_TIMER_RATE) / 2) / shaping_time_t(-2);
|
||||
if (freq == 0.0f || freq > min_freq) {
|
||||
stepper.set_shaping_frequency(AxisEnum(axis), freq);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
|
||||
float getJunctionDeviation_mm() { return planner.junction_deviation_mm; }
|
||||
@@ -933,6 +953,7 @@ namespace ExtUI {
|
||||
#if HAS_BED_PROBE
|
||||
float getProbeOffset_mm(const axis_t axis) { return probe.offset.pos[axis]; }
|
||||
void setProbeOffset_mm(const_float_t val, const axis_t axis) { probe.offset.pos[axis] = val; }
|
||||
probe_limits getBedProbeLimits() {return (probe_limits){probe.min_x(), probe.min_y(), probe.max_x(), probe.max_y()};}
|
||||
#endif
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
@@ -1140,7 +1161,7 @@ namespace ExtUI {
|
||||
return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused());
|
||||
}
|
||||
|
||||
bool isMediaInserted() { return TERN0(HAS_MEDIA, IS_SD_INSERTED()); }
|
||||
bool isMediaInserted() { return TERN0(HAS_MEDIA, IS_SD_INSERTED() || card.isMounted()); }
|
||||
|
||||
// Pause/Resume/Stop are implemented in MarlinUI
|
||||
void pausePrint() { ui.pause_print(); }
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace ExtUI {
|
||||
enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER };
|
||||
enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 };
|
||||
enum result_t : uint8_t { PID_STARTED, PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE };
|
||||
struct probe_limits { float pos[4];};
|
||||
|
||||
constexpr uint8_t extruderCount = EXTRUDERS;
|
||||
constexpr uint8_t hotendCount = HOTENDS;
|
||||
@@ -300,6 +301,13 @@ namespace ExtUI {
|
||||
void setLinearAdvance_mm_mm_s(const_float_t, const extruder_t);
|
||||
#endif
|
||||
|
||||
#if HAS_SHAPING
|
||||
float getShapingZeta(const axis_t);
|
||||
void setShapingZeta(const float, const axis_t);
|
||||
float getShapingFrequency(const axis_t);
|
||||
void setShapingFrequency(const float, const axis_t);
|
||||
#endif
|
||||
|
||||
// JD or Jerk Control
|
||||
#if HAS_JUNCTION_DEVIATION
|
||||
float getJunctionDeviation_mm();
|
||||
@@ -340,6 +348,7 @@ namespace ExtUI {
|
||||
#if HAS_BED_PROBE
|
||||
float getProbeOffset_mm(const axis_t);
|
||||
void setProbeOffset_mm(const_float_t, const axis_t);
|
||||
probe_limits getBedProbeLimits();
|
||||
#endif
|
||||
|
||||
// Backlash Control
|
||||
|
||||
Reference in New Issue
Block a user