-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Various bugfixes, timer rollover bugs, encoder, long press freeze bug, encoder issue at higher values #2967
base: master
Are you sure you want to change the base?
Conversation
…der bug Solves various timer rollover bugs Solves the encoder not working well bug Solves the long press freeze bug Corrects the UART6 pins on MKS TFT35 V1.0 Enhancements, improved handling of back button and long press button 2 additional serial baud rates Adds several long press functions (jump temp, adjust movement speed, jump to temp from extruder menu)
Anybody, please download and test, try long pressing the movement amount in the "move menu", or the "+" or "-" in the "Heat menu". The long press freeze bug should be solved now, but I still found some freezes in the console, when the motherboard is being restarted, I have not yet located that bug. @bigtreetech Could you please add the current status to the releases? The last release if from 2021 and is quite outdated. UPDATE: The back button has some issues, still needs fixing |
"if (a == true)" is the same as "if (a)" "if (a == false)" is the same as "if (!a)" Some small comment formatting fixes Small optimization
TFT/src/User/API/menu.c
Outdated
@@ -709,7 +710,6 @@ LISTITEMS * getCurListItems(void) | |||
GUI_POINT getIconStartPoint(int index) | |||
{ | |||
GUI_POINT p = {curRect[index].x0, curRect[index].y0}; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not remove the empty line before any return statement. It has been added to highlight the return point
TFT/src/User/API/menu.c
Outdated
@@ -765,7 +765,6 @@ void menuRefreshListPage(void) | |||
for (uint8_t i = 0; i < ITEM_PER_PAGE; i++) | |||
{ | |||
RAPID_PRINTING_COMM() // perform backend printing loop between drawing icons to avoid printer idling | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not remove the empty line before any GUI call. It has been added to separate GUI from non GUI calls
TFT/src/User/API/menu.c
Outdated
@@ -799,7 +798,6 @@ void setMenu(MENU_TYPE menu_type, LABEL * title, uint16_t rectCount, const GUI_R | |||
void menuSetTitle(const LABEL * title) | |||
{ | |||
curTitle = title; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as previous comment
TFT/src/User/API/menu.c
Outdated
@@ -820,7 +818,6 @@ void menuDrawTitle(void) | |||
if (toastRunning()) | |||
{ | |||
drawToast(true); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as previous comment
TFT/src/User/API/menu.c
Outdated
@@ -883,7 +880,6 @@ static void itemDrawIconPress(uint8_t position, uint8_t is_press) | |||
if (curListItems->items[position].icon == CHARICON_NULL) | |||
{ | |||
GUI_ClearPrect(rect); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as previous comment
TFT/src/User/API/Touch_Screen.c
Outdated
@@ -174,6 +175,7 @@ static inline uint8_t TS_CalibrationEnsure(uint16_t x, uint16_t y) | |||
GUI_DispStringCenter(LCD_WIDTH / 2, LCD_HEIGHT - 40, (int32_t)LABEL_ADJUST_FAILED); | |||
GUI_DispDec(0, 0, lcd_x, 3, 0); | |||
GUI_DispDec(0, 20, lcd_y, 3, 0); | |||
Buzzer_AddSound(100, 200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the buzzer call before the first GUI call and add an empty line before the first GUI call (separate GUI call from non GUI calls, when possible)
while (TS_IsPressed() == false); | ||
|
||
while (!TS_IsPressed()); | ||
Buzzer_AddSound(BUZZER_FREQUENCY_HZ, BUZZER_FREQUENCY_DURATION_MS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line before this buzzer call. while
, if
, switch
etc. must be always separated by empty line
@@ -4,6 +4,7 @@ | |||
#include "Notification.h" | |||
|
|||
#define STATUS_BAR_REFRESH_TIME 2000 // refresh time in ms | |||
uint8_t longPressed = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line before this variable definition (separate by empty line #define
etc. from variable definition etc.)
@@ -656,13 +658,12 @@ void drawBusySign(void) | |||
|
|||
busySign.status = SYS_STATUS_BUSY; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore the empty line after any if
, switch
, while
etc.
@@ -198,13 +199,11 @@ void showLiveInfo(uint8_t index, const LIVE_INFO * liveicon, bool redrawIcon); | |||
void displayExhibitHeader(const char * titleStr, const char * unitStr); | |||
void displayExhibitValue(const char * valueStr); | |||
|
|||
KEY_VALUES menuKeyGetValue(void); | |||
KEY_VALUES menuKeyGetValue(bool returnLongPressed); | |||
|
|||
// smart home | |||
#ifdef SMART_HOME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the SMART_HOME is now always supported, remove this #ifdef
from the entire project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@digant73 Thanks a lot for the feedback! I just pushed an update reflecting your input.
About the SMART_HOME thing, it's still selectable, my changes don't affect this.
But... I see no real reason why one would want to disable it, so it could be removed if you ask me.
If you agree, then I can take out the Smart Home option everywhere needed.
BTW: The current status should be made into a release... it's a stable usable base. The last release is from 2021, which is very outdated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hhmm no, if still selectable, I would avoid to remove SMART_HOME (leave it as is)
…sistent As commented by digant73 on December 17th. Thanks! Moved "return" command to separate line to be more consistent.
Add more feedback, I missed a few that were folded together in the comment section
it seems ok |
Various bugfixes and small enhancements
Requirements
No specific requirements
Description
Bug fixes
Solves various timer rollover bugs as discussed in #2832
Solves the encoder not working well bug at higher values bug (speed and feedrate)
Solves the long press freeze bug when pressing the title bar
Corrects the UART6 pins on MKS TFT35 V1.0
Enhancements
improved handling of back button and long press button, 2 additional serial baud rates
Long press functionality can now easily be added to any icon.
Adds long press functions (jump to high temp without clicking 20 times, adjust movement speed, jump to temp from extruder menu)
Allow to jump from the first page to the last page in the console and visa versa.
Benefits
Squashing bugs, and small enhancements improving usability. For example, TFTs that don't have a encoder need to be pressed 20 times to go to 200 degrees C. The long press functionality makes that a 1 click action now. The same is true for the bed, which can jump to 75 degrees, or any degree you set.
Related Issues
#2832 (closed, but was not solved).