ErikZalm/Marlin — pull request #561 by Brendan-csel (2013-07-29 09:27:10+00:00)
Title: Fix for Viki LCD issues printing from SD card

There has been some discussion about problems printing directly from the SD card using the Viki LCD (https://groups.google.com/forum/?fromgroups#!topic/makergear/G23y21KWTmI).

This appears to be due to the SD menu refreshing so slowly that the button interrupt clears the state of `LCD_CLICKED` before file menu items get rendered and actioned. The first attached commit saves `LCD_CLICKED` when the menu refresh starts and then uses that saved value later which seems to resolve the issue (from testing on my Makergear M2).

The second commit attached adds a check at the top of the SD menu function and bails out if no drawing updates are required and a button has not been clicked. This is to save the menu from re-reading the SD card contents every 100ms to refresh itself.

Sorry for combining two commits in the same pull request (I'm still learning how to use Github).