Skip to content

Commit

Permalink
🐛 Fix Ammeter display on DOGM (#22384)
Browse files Browse the repository at this point in the history
  • Loading branch information
descipher authored Jul 19, 2021
1 parent 1a0103d commit 286f6ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/lcd/dogm/dogm_Statusscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/lcd/dogm/status_screen_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 286f6ba

Please sign in to comment.