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

Graphical TFT fixes, cleanup #20861

Merged
merged 32 commits into from
Jan 25, 2021

Conversation

tpruvot
Copy link
Contributor

@tpruvot tpruvot commented Jan 23, 2021

lcd_put_wchar_max needed for 480x320 too

followup of #20838

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 23, 2021

on hold, need to do more tests... Level Corners output seems messed up in color ui... but its not related to this PR changes

image

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 23, 2021

k, its the best i can do for now....

image

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 23, 2021

@rhapsodyv i let you try on the 480x320 ?

@rhapsodyv
Copy link
Member

@tpruvot Idea: instead of having a cursor to drawing, it would not be better to lcd_put_* just concatenate data to the current tft_string, and then we just add a new method to be called: tft.draw_current_string.

With this approach, we just need add one call at the final of all lcd_put_* calls, instead of having to add customized lcd_move_to everywhere.

What do you think?

lcd_put_wchar_max needed for 480x320 too
MENU_ITEM_HEIGHT & adjust right column
@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

I rebased + squashed the 2 last commits in one...

There may be other screens to check i'm unable to test for now :

Marlin/src/feature/power_monitor.cpp:60 (amps/volts/watts)
Marlin/src/lcd/menu/menu_mixer.cpp:60
Marlin/src/lcd/menu/menu_mixer.cpp:117
Marlin/src/lcd/menu/menu_tune.cpp:75 (babystep, testable if i enable it)

will try also to print a matrix of all lines/columns, ive the feeling the rows are truncated...

also lcd_put_int(int) is not implemented in color ui

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

tested ok, but i still get crash/weird issue on a matrix test

#if ENABLED(TFT_COLOR_UI)
    for (y=0; y<7; y++) {
      for (uint8_t x=0; x<16; x++) {
        lcd_moveto(x, y);
        lcd_put_int(x);
      }
    }
#endif

with x<14 that displays it

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

k, my test issue was stack problem when doing too much lcd_put_int(x) on the same row...
for (uint8_t x=5; x<17; x++) works

x out of range tested ok & ignored so... 7x20 on 320x240

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

before merging, i think we can reenable Marlin/src/inc/SanityCheck.h:806

-  #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) && ANY(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)
-    #error "New Color UI (TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI) does not support BABYSTEP_DISPLAY_TOTAL yet."

code is similar, in Marlin/src/lcd/menu/menu_tune.cpp

at least its built now... but didnt test in real conditions

@thinkyhead
Copy link
Member

reenable … SanityCheck

The sanity check is already enabled.
Do you mean, we should remove it?

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

yes, display is not perfect but its readable, erk was not easy to find it :p but Z Probe Babystep is ok

image

need to start a print to access the tune menu... painful

"last row" is not the good place i think... that overflow the buttons... and you increased the line height to 34... imo should be 30 or 32 (on 320x240)

erk, code using lcd_put_u8str_P(GET_TEXT(MSG_BABYSTEP_TOTAL)); which doesnt increment our X cursor

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

just void menu_pause_option(); to move and that build it

@thinkyhead
Copy link
Member

Seemed like a good time to collect the common pieces in one place. More parts of those files can probably be moved into ui_common.cpp if more positional defines are added to the headers, or if common positioning can be used just fine where they now differ.

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

indeed, to avoid multiple edit on helper functions at least ;)

@tpruvot
Copy link
Contributor Author

tpruvot commented Jan 25, 2021

else, this refactor didn't broke the display... tested ok

@thinkyhead
Copy link
Member

I don't mind merging this for wider testing at this point….

@thinkyhead thinkyhead merged commit c12be1f into MarlinFirmware:bugfix-2.0.x Jan 25, 2021
@thinkyhead thinkyhead changed the title color_ui: do not ignore maxlen params + 480x320 Graphical TFT fixes, cleanup Jan 25, 2021
@tpruvot tpruvot deleted the color_ui_maxlen branch January 25, 2021 08:17
TyMi pushed a commit to TyMi/Marlin that referenced this pull request Jan 25, 2021
…_bugfix

