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

Wrap all items depending on ULTIPANEL #4011

Merged
merged 2 commits into from
Jun 11, 2016

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Jun 11, 2016

To view differences without whitespace use this link.

  • Also changes menu to screen because not all screens are menus

@thinkyhead thinkyhead force-pushed the rc_manual_move_cond branch 2 times, most recently from b8a0145 to 3d3a35d Compare June 11, 2016 21:32
@thinkyhead thinkyhead force-pushed the rc_manual_move_cond branch from 3d3a35d to ae9b09f Compare June 11, 2016 21:53
@AnHardt
Copy link
Contributor

AnHardt commented Jun 11, 2016

-        (*currentMenu)();
+        #if ENABLED(ULTIPANEL)
+          (*currentScreen)();
+        #else
+          lcd_status_screen();
+        #endif

Maybe i'm bit slow this evening.
Without buttons -> no menu -> you can't change *currentScreen -> you can't leave the status screen.
So, why differentiate here?

@thinkyhead
Copy link
Member Author

why differentiate here?

Because now currentScreen isn't even defined without ULTIPANEL.

@thinkyhead thinkyhead merged commit d50ba08 into MarlinFirmware:RCBugFix Jun 11, 2016
@thinkyhead thinkyhead deleted the rc_manual_move_cond branch June 11, 2016 22:26
@AnHardt
Copy link
Contributor

AnHardt commented Jun 11, 2016

Shouldn't trow

      #if ENABLED(ULTIPANEL)
         (*currentScreen)();
       #else
         (*currentScreen)();
       #endif

an error if only ULTRA_LCD is defined?

@thinkyhead
Copy link
Member Author

Let's see. There are two instances of this little block.

The first one is wrapped in #if ENABLED(DOGLCD) so as long as ULTIPANEL and DOGLCD are mutually-exclusive, that can go back to just plain (*currentScreen)().

The second one would still apply. So we get…

#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)();
  } while (u8g.nextPage());
#elif ENABLED(ULTIPANEL)
  (*currentScreen)();
#else
  lcd_status_screen();
#endif

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.

3 participants