From 68240d398f156f9543bf8e581cc494e8750e4d8e Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 17 Mar 2019 00:23:55 -0400 Subject: [PATCH] IT COMPILES!!!! without sd card to screen --- .../lcd/extensible_ui/lib/Creality_DWIN.cpp | 11 ++-- Marlin/src/lcd/extensible_ui/lib/example.cpp | 65 ------------------- Marlin/src/lcd/extensible_ui/ui_api.cpp | 10 ++- Marlin/src/lcd/ultralcd.cpp | 2 +- 4 files changed, 17 insertions(+), 71 deletions(-) delete mode 100644 Marlin/src/lcd/extensible_ui/lib/example.cpp diff --git a/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp b/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp index 6874fb622b..77a502990f 100644 --- a/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/Creality_DWIN.cpp @@ -1561,7 +1561,9 @@ SERIAL_ECHO(Checkkey); SERIAL_ECHO(recdat.data[0]); SERIAL_ECHO("\n recdat.addr =="); SERIAL_ECHO(recdat.addr); */ - if(card.cardOK && recdat.addr == FilenameChs) + + //if(card.cardOK && recdat.addr == FilenameChs) //FIX ME + if (false) { if(recdat.data[0] > CardRecbuf.Filesum) break; @@ -1597,10 +1599,11 @@ SERIAL_ECHO(Checkkey); RTS_SndData((unsigned long)0x87F0,FilenameNature + recdat.data[0]*16); // Light green RTS_SndData(6,FilenameIcon1 + recdat.data[0]); // show frame - } + } else if(recdat.addr == FilenamePlay) { - if(recdat.data[0] == 1 && card.cardOK) //for sure + //if(recdat.data[0] == 1 && card.cardOK) //for sure //FIX ME + if(false) { if(CardRecbuf.recordcount < 0) break; @@ -1614,7 +1617,7 @@ SERIAL_ECHO(Checkkey); FilenamesCount = CardRecbuf.recordcount; memset(cmdbuf,0,sizeof(cmdbuf)); strcpy(cmdbuf,cmd); - + #if ENABLED(MachineCR10SPro) || ENABLED(AddonFilSensor) /**************checking filement status during printing beginning ************/ if(RTS_CheckFilement(1)) break; diff --git a/Marlin/src/lcd/extensible_ui/lib/example.cpp b/Marlin/src/lcd/extensible_ui/lib/example.cpp deleted file mode 100644 index 2a11d5c3c4..0000000000 --- a/Marlin/src/lcd/extensible_ui/lib/example.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/************* - * dummy.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: . * - ****************************************************************************/ - -#include "../../../inc/MarlinConfigPre.h" - -#if ENABLED(EXTENSIBLE_UI) - -#include "../ui_api.h" - -// To implement a new UI, complete the functions below and -// read or update Marlin's state using the methods in the -// ExtUI methods in "../ui_api.h" -// -// Although it may be possible to access other state -// variables from Marlin, using the API here possibly -// helps ensure future compatibility. - -namespace ExtUI { - void onStartup() { - /* Initialize the display module here. The following - * routines are available for access to the GPIO pins: - * - * SET_OUTPUT(pin) - * SET_INPUT_PULLUP(pin) - * SET_INPUT(pin) - * WRITE(pin,value) - * READ(pin) - */ - } - void onIdle() {} - void onPrinterKilled(PGM_P const msg) {} - void onMediaInserted() {}; - void onMediaError() {}; - void onMediaRemoved() {}; - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} - void onPrintTimerStarted() {} - void onPrintTimerPaused() {} - void onPrintTimerStopped() {} - void onFilamentRunout() {} - void onUserConfirmRequired(const char * const msg) {} - void onStatusChanged(const char * const msg) {} - void onFactoryReset() {} - void onLoadSettings() {} - void onStoreSettings() {} -} - -#endif // EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 210f158076..a64004e447 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -594,7 +594,15 @@ namespace ExtUI { void setLevelingActive(const bool state) { set_bed_leveling_enabled(state); } #if HAS_MESH bool getMeshValid() { return leveling_is_valid(); } - bed_mesh_t getMeshArray() { return Z_VALUES; } + bed_mesh_t getMeshArray() { + #if ENABLED(MESH_BED_LEVELING) + return mbl.z_values; + #elif ENABLED(AUTO_BED_LEVELING_UBL) + return ubl.z_values; + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + return z_values; + #endif + } void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) { if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) { Z_VALUES(xpos, ypos) = zoff; diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 3a2bc3d3c2..dd0b7e7a5c 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -1179,7 +1179,7 @@ void MarlinUI::update() { next_filament_display = millis() + 5000UL; // Show status message for 5s #endif - #if ENABLED(STATUS_MESSAGE_SCROLLING) + #if HAS_SPI_LCD && ENABLED(STATUS_MESSAGE_SCROLLING) status_scroll_offset = 0; #endif