From 0e9eb5f6cef2e01fac961dd49c39e5b136cde985 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Sun, 18 Jul 2021 20:11:24 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Ammeter=20display=20on=20D?= =?UTF-8?q?OGM=20(#22384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/dogm_Statusscreen.h | 6 +++--- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index 6aa2bab0da..dfbf7b4291 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -624,7 +624,7 @@ #define STATUS_AMMETER_X (LCD_PIXEL_WIDTH - (STATUS_AMMETER_BYTEWIDTH + STATUS_FLOWMETER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH + STATUS_CUTTER_BYTEWIDTH + STATUS_COOLER_BYTEWIDTH) * 8) #endif #ifndef STATUS_AMMETER_HEIGHT - #define STATUS_AMMETER_HEIGHT(S) (sizeof(status_ammeter_bmp1) / (STATUS_AMMETER_BYTEWIDTH)) + #define STATUS_AMMETER_HEIGHT(S) (sizeof(status_ammeter_bmp_mA) / (STATUS_AMMETER_BYTEWIDTH)) #endif #ifndef STATUS_AMMETER_Y #define STATUS_AMMETER_Y(S) (18 - STATUS_AMMETER_HEIGHT(S)) @@ -633,8 +633,8 @@ #define STATUS_AMMETER_TEXT_X (STATUS_AMMETER_X + 7) #endif static_assert( - sizeof(status_ammeter_bmp1) == (STATUS_AMMETER_BYTEWIDTH) * STATUS_AMMETER_HEIGHT(0), - "Status ammeter bitmap (status_ammeter_bmp1) dimensions don't match data." + sizeof(status_ammeter_bmp_mA) == (STATUS_AMMETER_BYTEWIDTH) * STATUS_AMMETER_HEIGHT(0), + "Status ammeter bitmap (status_ammeter_bmp_mA) dimensions don't match data." ); #endif diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index d58be4dbaf..a66aca6d19 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -57,6 +57,10 @@ #include "../../feature/cooler.h" #endif +#if ENABLED(I2C_AMMETER) + #include "../../feature/ammeter.h" +#endif + #if HAS_POWER_MONITOR #include "../../feature/power_monitor.h" #endif