Skip to content

Commit

Permalink
fixes and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Aug 23, 2023
1 parent 5e0c0a1 commit 8298732
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/lcd/e3v2/proui/dwinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void DWINUI::drawFillCircle(uint16_t bcolor, uint16_t x, uint16_t y, uint8_t r)
// maxv : Maximum value
// color1 : Start color
// color2 : End color
uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) {
uint16_t DWINUI::colorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) {
uint8_t B, G, R;
const float n = float(val - minv) / (maxv - minv + 1);
R = (1.0f - n) * GetRColor(color1) + n * GetRColor(color2);
Expand All @@ -293,7 +293,7 @@ uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t colo
// val : Interpolator minv..maxv
// minv : Minimum value
// maxv : Maximum value
uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) {
uint16_t DWINUI::rainbowInt(int16_t val, int16_t minv, int16_t maxv) {
const int16_t limv = _MAX(abs(minv), abs(maxv));
float n = (minv >= 0) ? float(val - minv) / (maxv - minv + 1) : (float)val / limv;
LIMIT(n, -1, 1);
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/e3v2/proui/dwinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ namespace DWINUI {
// maxv : Maximum value
// color1 : Start color
// color2 : End color
uint16_t ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2);
uint16_t colorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2);

// ------------------------- Buttons ------------------------------//

Expand Down Expand Up @@ -593,21 +593,21 @@ namespace DWINUI {
// val : Interpolator minv..maxv
// minv : Minimum value
// maxv : Maximum value
uint16_t RainbowInt(int16_t val, int16_t minv, int16_t maxv);
uint16_t rainbowInt(int16_t val, int16_t minv, int16_t maxv);

// Write buffer data to the SRAM
// addr: SRAM start address 0x0000-0x7FFF
// length: Bytes to write
// data: address of the buffer with data
inline void WriteToSRAM(uint16_t addr, uint16_t length, uint8_t *data) {
inline void writeToSRAM(uint16_t addr, uint16_t length, uint8_t *data) {
dwinWriteToMem(0x5A, addr, length, data);
}

// Write buffer data to the Flash
// addr: Flash start address 0x0000-0x3FFF
// length: Bytes to write
// data: address of the buffer with data
inline void WriteToFlash(uint16_t addr, uint16_t length, uint8_t *data) {
inline void writeToFlash(uint16_t addr, uint16_t length, uint8_t *data) {
dwinWriteToMem(0xA5, addr, length, data);
}

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/gcode_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool Has_Preview() {
fileprop.thumbwidth = THUMBWIDTH;
fileprop.thumbheight = THUMBHEIGHT;
fileprop.thumbsize = decode_base64(buf64, fileprop.thumbdata); card.closefile();
DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata);
DWINUI::writeToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata);
delete[] fileprop.thumbdata;
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/e3v2/proui/meshviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z)
const int16_t v = isnan(z) ? 0 : round(z * 100);
NOLESS(max, z); NOMORE(min, z);

const uint16_t color = DWINUI::RainbowInt(v, zmin, zmax);
const uint16_t color = DWINUI::rainbowInt(v, zmin, zmax);
DWINUI::drawFillCircle(color, px(x), py(y), r(_MAX(_MIN(v, zmax), zmin)));
TERN_(TJC_DISPLAY, delay(100));

const uint16_t fy = py(y) - fs;
if (sizex < TERN(TJC_DISPLAY, 8 : 9)) {
if (sizex < TERN(TJC_DISPLAY, 8, 9)) {
if (v == 0) DWINUI::drawFloat(meshfont, 1, 2, px(x) - 2 * fs, fy, 0);
else DWINUI::drawSignedFloat(meshfont, 1, 2, px(x) - 3 * fs, fy, z);
}
Expand All @@ -91,8 +91,8 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z)
switch (v) {
case -999 ... -100:
case 100 ... 999: DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, fy, z); break;
case -99 ... -1: sprintf_P(msg, PSTR("-.%02i"), -v); break;
case 1 ... 99: sprintf_P(msg, PSTR( ".%02i"), v); break;
case -99 ... -1: sprintf_P(msg, PSTR("-.%2i"), -v); break;
case 1 ... 99: sprintf_P(msg, PSTR( ".%2i"), v); break;
default:
dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, fy, "0");
return;
Expand Down

0 comments on commit 8298732

Please sign in to comment.