* commit '876c2586b9146dd123af4c7b21138b8239ef5d39': (116 commits)
  Clean up MMU2 code (MarlinFirmware#20794)
  Init KILL, SUICIDE, PSU earlier (MarlinFirmware#20810)
  "Move … code" followup (MarlinFirmware#20869)
  Apply SEC_TO_MS and other fixes
  Reformat abortSDPrinting
  Fix sign warning (MarlinFirmware#20872)
  Cosmetic changes (2) (MarlinFirmware#20876)
  "Move … code" followup (MarlinFirmware#20868)
  "Move … code" followup (MarlinFirmware#20874)
  Graphical TFT fixes, cleanup (MarlinFirmware#20861)
  🧻 Cosmetic changes (MarlinFirmware#20859)
  🛠Fix deps script version regex
  Fix Ender 3 V2 DWIN manual move (MarlinFirmware#20837)
  [cron] Bump distribution date (2021-01-25)
  Fix LiquidCrystal CI failures (MarlinFirmware#20873)
  Revert "Adding custom move feedrate for G26 (MarlinFirmware#20729)" (MarlinFirmware#20870)
  MeatPack serial encoding (MarlinFirmware#20802)
  [cron] Bump distribution date (2021-01-24)
  lcd_put_wchar_max for COLOR_UI (MarlinFirmware#20838)
  Adding custom move feedrate for G26 (MarlinFirmware#20729)
  ...

# Conflicts:
#	Marlin/Configuration.h
#	Marlin/Configuration_adv.h
@thisiskeithb
Copy link
Member

Give this Anet ET5X/Anet TFT35 config a build. Rebased against c74f972 from ~40 mins ago.

Full error output:
Compiling .pio/build/Anet_ET4_OpenBLT/src/src/lcd/tft/ui_common.cpp.o
Compiling .pio/build/Anet_ET4_OpenBLT/src/src/lcd/tft_io/tft_io.cpp.o
In file included from Marlin/src/lcd/tft/../../inc/../core/boards.h:24,
                 from Marlin/src/lcd/tft/../../inc/MarlinConfigPre.h:37,
                 from Marlin/src/lcd/tft/tft_image.cpp:23:
Marlin/src/lcd/tft/tft_image.cpp:77:75: error: 'MARLIN_LOGO_FULL_SIZE' was not declared in this scope
   77 |   TERN(SHOW_BOOTSCREEN, TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MARLIN_LOGO_FULL_SIZE), NoLogo),
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:443:26: note: in definition of macro 'THIRD'
  443 | #define THIRD(a,b,c,...) c
      |                          ^
Marlin/src/lcd/tft/../../inc/../core/macros.h:192:29: note: in expansion of macro '___TERN'
  192 | #define __TERN(T,V...)      ___TERN(_CAT(_NO,T),V)  // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
      |                             ^~~~Compiling .pio/build/Anet_ET4_OpenBLT/src/src/lcd/tft_io/touch_calibration.cpp.o
~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:191:29: note: in expansion of macro '__TERN'
  191 | #define _TERN(E,V...)       __TERN(_CAT(T_,E),V)    // Prepend 'T_' to get 'T_0' or 'T_1'
      |                             ^~~~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:187:29: note: in expansion of macro '_TERN'
  187 | #define TERN(O,A,B)         _TERN(_ENA_1(O),B,A)    // OPTION converted to '0' or '1'
      |                             ^~~~~
Marlin/src/lcd/tft/tft_image.cpp:77:3: note: in expansion of macro 'TERN'
   77 |   TERN(SHOW_BOOTSCREEN, TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MARLIN_LOGO_FULL_SIZE), NoLogo),
      |   ^~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:193:29: note: in expansion of macro 'THIRD'
  193 | #define ___TERN(P,V...)     THIRD(P,V)              // If first argument has a comma, A. Else B.
      |                             ^~~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:192:29: note: in expansion of macro '___TERN'
  192 | #define __TERN(T,V...)      ___TERN(_CAT(_NO,T),V)  // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
      |                             ^~~~~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:191:29: note: in expansion of macro '__TERN'
  191 | #define _TERN(E,V...)       __TERN(_CAT(T_,E),V)    // Prepend 'T_' to get 'T_0' or 'T_1'
      |                             ^~~~~~
Marlin/src/lcd/tft/../../inc/../core/macros.h:187:29: note: in expansion of macro '_TERN'
  187 | #define TERN(O,A,B)         _TERN(_ENA_1(O),B,A)    // OPTION converted to '0' or '1'
      |                             ^~~~~
Marlin/src/lcd/tft/tft_image.cpp:77:25: note: in expansion of macro 'TERN'
   77 |   TERN(SHOW_BOOTSCREEN, TERN(BOOT_MARLIN_LOGO_SMALL, MarlinLogo195x59x16, MARLIN_LOGO_FULL_SIZE), NoLogo),
      |                         ^~~~
Compiling .pio/build/Anet_ET4_OpenBLT/src/src/libs/buzzer.cpp.o
Compiling .pio/build/Anet_ET4_OpenBLT/src/src/libs/crc16.cpp.o
Compiling .pio/build/Anet_ET4_OpenBLT/src/src/libs/nozzle.cpp.o
Compiling .pio/build/Anet_ET4_OpenBLT/src/src/libs/numtostr.cpp.o
*** [.pio/build/Anet_ET4_OpenBLT/src/src/lcd/tft/tft_image.cpp.o] Error 1

#20861 appears to be the bug source according to a little git blame.

I have BOOT_MARLIN_LOGO_SMALL disabled, but enabling it causes the build to succeed.

Jyers pushed a commit to Jyers/Marlin that referenced this pull request Feb 3, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit that referenced this pull request Apr 30, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants