Bläddra i källkod

LulzBot Touch UI Followup (#15007)

Marcio Teixeira 5 år sedan
förälder
incheckning
bd1ced14e7

+ 0
- 4
Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.h Visa fil

20
  *   location: <http://www.gnu.org/licenses/>.                              *
20
  *   location: <http://www.gnu.org/licenses/>.                              *
21
  ****************************************************************************/
21
  ****************************************************************************/
22
 
22
 
23
-#ifdef LULZBOT_TOUCH_UI
24
-
25
 class SPIFlash {
23
 class SPIFlash {
26
   public:
24
   public:
27
     static constexpr uint32_t erase_unit_size = 4 * 1024; // Minimum erase unit
25
     static constexpr uint32_t erase_unit_size = 4 * 1024; // Minimum erase unit
106
 
104
 
107
     static int16_t read(void *obj, void *buffer, const size_t size);
105
     static int16_t read(void *obj, void *buffer, const size_t size);
108
 };
106
 };
109
-
110
-#endif // LULZBOT_TOUCH_UI

+ 6
- 2
Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/media_file_reader.h Visa fil

22
 
22
 
23
 #pragma once
23
 #pragma once
24
 
24
 
25
-#include "../../../../../sd/SdFile.h"
26
-#include "../../../../../sd/cardreader.h"
25
+#include "../../../../../inc/MarlinConfigPre.h"
26
+
27
+#if ENABLED(SDSUPPORT)
28
+  #include "../../../../../sd/SdFile.h"
29
+  #include "../../../../../sd/cardreader.h"
30
+#endif
27
 
31
 
28
 class MediaFileReader {
32
 class MediaFileReader {
29
   private:
33
   private:

+ 5
- 13
Marlin/src/lcd/extensible_ui/lib/lulzbot/compat.h Visa fil

35
 #endif
35
 #endif
36
 
36
 
37
 #ifdef __MARLIN_FIRMWARE__
37
 #ifdef __MARLIN_FIRMWARE__
38
-    // If __MARLIN_FIRMWARE__ exists, then we are being
39
-    // compiled inside Marlin.
40
-    #include "pin_mappings.h"
38
+  // __MARLIN_FIRMWARE__ exists when compiled within Marlin.
39
+  #include "pin_mappings.h"
41
 #else
40
 #else
42
   // Messages that are declared in Marlin
41
   // Messages that are declared in Marlin
43
-  #define WELCOME_MSG     "Printer Ready"
44
-  #define MSG_SD_INSERTED "Media Inserted"
45
-  #define MSG_SD_REMOVED  "Media Removed"
46
-
47
-  // Define macros for compatibility
48
-  #define EXTENSIBLE_UI
49
-  #define _CAT(a, ...) a ## __VA_ARGS__
50
-  #define SWITCH_ENABLED_      1
51
-  #define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
52
-  #define DISABLED(b) !ENABLED(b)
42
+  #define WELCOME_MSG        "Printer Ready"
43
+  #define MSG_MEDIA_INSERTED "Media Inserted"
44
+  #define MSG_MEDIA_REMOVED  "Media Removed"
53
 
45
 
54
   namespace UI {
46
   namespace UI {
55
     static inline uint32_t safe_millis() {return millis();};
47
     static inline uint32_t safe_millis() {return millis();};

+ 2
- 3
Marlin/src/lcd/extensible_ui/lib/lulzbot/config.h Visa fil

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

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp Visa fil

1160
       cmd.execute();
1160
       cmd.execute();
1161
     }
1161
     }
1162
     else {
1162
     else {
1163
-      #ifdef TOUCH_UI_INVERTED
1163
+      #if ENABLED(TOUCH_UI_INVERTED)
1164
         mem_write_32(REG::ROTATE, 1);
1164
         mem_write_32(REG::ROTATE, 1);
1165
       #endif
1165
       #endif
1166
     }
1166
     }

+ 14
- 3
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/compat.h Visa fil

20
 #include "../config.h"
20
 #include "../config.h"
21
 
21
 
22
 #ifdef __MARLIN_FIRMWARE__
22
 #ifdef __MARLIN_FIRMWARE__
23
-  // Marlin will define the I/O functions for us
24
 
23
 
24
+  // Marlin will define the I/O functions for us
25
   #if ENABLED(LULZBOT_TOUCH_UI)
25
   #if ENABLED(LULZBOT_TOUCH_UI)
26
     #define FTDI_BASIC
26
     #define FTDI_BASIC
27
     #define FTDI_EXTENDED
27
     #define FTDI_EXTENDED
28
   #endif
28
   #endif
29
-#else
29
+
30
+#else // !__MARLIN_FIRMWARE__
31
+
30
   #include "Arduino.h"
32
   #include "Arduino.h"
31
 
33
 
32
   #if !defined(CLCD_USE_SOFT_SPI)
34
   #if !defined(CLCD_USE_SOFT_SPI)
200
 
202
 
201
   #define safe_delay delay
203
   #define safe_delay delay
202
 
204
 
205
+  // Define macros for compatibility
206
+
207
+  #define _CAT(a, ...)       a ## __VA_ARGS__
208
+  #define SWITCH_ENABLED_    1
209
+  #define ENABLED(b)         _CAT(SWITCH_ENABLED_, b)
210
+  #define DISABLED(b)        !ENABLED(b)
211
+  #define ANY(A,B)           ENABLED(A) || ENABLED(B)
212
+
203
   // Remove compiler warning on an unused variable
213
   // Remove compiler warning on an unused variable
204
   #ifndef UNUSED
214
   #ifndef UNUSED
205
     #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
215
     #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
208
       #define UNUSED(x) ((void)(x))
218
       #define UNUSED(x) ((void)(x))
209
     #endif
219
     #endif
210
   #endif
220
   #endif
211
-#endif //!defined(__MARLIN_FIRMWARE__)
221
+
222
+#endif // !__MARLIN_FIRMWARE__

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/base_screen.cpp Visa fil

63
 void BaseScreen::onIdle() {
63
 void BaseScreen::onIdle() {
64
   #ifdef LCD_TIMEOUT_TO_STATUS
64
   #ifdef LCD_TIMEOUT_TO_STATUS
65
     const uint32_t elapsed = millis() - last_interaction;
65
     const uint32_t elapsed = millis() - last_interaction;
66
-    if (elapsed > uint32_t(LCD_TIMEOUT_TO_STATUS) * 1000) {
66
+    if (elapsed > uint32_t(LCD_TIMEOUT_TO_STATUS)) {
67
       reset_menu_timeout();
67
       reset_menu_timeout();
68
       GOTO_SCREEN(StatusScreen);
68
       GOTO_SCREEN(StatusScreen);
69
     }
69
     }

+ 0
- 6
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/endstop_state_screen.cpp Visa fil

32
 
32
 
33
 void EndstopStatesScreen::onEntry() {
33
 void EndstopStatesScreen::onEntry() {
34
   BaseScreen::onEntry();
34
   BaseScreen::onEntry();
35
-  #ifdef LULZBOT_SET_PROBE_PINS_STATE
36
-    LULZBOT_SET_PROBE_PINS_STATE(true)
37
-  #endif
38
 }
35
 }
39
 
36
 
40
 void EndstopStatesScreen::onExit() {
37
 void EndstopStatesScreen::onExit() {
41
   BaseScreen::onExit();
38
   BaseScreen::onExit();
42
-  #ifdef LULZBOT_SET_PROBE_PINS_STATE
43
-    LULZBOT_SET_PROBE_PINS_STATE(false)
44
-  #endif
45
 }
39
 }
46
 
40
 
47
 void EndstopStatesScreen::onRedraw(draw_mode_t) {
41
 void EndstopStatesScreen::onRedraw(draw_mode_t) {

+ 1
- 1
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/status_screen.cpp Visa fil

30
 #include "../archim2-flash/flash_storage.h"
30
 #include "../archim2-flash/flash_storage.h"
31
 
31
 
32
 #if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP)
32
 #if ENABLED(SDSUPPORT) && defined(LULZBOT_MANUAL_USB_STARTUP)
33
-  #include "../../../../sd/cardreader.h"
33
+  #include "../../../../../sd/cardreader.h"
34
 #endif
34
 #endif
35
 
35
 
36
 using namespace FTDI;
36
 using namespace FTDI;

Laddar…
Avbryt
Spara