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

Bug fix on inverted leveling Y axis #2792

Merged
merged 2 commits into from
May 24, 2023
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
Next Next commit
Bug fix on inverted leveling Y axis
  • Loading branch information
digant73 committed May 18, 2023
commit 86f61d7d023162b09494e94779d7d1d30949f8ba
2 changes: 1 addition & 1 deletion TFT/src/User/API/LevelingControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void levelingGetPointCoords(LEVELING_POINT_COORDS coords)
x_right = temp;
}

if (GET_BIT(infoSettings.inverted_axis, Y_AXIS)) // leveling Y axis
if (GET_BIT(infoSettings.inverted_axis, E_AXIS)) // leveling Y axis (E_AXIS -> index for param "inverted_axis LY<x>" in config.ini)
{ // swap bottom and top
int16_t temp = y_bottom;
y_bottom = y_top;
Expand Down
6 changes: 3 additions & 3 deletions TFT/src/User/Menu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool nextScreenUpdate(uint32_t duration)
}
#endif

void drawBorder(const GUI_RECT *rect, uint16_t color, uint16_t edgeDistance)
void drawBorder(const GUI_RECT * rect, uint16_t color, uint16_t edgeDistance)
{
//uint16_t origColor = GUI_GetColor();

Expand All @@ -142,7 +142,7 @@ void drawBorder(const GUI_RECT *rect, uint16_t color, uint16_t edgeDistance)
//GUI_SetColor(origColor);
}

void drawBackground(const GUI_RECT *rect, uint16_t bgColor, uint16_t edgeDistance)
void drawBackground(const GUI_RECT * rect, uint16_t bgColor, uint16_t edgeDistance)
{
//uint16_t origBgColor = GUI_GetBkColor();

Expand All @@ -153,7 +153,7 @@ void drawBackground(const GUI_RECT *rect, uint16_t bgColor, uint16_t edgeDistanc
//GUI_SetBkColor(origBgColor);
}

void drawStandardValue(const GUI_RECT *rect, VALUE_TYPE valType, const void *val, uint16_t font,
void drawStandardValue(const GUI_RECT * rect, VALUE_TYPE valType, const void * val, uint16_t font,
uint16_t color, uint16_t bgColor, uint16_t edgeDistance, bool clearBgColor)
{
uint16_t origColor = GUI_GetColor();
Expand Down
6 changes: 3 additions & 3 deletions TFT/src/User/Menu/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ bool nextScreenUpdate(uint32_t duration);
#define INVERT_Z_AXIS_ICONS(menuItemsPtr)
#endif

void drawBorder(const GUI_RECT *rect, uint16_t color, uint16_t edgeDistance);
void drawBorder(const GUI_RECT * rect, uint16_t color, uint16_t edgeDistance);

void drawBackground(const GUI_RECT *rect, uint16_t bgColor, uint16_t edgeDistance);
void drawBackground(const GUI_RECT * rect, uint16_t bgColor, uint16_t edgeDistance);

void drawStandardValue(const GUI_RECT *rect, VALUE_TYPE valType, const void *val, uint16_t font,
void drawStandardValue(const GUI_RECT * rect, VALUE_TYPE valType, const void * val, uint16_t font,
uint16_t color, uint16_t bgColor, uint16_t edgeDistance, bool clearBgColor);

// Show/draw temperature in a standard menu
Expand Down
12 changes: 6 additions & 6 deletions TFT/src/User/my_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ extern "C" {

// call processes from the argument and than loopProcess() while condition is true
// tasks from argument must be separated by ";" ("TASK_LOOP_WHILE(condition, task1(); task2(); ...))
#define TASK_LOOP_WHILE(condition, ...) \
while(condition) \
{ \
__VA_ARGS__; \
loopProcess(); \
}
#define TASK_LOOP_WHILE(condition, ...) \
while (condition) \
{ \
__VA_ARGS__; \
loopProcess(); \
}

uint8_t inRange(int cur, int tag , int range);
long map(long x, long in_min, long in_max, long out_min, long out_max);
Expand Down