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

Compilation warning with #define U8GLIB_SSD1306 #4614

Closed
ghost opened this issue Aug 12, 2016 · 8 comments
Closed

Compilation warning with #define U8GLIB_SSD1306 #4614

ghost opened this issue Aug 12, 2016 · 8 comments

Comments

@ghost
Copy link

ghost commented Aug 12, 2016

When #define U8GLIB_SSD1306 is enabled with newest RCBugFix, it occurs compilation error.

error message

AppData\Local\Temp\build6674025c445f92d0b07185e4e4080804.tmp\sketch\ultralcd.cpp: In function 'void lcd_update()':

ultralcd.cpp:2699: error: 'currentScreen' was not declared in this scope

           (*currentScreen)();

             ^
AppData\Local\Temp\build6674025c445f92d0b07185e4e4080804.tmp\sketch\ultralcd.cpp:426:13: warning: 'void lcd_status_screen()' defined but not used [-Wunused-function]

 static void lcd_status_screen() {

             ^

exit status 1
'currentScreen' was not declared in this scope
@thinkyhead
Copy link
Member

I think this might be the right way to fix it…

#if ENABLED(DOGLCD)  // Changes due to different driver architecture of the DOGM display
  static int8_t dot_color = 0;
  dot_color = 1 - dot_color;
  u8g.firstPage();
  do {
    lcd_setFont(FONT_MENU);
    u8g.setPrintPos(125, 0);
    u8g.setColorIndex(dot_color); // Set color for the alive dot
    u8g.drawPixel(127, 63); // draw alive dot
    u8g.setColorIndex(1); // black on white
-   (*currentScreen)();
+   #if ENABLED(ULTIPANEL)
+     (*currentScreen)();
+   #else
+     lcd_status_screen();
+   #endif
  } while (u8g.nextPage());
#elif ENABLED(ULTIPANEL)
  (*currentScreen)();
#else
  lcd_status_screen();
#endif

@ghost
Copy link
Author

ghost commented Aug 14, 2016

I got new compilation warnings.

new warning message

AppData\Local\Temp\build6674025c445f92d0b07185e4e4080804.tmp\sketch\ultralcd_impl_DOGM.h:513:13: warning: 'lcd_implementation_drawmenu_generic' defined but not used [-Wunused-function]

 static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {

             ^

AppData\Local\Temp\build6674025c445f92d0b07185e4e4080804.tmp\sketch\ultralcd_impl_DOGM.h:531:13: warning: '_drawmenu_setting_edit_generic' defined but not used [-Wunused-function]

 static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {

             ^

I'm not sure that these are problem or not, but compilation error and warning in my previous comment is gone.
Thanks for the fixing.

@ghost ghost closed this as completed Aug 14, 2016
@thinkyhead
Copy link
Member

It looks like they just aren't used if ULTIPANEL isn't set. So it's another patch I need to make.

@ghost ghost reopened this Aug 14, 2016
@zenmetsu
Copy link
Contributor

XD @thinkyhead i'd kiss ya if I could. I am working on adding my SSD1351 SPI OLED to the code and ran right into this issue. Your suggested code change came just seconds after I needed it. It works brilliantly.

@ghost ghost changed the title Compilation error with #define U8GLIB_SSD1306 Compilation warning with #define U8GLIB_SSD1306 Aug 14, 2016
@boelle
Copy link
Contributor

boelle commented Aug 14, 2016

@esenapaj does it now compile without error?

@ghost
Copy link
Author

ghost commented Aug 14, 2016

Yes it is, compilation error was fixed by commit 132322e.
But new compilation warning was occured, and it looks like that @thinkyhead work in preparation for another patch,
therefore I reopened this Issue.

@boelle
Copy link
Contributor

boelle commented Aug 16, 2016

maybe close this one and open a new on with the new warning?

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants