LulzBot Touch UI Followup (#15007)
This commit is contained in:
parent
8c2cfaa907
commit
bd1ced14e7
|
@ -20,8 +20,6 @@
|
||||||
* location: <http://www.gnu.org/licenses/>. *
|
* location: <http://www.gnu.org/licenses/>. *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef LULZBOT_TOUCH_UI
|
|
||||||
|
|
||||||
class SPIFlash {
|
class SPIFlash {
|
||||||
public:
|
public:
|
||||||
static constexpr uint32_t erase_unit_size = 4 * 1024; // Minimum erase unit
|
static constexpr uint32_t erase_unit_size = 4 * 1024; // Minimum erase unit
|
||||||
|
@ -106,5 +104,3 @@ class UIFlashStorage::BootMediaReader {
|
||||||
|
|
||||||
static int16_t read(void *obj, void *buffer, const size_t size);
|
static int16_t read(void *obj, void *buffer, const size_t size);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LULZBOT_TOUCH_UI
|
|
||||||
|
|
|
@ -22,8 +22,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../../../../sd/SdFile.h"
|
#include "../../../../../inc/MarlinConfigPre.h"
|
||||||
#include "../../../../../sd/cardreader.h"
|
|
||||||
|
#if ENABLED(SDSUPPORT)
|
||||||
|
#include "../../../../../sd/SdFile.h"
|
||||||
|
#include "../../../../../sd/cardreader.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class MediaFileReader {
|
class MediaFileReader {
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -35,21 +35,13 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __MARLIN_FIRMWARE__
|
#ifdef __MARLIN_FIRMWARE__
|
||||||
// If __MARLIN_FIRMWARE__ exists, then we are being
|
// __MARLIN_FIRMWARE__ exists when compiled within Marlin.
|
||||||
// compiled inside Marlin.
|
|
||||||
#include "pin_mappings.h"
|
#include "pin_mappings.h"
|
||||||
#else
|
#else
|
||||||
// Messages that are declared in Marlin
|
// Messages that are declared in Marlin
|
||||||
#define WELCOME_MSG "Printer Ready"
|
#define WELCOME_MSG "Printer Ready"
|
||||||
#define MSG_SD_INSERTED "Media Inserted"
|
#define MSG_MEDIA_INSERTED "Media Inserted"
|
||||||
#define MSG_SD_REMOVED "Media Removed"
|
#define MSG_MEDIA_REMOVED "Media Removed"
|
||||||
|
|
||||||
// Define macros for compatibility
|
|
||||||
#define EXTENSIBLE_UI
|
|
||||||
#define _CAT(a, ...) a ## __VA_ARGS__
|
|
||||||
#define SWITCH_ENABLED_ 1
|
|
||||||
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
|
|
||||||
#define DISABLED(b) !ENABLED(b)
|
|
||||||
|
|
||||||
namespace UI {
|
namespace UI {
|
||||||
static inline uint32_t safe_millis() {return millis();};
|
static inline uint32_t safe_millis() {return millis();};
|
||||||
|
|
|
@ -80,9 +80,8 @@
|
||||||
// This is a recommended for smaller displays.
|
// This is a recommended for smaller displays.
|
||||||
//#define TOUCH_UI_PASSCODE
|
//#define TOUCH_UI_PASSCODE
|
||||||
|
|
||||||
// Define number of seconds after which the menu screens
|
// The timeout (in ms) to return to the status screen from sub-menus
|
||||||
// timeout and returns the user to the status screen
|
//#define LCD_TIMEOUT_TO_STATUS 15000
|
||||||
//#define LCD_TIMEOUT_TO_STATUS 120
|
|
||||||
|
|
||||||
// Enable this to debug the event framework
|
// Enable this to debug the event framework
|
||||||
//#define UI_FRAMEWORK_DEBUG
|
//#define UI_FRAMEWORK_DEBUG
|
||||||
|
|
|
@ -1160,7 +1160,7 @@ void CLCD::default_display_orientation() {
|
||||||
cmd.execute();
|
cmd.execute();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef TOUCH_UI_INVERTED
|
#if ENABLED(TOUCH_UI_INVERTED)
|
||||||
mem_write_32(REG::ROTATE, 1);
|
mem_write_32(REG::ROTATE, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,15 @@
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
|
||||||
#ifdef __MARLIN_FIRMWARE__
|
#ifdef __MARLIN_FIRMWARE__
|
||||||
// Marlin will define the I/O functions for us
|
|
||||||
|
|
||||||
|
// Marlin will define the I/O functions for us
|
||||||
#if ENABLED(LULZBOT_TOUCH_UI)
|
#if ENABLED(LULZBOT_TOUCH_UI)
|
||||||
#define FTDI_BASIC
|
#define FTDI_BASIC
|
||||||
#define FTDI_EXTENDED
|
#define FTDI_EXTENDED
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
|
#else // !__MARLIN_FIRMWARE__
|
||||||
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
|
|
||||||
#if !defined(CLCD_USE_SOFT_SPI)
|
#if !defined(CLCD_USE_SOFT_SPI)
|
||||||
|
@ -200,6 +202,14 @@
|
||||||
|
|
||||||
#define safe_delay delay
|
#define safe_delay delay
|
||||||
|
|
||||||
|
// Define macros for compatibility
|
||||||
|
|
||||||
|
#define _CAT(a, ...) a ## __VA_ARGS__
|
||||||
|
#define SWITCH_ENABLED_ 1
|
||||||
|
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
|
||||||
|
#define DISABLED(b) !ENABLED(b)
|
||||||
|
#define ANY(A,B) ENABLED(A) || ENABLED(B)
|
||||||
|
|
||||||
// Remove compiler warning on an unused variable
|
// Remove compiler warning on an unused variable
|
||||||
#ifndef UNUSED
|
#ifndef UNUSED
|
||||||
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
|
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
|
||||||
|
@ -208,4 +218,5 @@
|
||||||
#define UNUSED(x) ((void)(x))
|
#define UNUSED(x) ((void)(x))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif //!defined(__MARLIN_FIRMWARE__)
|
|
||||||
|
#endif // !__MARLIN_FIRMWARE__
|
||||||
|
|
|
@ -63,7 +63,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
|
||||||
void BaseScreen::onIdle() {
|
void BaseScreen::onIdle() {
|
||||||
#ifdef LCD_TIMEOUT_TO_STATUS
|
#ifdef LCD_TIMEOUT_TO_STATUS
|
||||||
const uint32_t elapsed = millis() - last_interaction;
|
const uint32_t elapsed = millis() - last_interaction;
|
||||||
if (elapsed > uint32_t(LCD_TIMEOUT_TO_STATUS) * 1000) {
|
if (elapsed > uint32_t(LCD_TIMEOUT_TO_STATUS)) {
|
||||||
reset_menu_timeout();
|
reset_menu_timeout();
|
||||||
GOTO_SCREEN(StatusScreen);
|
GOTO_SCREEN(StatusScreen);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,16 +32,10 @@ using namespace ExtUI;
|
||||||
|
|
||||||
void EndstopStatesScreen::onEntry() {
|
void EndstopStatesScreen::onEntry() {
|
||||||
BaseScreen::onEntry();
|
BaseScreen::onEntry();
|
||||||
#ifdef LULZBOT_SET_PROBE_PINS_STATE
|
|
||||||
LULZBOT_SET_PROBE_PINS_STATE(true)
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndstopStatesScreen::onExit() {
|
void EndstopStatesScreen::onExit() {
|
||||||
BaseScreen::onExit();
|
BaseScreen::onExit();
|
||||||
#ifdef LULZBOT_SET_PROBE_PINS_STATE
|
|
||||||
LULZBOT_SET_PROBE_PINS_STATE(false)
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndstopStatesScreen::onRedraw(draw_mode_t) {
|
void EndstopStatesScreen::onRedraw(draw_mode_t) {
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "../archim2-flash/flash_storage.h"
|
#include "../archim2-flash/flash_storage.h"
|
||||||
|
|
||||||
#if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP)
|
#if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP)
|
||||||
#include "../../../../sd/cardreader.h"
|
#include "../../../../../sd/cardreader.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace FTDI;
|
using namespace FTDI;
|
||||||
|
|
Loading…
Reference in a new issue