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

Probe offset wizard for color ui #19742

Conversation

rhapsodyv
Copy link
Member

Description

Fix probe offset wizard menu for color ui

Benefits

Fix #19738

Related Issues

#19738

@rhapsodyv
Copy link
Member Author

CI is broken until #19723 get merged.

@rhapsodyv rhapsodyv force-pushed the fix-probe_offset_wizard_menu-for-color-ui branch from 99fe6b8 to 7d1e66a Compare October 15, 2020 12:43
MENU_ITEM_ADDON_END();
MENU_ITEM_ADDON_END();
#else
SUBMENU_P(tmp, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot pass a string in SRAM to this macro. It requires a PROGMEM string. This hack will not work on platforms where string storage is specially handled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the same pattern of other places, like Marlin/src/lcd/menu/menu_motion.cpp, line 186. The SUBMENU_P will only run in hardware that support TFT_COLOR_UI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that we cannot have "free" calls to lcd_put_u8str, as it is specific for DOGM, and the menu system is used by color ui too.

Copy link
Member

@thinkyhead thinkyhead Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This usage of SUBMENU_P is not supported and it is not clear that this is a special exception for certain platforms. If this is going to be a common thing, there ought to be a SUBMENU_* that specifically takes an SRAM string. It can simply be an alias to the PROGMEM version on platforms that have no special PROGMEM accessors.

@thinkyhead
Copy link
Member

It appears from this that Color UI is not supporting menu add-ons generally. Menu item add-ons are needed to display data in ways that are not supported by the general menu item methods. If add-ons should be supplanted for Color UI (or other types of displays) it would be better to generalize the solution at the class level rather than add special cases for some types of displays in the generalized menu system. If this menu item represents something that should be more generally available, we could also add a new type of menu item to the system.

@thinkyhead thinkyhead merged commit f74b5a6 into MarlinFirmware:bugfix-2.0.x Oct 15, 2020
@rhapsodyv
Copy link
Member Author

It appears from this that Color UI is not supporting menu add-ons generally. Menu item add-ons are needed to display data in ways that are not supported by the general menu item methods. If add-ons should be supplanted for Color UI (or other types of displays) it would be better to generalize the solution at the class level rather than add special cases for some types of displays in the generalized menu system. If this menu item represents something that should be more generally available, we could also add a new type of menu item to the system.

Added to the list to make menu add-ons a class, that can be implemented by the ColorUI, as other menus.

Zorchz pushed a commit to Zorchz/Marlin-1 that referenced this pull request Oct 17, 2020
Zorchz pushed a commit to Zorchz/Marlin-1 that referenced this pull request Oct 17, 2020
thinkyhead pushed a commit to thinkyhead/Marlin that referenced this pull request Oct 21, 2020
Speaka pushed a commit to Speaka/Marlin that referenced this pull request Oct 23, 2020
@rhapsodyv rhapsodyv deleted the fix-probe_offset_wizard_menu-for-color-ui branch October 25, 2020 00:17
Speaka pushed a commit to Speaka/Marlin that referenced this pull request Nov 2, 2020
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
tharts pushed a commit to tharts/Marlin that referenced this pull request Jan 6, 2021
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
chrisjenda pushed a commit to chrisjenda/Marlin that referenced this pull request Apr 8, 2021
chrisjenda pushed a commit to chrisjenda/Marlin that referenced this pull request Apr 11, 2021
thinkyhead pushed a commit to thinkyhead/Marlin that referenced this pull request Apr 28, 2021
thinkyhead pushed a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants