Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Mesh Bed Leveling + optimized some code defining new API, improvements and bug fixes #1111

Merged
merged 9 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minor changes
  • Loading branch information
digant73 committed Sep 24, 2020
commit 5f28986e9a2a0fddaef8813d3eca344db860cbc4
4 changes: 2 additions & 2 deletions TFT/src/User/Menu/Babystep.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ void babyReDraw(bool skip_header)
setLargeFont(true);

sprintf(tempstr, "% 6.2f", babystep);
GUI_DispStringRight(point_bs.x, point_bs.y, (u8 *)tempstr);
GUI_DispStringRight(point_bs.x, point_bs.y, (u8 *) tempstr);

sprintf(tempstr, "% 6.2f", orig_z_offset + babystep);
GUI_DispStringRight(point_of.x, point_of.y, (u8 *)tempstr);
GUI_DispStringRight(point_of.x, point_of.y, (u8 *) tempstr);

setLargeFont(false);
}
Expand Down
24 changes: 5 additions & 19 deletions TFT/src/User/Menu/BedLeveling.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void menuBedLeveling(void)
};

KEY_VALUES key_num = KEY_IDLE;
void (*menuBL)(void) = menuABL;

switch (infoMachineSettings.blType)
{
Expand All @@ -67,6 +68,8 @@ void menuBedLeveling(void)
case BL_MBL:
bedLevelingItems.title.index = LABEL_MBL_SETTINGS;
bedLevelingItems.items[0].label.index = LABEL_MBL;

menuBL = menuMBL;
break;

default:
Expand All @@ -92,24 +95,7 @@ void menuBedLeveling(void)
switch (key_num)
{
case KEY_ICON_0:
switch (infoMachineSettings.blType)
{
case BL_BBL:
infoMenu.menu[++infoMenu.cur] = menuABL;
break;

case BL_UBL:
infoMenu.menu[++infoMenu.cur] = menuABL;
break;

case BL_MBL:
infoMenu.menu[++infoMenu.cur] = menuMBL;
break;

default:
infoMenu.menu[++infoMenu.cur] = menuABL;
break;
}
infoMenu.menu[++infoMenu.cur] = menuBL;
break;

case KEY_ICON_4:
Expand All @@ -122,7 +108,7 @@ void menuBedLeveling(void)
char tempstr[30];

sprintf(tempstr, "%Min:%.2f | Max:%.2f", Z_FADE_MIN_VALUE, Z_FADE_MAX_VALUE);
float val = numPadFloat((u8 *)tempstr, getParameter(P_ABL_STATE, 1), 0.0f, false);
float val = numPadFloat((u8 *) tempstr, getParameter(P_ABL_STATE, 1), 0.0f, false);

storeCmd("M420 Z%.2f\n", NOBEYOND(Z_FADE_MIN_VALUE, val, Z_FADE_MAX_VALUE));

Expand Down
2 changes: 1 addition & 1 deletion TFT/src/User/Menu/ConnectionSettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void menuBaudrate(void)
totalItems[i].icon = ICONCHAR_UNCHECKED;
}
totalItems[i].itemType = LIST_LABEL;
totalItems[i].titlelabel.address = (uint8_t *)item_baudrate_str[i];
totalItems[i].titlelabel.address = (uint8_t *) item_baudrate_str[i];
}

listWidgetCreate(title, totalItems, COUNT(totalItems), cur_item / LISTITEM_PER_PAGE);
Expand Down
12 changes: 6 additions & 6 deletions TFT/src/User/Menu/Pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void pidUpdateStatus(bool succeeded)

sprintf(tmpBuf, "%s\n %s", textSelect(LABEL_PROCESS_COMPLETED), textSelect(LABEL_EEPROM_SAVE_INFO));

showDialog(DIALOG_TYPE_SUCCESS, textSelect(LABEL_PID_TITLE), (u8*) tmpBuf,
showDialog(DIALOG_TYPE_SUCCESS, textSelect(LABEL_PID_TITLE), (u8 *) tmpBuf,
textSelect(LABEL_CONFIRM), textSelect(LABEL_CANCEL), saveEepromSettings, NULL, NULL);
}
else
Expand Down Expand Up @@ -116,7 +116,7 @@ void pidCheckTimeout()

