Commit 9a3533ea authored by Simone Primarosa's avatar Simone Primarosa

Update 4.1.5 dev

Aggiunto un punto nella posizione (0,0) dello schermo che si accende
quando vengono salvate le configurazioni sull'SD.
Il puntino serve ad avvisare l'utente che non deve rimuovere l'SD in
quel momento altrimenti il filesystem potrebbe corrompersi.
parent ee2e2dd6
### Version 4.1.5
* Added dot for SD write operation
* Added statistics menu
* Added an overall configuration file
* Added M70 gcode for calibrate AC721 current sensor
......
......@@ -854,6 +854,8 @@ void ConfigSD_ResetDefault() {
void ConfigSD_StoreSettings() {
if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting) return;
set_sd_dot();
delay(500);
card.setroot(true);
card.openFile(CFG_SD_FILE, false, true, false);
char buff[CFG_SD_MAX_VALUE_LEN];
......@@ -867,10 +869,14 @@ void ConfigSD_ResetDefault() {
card.closeFile(false);
card.setlast();
config_last_update = millis();
delay(500);
unset_sd_dot();
}
void ConfigSD_RetrieveSettings(bool addValue) {
if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting || !card.cardOK) return;
set_sd_dot();
delay(500);
char key[CFG_SD_MAX_KEY_LEN], value[CFG_SD_MAX_VALUE_LEN];
int k_idx;
int k_len, v_len;
......@@ -901,6 +907,8 @@ void ConfigSD_ResetDefault() {
card.closeFile(false);
card.setlast();
config_readed = true;
delay(500);
unset_sd_dot();
}
int ConfigSD_KeyIndex(char *key) { //At the moment a binary search algorithm is used for simplicity, if it will be necessary (Eg. tons of key), an hash search algorithm will be implemented.
......
......@@ -1684,6 +1684,27 @@ int lcd_strlen_P(const char *s) {
return j;
}
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
void set_sd_dot() {
u8g.firstPage();
do {
u8g.setColorIndex(1);
u8g.drawPixel(0, 0); // draw sd dot
u8g.setColorIndex(1); // black on white
(*currentMenu)();
} while( u8g.nextPage() );
}
void unset_sd_dot() {
u8g.firstPage();
do {
u8g.setColorIndex(0);
u8g.drawPixel(0, 0); // draw sd dot
u8g.setColorIndex(1); // black on white
(*currentMenu)();
} while( u8g.nextPage() );
}
#endif
/**
* Update the LCD, read encoder buttons, etc.
* - Read button states
......
......@@ -48,6 +48,11 @@
#else
FORCE_INLINE void lcd_buttons_update() {}
#endif
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
extern void set_sd_dot();
extern void unset_sd_dot();
#endif
extern int plaPreheatHotendTemp;
extern int plaPreheatHPBTemp;
......
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