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

Resolve error with print info on machines without extruders #27664

Open
wants to merge 1 commit into
base: bugfix-2.1.x
Choose a base branch
from

Conversation

Patronics
Copy link

Description

When configuring a machine with no extruders (such as a CNC mill or laser cutter), if the "PRINTCOUNTER" and "LCD_INFO_MENU" are enabled, the existing marlin releases fail to build, with the following errors:

Marlin/src/lcd/menu/menu_info.cpp: In function 'void menu_info_stats()':
Marlin/src/lcd/menu/menu_info.cpp:67:22: error: 'struct printStatistics' has no member named 'filamentUsed'
         , long(stats.filamentUsed / 1000)
                      ^~~~~~~~~~~~
Marlin/src/lcd/menu/menu_info.cpp:68:25: error: 'struct printStatistics' has no member named 'filamentUsed'
         , int16_t(stats.filamentUsed / 100) % 10

This commit resolves that by checking if any extruders are present before attempting to print filamentUsed.

Requirements

Only applicable when EXTRUDERS is defined as 0, and when LCD_INFO_MENU and PRINTCOUNTER are enabled. Otherwise has no effect.

Benefits

Fixes failure to build under the circumstances described above.

Configurations

Configurations.zip

Related Issues

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.

1 participant