Commit 4dd5fb50 authored by Simone Primarosa's avatar Simone Primarosa

Added ability to write configuration on SD

parent 78be2cbd
......@@ -406,7 +406,10 @@ bool target_direction;
#ifdef SDSUPPORT
static bool fromsd[BUFSIZE];
#endif //!SDSUPPORT
#ifdef SD_SETTINGS
unsigned long config_last_update = 0;
#endif
#endif
#ifdef FILAMENTCHANGEENABLE
bool filament_changing = false;
......@@ -751,6 +754,18 @@ void setup() {
setup_photpin();
setup_laserbeampin(); // Initialize Laserbeam pin
servo_init();
#ifdef SDSUPPORT
card.initsd();
#endif
// loads custom configuration from SDCARD if available else uses defaults
#ifdef SDSTUPPORT
if(!IS_SD_INSERTED) ConfigSD_ResetDefault();
else
#endif
{
ConfigSD_RetrieveSettings();
}
lcd_init();
_delay_ms(1000); // wait 1sec to display the splash screen
......@@ -6872,7 +6887,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
if (!filament_changing)
#endif
{
if(degHotend(active_extruder) < IDLE_OOZING_MAXTEMP && degTargetHotend(active_extruder) < IDLE_OOZING_MINTEMP) {
if(degTargetHotend(active_extruder) < IDLE_OOZING_MINTEMP) {
IDLE_OOZING_retract(false);
}
else if((millis() - axis_last_activity) > IDLE_OOZING_SECONDS*1000) {
......@@ -6882,6 +6897,18 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
}
#endif
#if defined(SDSUPPORT) && defined(SD_SETTINGS)
if(!config_readed) {
ConfigSD_RetrieveSettings(true);
}
else if((millis() - config_last_update) > SD_CFG_SECONDS*1000) {
ConfigSD_StoreSettings();
}
#endif
#ifdef TEMP_STAT_LEDS
handle_status_leds();
#endif
#ifdef TEMP_STAT_LEDS
handle_status_leds();
#endif
......
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