|
|
@ -1,26 +1,30 @@
|
|
|
|
/*********************
|
|
|
|
/**
|
|
|
|
* marlin_events.cpp *
|
|
|
|
* Marlin 3D Printer Firmware
|
|
|
|
*********************/
|
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
/**
|
|
|
|
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
|
|
|
|
* lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
|
|
|
|
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
|
|
|
|
*/
|
|
|
|
* *
|
|
|
|
|
|
|
|
* 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 *
|
|
|
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
|
|
|
* *
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
|
|
|
* *
|
|
|
|
|
|
|
|
* To view a copy of the GNU General Public License, go to the following *
|
|
|
|
|
|
|
|
* location: <https://www.gnu.org/licenses/>. *
|
|
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "compat.h"
|
|
|
|
#include "../../../inc/MarlinConfigPre.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(TOUCH_UI_FTDI_EVE)
|
|
|
|
#if ENABLED(TOUCH_UI_FTDI_EVE)
|
|
|
|
|
|
|
|
|
|
|
@ -30,13 +34,9 @@ namespace ExtUI {
|
|
|
|
using namespace Theme;
|
|
|
|
using namespace Theme;
|
|
|
|
using namespace FTDI;
|
|
|
|
using namespace FTDI;
|
|
|
|
|
|
|
|
|
|
|
|
void onStartup() {
|
|
|
|
void onStartup() { EventLoop::setup(); }
|
|
|
|
EventLoop::setup();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onIdle() {
|
|
|
|
void onIdle() { EventLoop::loop(); }
|
|
|
|
EventLoop::loop();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onPrinterKilled(PGM_P const error, PGM_P const component) {
|
|
|
|
void onPrinterKilled(PGM_P const error, PGM_P const component) {
|
|
|
|
char str[strlen_P(error) + strlen_P(component) + 3];
|
|
|
|
char str[strlen_P(error) + strlen_P(component) + 3];
|
|
|
@ -71,24 +71,17 @@ namespace ExtUI {
|
|
|
|
AlertDialogBox::showError(F("Unable to read media."));
|
|
|
|
AlertDialogBox::showError(F("Unable to read media."));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void onStatusChanged(const char *lcd_msg) {
|
|
|
|
void onStatusChanged(const char *lcd_msg) { StatusScreen::setStatusMessage(lcd_msg); }
|
|
|
|
StatusScreen::setStatusMessage(lcd_msg);
|
|
|
|
void onStatusChanged(progmem_str lcd_msg) { StatusScreen::setStatusMessage(lcd_msg); }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onStatusChanged(progmem_str lcd_msg) {
|
|
|
|
|
|
|
|
StatusScreen::setStatusMessage(lcd_msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onPrintTimerStarted() {
|
|
|
|
void onPrintTimerStarted() {
|
|
|
|
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_STARTED);
|
|
|
|
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_STARTED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void onPrintTimerStopped() {
|
|
|
|
void onPrintTimerStopped() {
|
|
|
|
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED);
|
|
|
|
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void onPrintTimerPaused() {}
|
|
|
|
void onPrintTimerPaused() {}
|
|
|
|
|
|
|
|
|
|
|
|
void onPrintFinished() {}
|
|
|
|
void onPrintFinished() {}
|
|
|
|
|
|
|
|
|
|
|
|
void onFilamentRunout(const extruder_t extruder) {
|
|
|
|
void onFilamentRunout(const extruder_t extruder) {
|
|
|
@ -101,38 +94,23 @@ namespace ExtUI {
|
|
|
|
void onHomingStart() {}
|
|
|
|
void onHomingStart() {}
|
|
|
|
void onHomingComplete() {}
|
|
|
|
void onHomingComplete() {}
|
|
|
|
|
|
|
|
|
|
|
|
void onFactoryReset() {
|
|
|
|
void onFactoryReset() { InterfaceSettingsScreen::defaultSettings(); }
|
|
|
|
InterfaceSettingsScreen::defaultSettings();
|
|
|
|
void onStoreSettings(char *buff) { InterfaceSettingsScreen::saveSettings(buff); }
|
|
|
|
}
|
|
|
|
void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); }
|
|
|
|
|
|
|
|
void onPostprocessSettings() {} // Called after loading or resetting stored settings
|
|
|
|
void onStoreSettings(char *buff) {
|
|
|
|
|
|
|
|
InterfaceSettingsScreen::saveSettings(buff);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onLoadSettings(const char *buff) {
|
|
|
|
|
|
|
|
InterfaceSettingsScreen::loadSettings(buff);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onPostprocessSettings() {
|
|
|
|
|
|
|
|
// Called after loading or resetting stored settings
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onConfigurationStoreWritten(bool success) {
|
|
|
|
void onConfigurationStoreWritten(bool success) {
|
|
|
|
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
|
|
|
|
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
|
|
|
|
if (success && InterfaceSettingsScreen::backupEEPROM()) {
|
|
|
|
if (success && InterfaceSettingsScreen::backupEEPROM()) {
|
|
|
|
SERIAL_ECHOLNPGM("Made backup of EEPROM to SPI Flash");
|
|
|
|
SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
UNUSED(success);
|
|
|
|
UNUSED(success);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void onConfigurationStoreRead(bool) {}
|
|
|
|
|
|
|
|
|
|
|
|
void onConfigurationStoreRead(bool) {
|
|
|
|
void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
|
|
|
|
|
|
|
sound.play_tone(frequency, duration);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onUserConfirmRequired(const char * const msg) {
|
|
|
|
void onUserConfirmRequired(const char * const msg) {
|
|
|
|
if (msg)
|
|
|
|
if (msg)
|
|
|
@ -143,20 +121,12 @@ namespace ExtUI {
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LEVELING && HAS_MESH
|
|
|
|
#if HAS_LEVELING && HAS_MESH
|
|
|
|
void onMeshLevelingStart() {}
|
|
|
|
void onMeshLevelingStart() {}
|
|
|
|
|
|
|
|
void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) { BedMeshViewScreen::onMeshUpdate(x, y, val); }
|
|
|
|
void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) {
|
|
|
|
void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { BedMeshViewScreen::onMeshUpdate(x, y, state); }
|
|
|
|
BedMeshViewScreen::onMeshUpdate(x, y, val);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) {
|
|
|
|
|
|
|
|
BedMeshViewScreen::onMeshUpdate(x, y, state);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
void onPowerLossResume() {
|
|
|
|
void onPowerLossResume() {} // Called on resume from power-loss
|
|
|
|
// Called on resume from power-loss
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_PID_HEATING
|
|
|
|
#if HAS_PID_HEATING
|