Commit 98de6b2f authored by MagoKimbra's avatar MagoKimbra

Disable SDSUPPORT by default

parent 70ff66cb
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#if ENABLED(MAKRPANEL) #if ENABLED(MAKRPANEL)
#define DOGLCD #define DOGLCD
#define SDSUPPORT
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL #define NEWPANEL
...@@ -38,7 +37,6 @@ ...@@ -38,7 +37,6 @@
#endif #endif
#if ENABLED(PANEL_ONE) #if ENABLED(PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER #define ULTIMAKERCONTROLLER
#endif #endif
...@@ -84,7 +82,6 @@ ...@@ -84,7 +82,6 @@
#if ENABLED(MINIPANEL) #if ENABLED(MINIPANEL)
#define DOGLCD #define DOGLCD
#define SDSUPPORT
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL #define NEWPANEL
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
...@@ -151,7 +148,6 @@ ...@@ -151,7 +148,6 @@
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
#define NEWPANEL //enable this if you have a click-encoder panel #define NEWPANEL //enable this if you have a click-encoder panel
#define SDSUPPORT
#define ULTRA_LCD #define ULTRA_LCD
#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
#define LCD_WIDTH 22 #define LCD_WIDTH 22
......
...@@ -326,7 +326,7 @@ static void lcd_status_screen() { ...@@ -326,7 +326,7 @@ static void lcd_status_screen() {
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
millis_t ms = millis(); millis_t ms = millis();
#if DISABLED(ROGRESS_MSG_ONCE) #if DISABLED(PROGRESS_MSG_ONCE)
if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
progress_bar_ms = ms; progress_bar_ms = ms;
} }
...@@ -334,22 +334,25 @@ static void lcd_status_screen() { ...@@ -334,22 +334,25 @@ static void lcd_status_screen() {
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
// Handle message expire // Handle message expire
if (expire_status_ms > 0) { if (expire_status_ms > 0) {
if (card.isFileOpen()) { #if ENABLED(SDSUPPORT)
// Expire the message when printing is active if (card.isFileOpen()) {
if (IS_SD_PRINTING) {
// Expire the message when printing is active // Expire the message when printing is active
if (ms >= expire_status_ms) { if (IS_SD_PRINTING) {
lcd_status_message[0] = '\0'; if (ms >= expire_status_ms) {
expire_status_ms = 0; lcd_status_message[0] = '\0';
expire_status_ms = 0;
}
}
else {
expire_status_ms += LCD_UPDATE_INTERVAL;
} }
} }
else { else {
expire_status_ms += LCD_UPDATE_INTERVAL; expire_status_ms = 0;
} }
} #else
else {
expire_status_ms = 0; expire_status_ms = 0;
} #endif // SDSUPPORT
} }
#endif #endif
#endif //LCD_PROGRESS_BAR #endif //LCD_PROGRESS_BAR
...@@ -426,7 +429,7 @@ static void lcd_status_screen() { ...@@ -426,7 +429,7 @@ static void lcd_status_screen() {
feedrate_multiplier = constrain(feedrate_multiplier, 10, 999); feedrate_multiplier = constrain(feedrate_multiplier, 10, 999);
#endif //ULTIPANEL #endif // ULTIPANEL
} }
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
...@@ -434,6 +437,7 @@ static void lcd_status_screen() { ...@@ -434,6 +437,7 @@ static void lcd_status_screen() {
static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
static void lcd_sdcard_pause() { card.pauseSDPrint(); } static void lcd_sdcard_pause() { card.pauseSDPrint(); }
static void lcd_sdcard_resume() { card.startFileprint(); } static void lcd_sdcard_resume() { card.startFileprint(); }
...@@ -446,7 +450,8 @@ static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); } ...@@ -446,7 +450,8 @@ static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
cancel_heatup = true; cancel_heatup = true;
lcd_setstatus(MSG_PRINT_ABORTED, true); lcd_setstatus(MSG_PRINT_ABORTED, true);
} }
#endif
#endif // SDSUPPORT
/** /**
* *
...@@ -492,7 +497,7 @@ static void lcd_main_menu() { ...@@ -492,7 +497,7 @@ static void lcd_main_menu() {
MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
#endif #endif
} }
#endif //SDSUPPORT #endif // SDSUPPORT
END_MENU(); END_MENU();
} }
...@@ -1416,57 +1421,61 @@ static void lcd_control_volumetric_menu() { ...@@ -1416,57 +1421,61 @@ static void lcd_control_volumetric_menu() {
} }
#endif // FWRETRACT #endif // FWRETRACT
#if !PIN_EXISTS(SD_DETECT) #if ENABLED(SDSUPPORT)
static void lcd_sd_refresh() {
card.initsd();
currentMenuViewOffset = 0;
}
#endif
static void lcd_sd_updir() { #if !PIN_EXISTS(SD_DETECT)
card.updir(); static void lcd_sd_refresh() {
currentMenuViewOffset = 0; card.initsd();
} currentMenuViewOffset = 0;
}
#endif
/** static void lcd_sd_updir() {
* card.updir();
* "Print from SD" submenu currentMenuViewOffset = 0;
*
*/
void lcd_sdcard_menu() {
if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
uint16_t fileCnt = card.getnrfilenames();
START_MENU(lcd_main_menu);
MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
card.getWorkDirName();
if (card.filename[0] == '/') {
#if !PIN_EXISTS(SD_DETECT)
MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
#endif
}
else {
MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
} }
for (uint16_t i = 0; i < fileCnt; i++) { /**
if (_menuItemNr == _lineNr) { *
card.getfilename( * "Print from SD" submenu
#if ENABLED(SDCARD_RATHERRECENTFIRST) *
fileCnt-1 - */
#endif void lcd_sdcard_menu() {
i if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
); uint16_t fileCnt = card.getnrfilenames();
if (card.filenameIsDir) START_MENU(lcd_main_menu);
MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
else card.getWorkDirName();
MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename); if (card.filename[0] == '/') {
#if !PIN_EXISTS(SD_DETECT)
MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
#endif
} }
else { else {
MENU_ITEM_DUMMY(); MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
} }
for (uint16_t i = 0; i < fileCnt; i++) {
if (_menuItemNr == _lineNr) {
card.getfilename(
#if ENABLED(SDCARD_RATHERRECENTFIRST)
fileCnt-1 -
#endif
i
);
if (card.filenameIsDir)
MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
else
MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
}
else {
MENU_ITEM_DUMMY();
}
}
END_MENU();
} }
END_MENU();
} #endif // SDSUPPORT
/** /**
* *
...@@ -1620,10 +1629,16 @@ static void menu_action_sdfile(const char* filename, char* longFilename) { ...@@ -1620,10 +1629,16 @@ static void menu_action_sdfile(const char* filename, char* longFilename) {
enqueuecommands_P(PSTR("M24")); enqueuecommands_P(PSTR("M24"));
lcd_return_to_status(); lcd_return_to_status();
} }
static void menu_action_sddirectory(const char* filename, char* longFilename) {
card.chdir(filename); #if ENABLED(SDSUPPORT)
encoderPosition = 0;
} static void menu_action_sddirectory(const char* filename, char* longFilename) {
card.chdir(filename);
encoderPosition = 0;
}
#endif
static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { *ptr = !(*ptr); } static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { *ptr = !(*ptr); }
static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) { static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) {
menu_action_setting_edit_bool(pstr, ptr); menu_action_setting_edit_bool(pstr, ptr);
...@@ -1727,7 +1742,8 @@ void lcd_update() { ...@@ -1727,7 +1742,8 @@ void lcd_update() {
lcd_buttons_update(); lcd_buttons_update();
#if PIN_EXISTS(SD_DETECT) #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
if (IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()) { if (IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()) {
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
lcd_oldcardstatus = IS_SD_INSERTED; lcd_oldcardstatus = IS_SD_INSERTED;
...@@ -1746,8 +1762,9 @@ void lcd_update() { ...@@ -1746,8 +1762,9 @@ void lcd_update() {
LCD_MESSAGEPGM(MSG_SD_REMOVED); LCD_MESSAGEPGM(MSG_SD_REMOVED);
} }
} }
#endif//CARDINSERTED
#endif // SDSUPPORT && SD_DETECT_PIN
millis_t ms = millis(); millis_t ms = millis();
if (ms > next_lcd_update_ms) { if (ms > next_lcd_update_ms) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment