Browse Source

LulzBot Touch UI Followup (#15007)

pull/1/head
Marcio Teixeira 5 years ago
committed by Scott Lahteine
parent
commit
bd1ced14e7
  1. 4
      Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.h
  2. 8
      Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/media_file_reader.h
  3. 18
      Marlin/src/lcd/extensible_ui/lib/lulzbot/compat.h
  4. 5
      Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h
  5. 2
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp
  6. 17
      Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h
  7. 2
      Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp
  8. 6
      Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp
  9. 2
      Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp

4
Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.h

@ -20,8 +20,6 @@
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
#ifdef LULZBOT_TOUCH_UI
class SPIFlash {
public:
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);
};
#endif // LULZBOT_TOUCH_UI

8
Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/media_file_reader.h

@ -22,8 +22,12 @@
#pragma once
#include "../../../../../sd/SdFile.h"
#include "../../../../../sd/cardreader.h"
#include "../../../../../inc/MarlinConfigPre.h"
#if ENABLED(SDSUPPORT)
#include "../../../../../sd/SdFile.h"
#include "../../../../../sd/cardreader.h"
#endif
class MediaFileReader {
private:

18
Marlin/src/lcd/extensible_ui/lib/lulzbot/compat.h

@ -35,21 +35,13 @@
#endif
#ifdef __MARLIN_FIRMWARE__
// If __MARLIN_FIRMWARE__ exists, then we are being
// compiled inside Marlin.
#include "pin_mappings.h"
// __MARLIN_FIRMWARE__ exists when compiled within Marlin.
#include "pin_mappings.h"
#else
// Messages that are declared in Marlin
#define WELCOME_MSG "Printer Ready"
#define MSG_SD_INSERTED "Media Inserted"
#define MSG_SD_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)
#define WELCOME_MSG "Printer Ready"
#define MSG_MEDIA_INSERTED "Media Inserted"
#define MSG_MEDIA_REMOVED "Media Removed"
namespace UI {
static inline uint32_t safe_millis() {return millis();};

5
Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h

@ -80,9 +80,8 @@
// This is a recommended for smaller displays.
//#define TOUCH_UI_PASSCODE
// Define number of seconds after which the menu screens
// timeout and returns the user to the status screen
//#define LCD_TIMEOUT_TO_STATUS 120
// The timeout (in ms) to return to the status screen from sub-menus
//#define LCD_TIMEOUT_TO_STATUS 15000
// Enable this to debug the event framework
//#define UI_FRAMEWORK_DEBUG

2
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp

@ -1160,7 +1160,7 @@ void CLCD::default_display_orientation() {
cmd.execute();
}
else {
#ifdef TOUCH_UI_INVERTED
#if ENABLED(TOUCH_UI_INVERTED)
mem_write_32(REG::ROTATE, 1);
#endif
}

17
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h

@ -20,13 +20,15 @@
#include "../config.h"
#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)
#define FTDI_BASIC
#define FTDI_EXTENDED
#endif
#else
#else // !__MARLIN_FIRMWARE__
#include "Arduino.h"
#if !defined(CLCD_USE_SOFT_SPI)
@ -200,6 +202,14 @@
#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
#ifndef UNUSED
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
@ -208,4 +218,5 @@
#define UNUSED(x) ((void)(x))
#endif
#endif
#endif //!defined(__MARLIN_FIRMWARE__)
#endif // !__MARLIN_FIRMWARE__

2
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp

@ -63,7 +63,7 @@ bool BaseScreen::buttonStyleCallback(CommandProcessor &cmd, uint8_t tag, uint8_t
void BaseScreen::onIdle() {
#ifdef LCD_TIMEOUT_TO_STATUS
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();
GOTO_SCREEN(StatusScreen);
}

6
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp

@ -32,16 +32,10 @@ using namespace ExtUI;
void EndstopStatesScreen::onEntry() {
BaseScreen::onEntry();
#ifdef LULZBOT_SET_PROBE_PINS_STATE
LULZBOT_SET_PROBE_PINS_STATE(true)
#endif
}
void EndstopStatesScreen::onExit() {
BaseScreen::onExit();
#ifdef LULZBOT_SET_PROBE_PINS_STATE
LULZBOT_SET_PROBE_PINS_STATE(false)
#endif
}
void EndstopStatesScreen::onRedraw(draw_mode_t) {

2
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp

@ -30,7 +30,7 @@
#include "../archim2-flash/flash_storage.h"
#if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP)
#include "../../../../sd/cardreader.h"
#include "../../../../../sd/cardreader.h"
#endif
using namespace FTDI;

Loading…
Cancel
Save