BUZZER_PLAY(sound_error);

popupReminder(DIALOG_TYPE_ERROR, textSelect(LABEL_PID_TITLE), (u8*) tmpBuf);
popupReminder(DIALOG_TYPE_ERROR, textSelect(LABEL_PID_TITLE), (u8 *) tmpBuf);
}
}
}
Expand Down Expand Up @@ -213,14 +213,14 @@ void pidTemperatureReDraw(bool skip_header)
{
sprintf(tempstr, "%s ", pidDisplayID[pidHeater.toolIndex]);

GUI_DispString(exhibitRect.x0, exhibitRect.y0, (u8 *)tempstr);
GUI_DispString(exhibitRect.x0, exhibitRect.y0, (u8 *) tempstr);
}

sprintf(tempstr, " %d ", pidHeater.T[pidHeater.toolIndex].target);

setLargeFont(true);

GUI_DispStringInPrect(&exhibitRect, (u8 *)tempstr);
GUI_DispStringInPrect(&exhibitRect, (u8 *) tempstr);

setLargeFont(false);
}
Expand Down Expand Up @@ -309,15 +309,15 @@ void menuPid(void)
case KEY_ICON_6:
if (pidRunning)
{
addToast(DIALOG_TYPE_ERROR, (char*)textSelect(LABEL_PROCESS_RUNNING));
addToast(DIALOG_TYPE_ERROR, (char *) textSelect(LABEL_PROCESS_RUNNING));
}
else
{
pidUpdateCounter();

if (pidCounter == 0) // if no temperature was set to a value > 0
{
addToast(DIALOG_TYPE_ERROR, (char*)textSelect(LABEL_INVALID_VALUE));
addToast(DIALOG_TYPE_ERROR, (char *) textSelect(LABEL_INVALID_VALUE));
}
else
{
Expand Down
16 changes: 8 additions & 8 deletions TFT/src/User/Menu/ProbeOffset.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void probeNotifyError(void)
addToast(DIALOG_TYPE_ERROR, tmpBuf);
}

void probeShowStatus(u8 *status)
void probeDrawStatus(u8 *status)
{
char tempstr[20];

Expand All @@ -48,19 +48,19 @@ void probeShowStatus(u8 *status)
else
GUI_SetColor(infoSettings.sd_reminder_color);

GUI_DispString(exhibitRect.x0, exhibitRect.y0, (u8 *)tempstr);
GUI_DispString(exhibitRect.x0, exhibitRect.y0, (u8 *) tempstr);
GUI_SetColor(infoSettings.font_color);
}
}

void probeShowValue(float val)
void probeDrawValue(float val)
{
char tempstr[20];

sprintf(tempstr, " %.2f ", val);

setLargeFont(true);
GUI_DispStringInPrect(&exhibitRect, (u8 *)tempstr);
GUI_DispStringInPrect(&exhibitRect, (u8 *) tempstr);
setLargeFont(false);
}

Expand Down Expand Up @@ -101,8 +101,8 @@ void menuProbeOffset(void)
probeOffsetItems.items[KEY_ICON_6] = itemProbeOffsetSubmenu[curSubmenu];

menuDrawPage(&probeOffsetItems);
probeShowStatus(textSelect(probeOffsetItems.items[KEY_ICON_4].label.index));
probeShowValue(now);
probeDrawStatus(textSelect(probeOffsetItems.items[KEY_ICON_4].label.index));
probeDrawValue(now);

#if LCD_ENCODER_SUPPORT
encoderPosition = 0;
Expand Down Expand Up @@ -149,7 +149,7 @@ void menuProbeOffset(void)
}

menuDrawItem(&probeOffsetItems.items[key_num], key_num);
probeShowStatus(textSelect(probeOffsetItems.items[key_num].label.index));
probeDrawStatus(textSelect(probeOffsetItems.items[key_num].label.index));
break;

// change submenu
Expand Down Expand Up @@ -230,7 +230,7 @@ void menuProbeOffset(void)
if (now != z_offset)
{
now = z_offset;
probeShowValue(now);
probeDrawValue(now);

// babystep is reset every time Z offset changes otherwise the set babystep value will not be aligned with the new Z offset
babyReset();
Expand Down