From 71526fa5ce446c7504dca1c9d4a70a64f53fcf74 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 7 Oct 2019 16:39:52 -0400 Subject: [PATCH] Fix ExtUI onMeshUpdate event (#15477) --- Marlin/src/lcd/extensible_ui/ui_api.cpp | 3 --- Marlin/src/lcd/extensible_ui/ui_api.h | 2 +- Marlin/src/lcd/extui_example.cpp | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index b70a90b89d..eebe01d0d2 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -819,9 +819,6 @@ namespace ExtUI { #endif } } - void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval) { - UNUSED(xpos); UNUSED(ypos); UNUSED(zval); - } #endif #endif diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 1ae2ebd4c1..7676107a24 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -138,7 +138,7 @@ namespace ExtUI { float getMeshPoint(const xy_uint8_t &pos); void setMeshPoint(const xy_uint8_t &pos, const float zval); void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval); - inline void onMeshUpdate(const xy_uint8_t &pos, const float zval) { setMeshPoint(pos, zval); } + inline void onMeshUpdate(const xy_uint8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); } #endif #endif diff --git a/Marlin/src/lcd/extui_example.cpp b/Marlin/src/lcd/extui_example.cpp index 4fec2745a9..35a0215c37 100644 --- a/Marlin/src/lcd/extui_example.cpp +++ b/Marlin/src/lcd/extui_example.cpp @@ -88,6 +88,10 @@ namespace ExtUI { // This is called after the entire EEPROM has been read, // whether successful or not. } + + void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval) { + // This is called when any mesh points are updated + } } #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI