ConfigurationStore.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. #include "Marlin.h"
  2. #include "planner.h"
  3. #include "temperature.h"
  4. #include "ultralcd.h"
  5. #include "ConfigurationStore.h"
  6. #include "Configuration_prusa.h"
  7. #ifdef MESH_BED_LEVELING
  8. #include "mesh_bed_leveling.h"
  9. #endif
  10. void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size)
  11. {
  12. while (size--) {
  13. uint8_t * const p = (uint8_t * const)pos;
  14. uint8_t v = *value;
  15. // EEPROM has only ~100,000 write cycles,
  16. // so only write bytes that have changed!
  17. if (v != eeprom_read_byte(p)) {
  18. eeprom_write_byte(p, v);
  19. if (eeprom_read_byte(p) != v) {
  20. SERIAL_ECHOLNPGM("EEPROM Error");
  21. return;
  22. }
  23. }
  24. pos++;
  25. value++;
  26. };
  27. }
  28. #define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
  29. void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
  30. {
  31. do
  32. {
  33. *value = eeprom_read_byte((unsigned char*)pos);
  34. pos++;
  35. value++;
  36. }while(--size);
  37. }
  38. #define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
  39. //======================================================================================
  40. #define EEPROM_OFFSET 20
  41. // IMPORTANT: Whenever there are changes made to the variables stored in EEPROM
  42. // in the functions below, also increment the version number. This makes sure that
  43. // the default values are used whenever there is a change to the data, to prevent
  44. // wrong data being written to the variables.
  45. // ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
  46. #define EEPROM_VERSION "V2"
  47. #ifdef EEPROM_SETTINGS
  48. void Config_StoreSettings(uint16_t offset, uint8_t level)
  49. {
  50. char ver[4]= "000";
  51. int i = offset;
  52. EEPROM_WRITE_VAR(i,ver); // invalidate data first
  53. EEPROM_WRITE_VAR(i,axis_steps_per_unit);
  54. EEPROM_WRITE_VAR(i,max_feedrate);
  55. EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second);
  56. EEPROM_WRITE_VAR(i,acceleration);
  57. EEPROM_WRITE_VAR(i,retract_acceleration);
  58. EEPROM_WRITE_VAR(i,minimumfeedrate);
  59. EEPROM_WRITE_VAR(i,mintravelfeedrate);
  60. EEPROM_WRITE_VAR(i,minsegmenttime);
  61. EEPROM_WRITE_VAR(i,max_jerk[X_AXIS]);
  62. EEPROM_WRITE_VAR(i,max_jerk[Y_AXIS]);
  63. EEPROM_WRITE_VAR(i,max_jerk[Z_AXIS]);
  64. EEPROM_WRITE_VAR(i,max_jerk[E_AXIS]);
  65. EEPROM_WRITE_VAR(i,add_homing);
  66. #ifndef ULTIPANEL
  67. int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
  68. int absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
  69. #endif
  70. /* EEPROM_WRITE_VAR(i,plaPreheatHotendTemp);
  71. EEPROM_WRITE_VAR(i,plaPreheatHPBTemp);
  72. EEPROM_WRITE_VAR(i,plaPreheatFanSpeed);
  73. EEPROM_WRITE_VAR(i,absPreheatHotendTemp);
  74. EEPROM_WRITE_VAR(i,absPreheatHPBTemp);
  75. EEPROM_WRITE_VAR(i,absPreheatFanSpeed);
  76. */
  77. EEPROM_WRITE_VAR(i,zprobe_zoffset);
  78. #ifdef PIDTEMP
  79. EEPROM_WRITE_VAR(i,Kp);
  80. EEPROM_WRITE_VAR(i,Ki);
  81. EEPROM_WRITE_VAR(i,Kd);
  82. #else
  83. float dummy = 3000.0f;
  84. EEPROM_WRITE_VAR(i,dummy);
  85. dummy = 0.0f;
  86. EEPROM_WRITE_VAR(i,dummy);
  87. EEPROM_WRITE_VAR(i,dummy);
  88. #endif
  89. #ifdef PIDTEMPBED
  90. EEPROM_WRITE_VAR(i, bedKp);
  91. EEPROM_WRITE_VAR(i, bedKi);
  92. EEPROM_WRITE_VAR(i, bedKd);
  93. #endif
  94. #ifndef DOGLCD
  95. int lcd_contrast = 32;
  96. #endif
  97. EEPROM_WRITE_VAR(i,lcd_contrast);
  98. #ifdef FWRETRACT
  99. EEPROM_WRITE_VAR(i,autoretract_enabled);
  100. EEPROM_WRITE_VAR(i,retract_length);
  101. #if EXTRUDERS > 1
  102. EEPROM_WRITE_VAR(i,retract_length_swap);
  103. #endif
  104. EEPROM_WRITE_VAR(i,retract_feedrate);
  105. EEPROM_WRITE_VAR(i,retract_zlift);
  106. EEPROM_WRITE_VAR(i,retract_recover_length);
  107. #if EXTRUDERS > 1
  108. EEPROM_WRITE_VAR(i,retract_recover_length_swap);
  109. #endif
  110. EEPROM_WRITE_VAR(i,retract_recover_feedrate);
  111. #endif
  112. // Save filament sizes
  113. EEPROM_WRITE_VAR(i, volumetric_enabled);
  114. EEPROM_WRITE_VAR(i, filament_size[0]);
  115. #if EXTRUDERS > 1
  116. EEPROM_WRITE_VAR(i, filament_size[1]);
  117. #if EXTRUDERS > 2
  118. EEPROM_WRITE_VAR(i, filament_size[2]);
  119. #endif
  120. #endif
  121. #ifdef LIN_ADVANCE
  122. if (level >= 10) {
  123. EEPROM_WRITE_VAR(i, extruder_advance_k);
  124. EEPROM_WRITE_VAR(i, advance_ed_ratio);
  125. }
  126. #endif //LIN_ADVANCE
  127. /* MYSERIAL.print("Top address used:\n");
  128. MYSERIAL.print(i);
  129. MYSERIAL.print("; (0x");
  130. MYSERIAL.print(i, HEX);
  131. MYSERIAL.println(")");
  132. */
  133. char ver2[4]=EEPROM_VERSION;
  134. i=offset;
  135. EEPROM_WRITE_VAR(i,ver2); // validate data
  136. SERIAL_ECHO_START;
  137. SERIAL_ECHOLNPGM("Settings Stored");
  138. }
  139. #endif //EEPROM_SETTINGS
  140. #ifndef DISABLE_M503
  141. void Config_PrintSettings(uint8_t level)
  142. { // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
  143. SERIAL_ECHO_START;
  144. SERIAL_ECHOLNPGM("Steps per unit:");
  145. SERIAL_ECHO_START;
  146. SERIAL_ECHOPAIR(" M92 X",axis_steps_per_unit[X_AXIS]);
  147. SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[Y_AXIS]);
  148. SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[Z_AXIS]);
  149. SERIAL_ECHOPAIR(" E",axis_steps_per_unit[E_AXIS]);
  150. SERIAL_ECHOLN("");
  151. SERIAL_ECHO_START;
  152. SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
  153. SERIAL_ECHO_START;
  154. SERIAL_ECHOPAIR(" M203 X", max_feedrate[X_AXIS]);
  155. SERIAL_ECHOPAIR(" Y", max_feedrate[Y_AXIS]);
  156. SERIAL_ECHOPAIR(" Z", max_feedrate[Z_AXIS]);
  157. SERIAL_ECHOPAIR(" E", max_feedrate[E_AXIS]);
  158. SERIAL_ECHOLN("");
  159. SERIAL_ECHO_START;
  160. SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
  161. SERIAL_ECHO_START;
  162. SERIAL_ECHOPAIR(" M201 X" ,max_acceleration_units_per_sq_second[X_AXIS] );
  163. SERIAL_ECHOPAIR(" Y" , max_acceleration_units_per_sq_second[Y_AXIS] );
  164. SERIAL_ECHOPAIR(" Z" ,max_acceleration_units_per_sq_second[Z_AXIS] );
  165. SERIAL_ECHOPAIR(" E" ,max_acceleration_units_per_sq_second[E_AXIS]);
  166. SERIAL_ECHOLN("");
  167. SERIAL_ECHO_START;
  168. SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
  169. SERIAL_ECHO_START;
  170. SERIAL_ECHOPAIR(" M204 S",acceleration );
  171. SERIAL_ECHOPAIR(" T" ,retract_acceleration);
  172. SERIAL_ECHOLN("");
  173. SERIAL_ECHO_START;
  174. SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)");
  175. SERIAL_ECHO_START;
  176. SERIAL_ECHOPAIR(" M205 S",minimumfeedrate );
  177. SERIAL_ECHOPAIR(" T" ,mintravelfeedrate );
  178. SERIAL_ECHOPAIR(" B" ,minsegmenttime );
  179. SERIAL_ECHOPAIR(" X" ,max_jerk[X_AXIS] );
  180. SERIAL_ECHOPAIR(" Y" ,max_jerk[Y_AXIS] );
  181. SERIAL_ECHOPAIR(" Z" ,max_jerk[Z_AXIS] );
  182. SERIAL_ECHOPAIR(" E" ,max_jerk[E_AXIS] );
  183. SERIAL_ECHOLN("");
  184. SERIAL_ECHO_START;
  185. SERIAL_ECHOLNPGM("Home offset (mm):");
  186. SERIAL_ECHO_START;
  187. SERIAL_ECHOPAIR(" M206 X",add_homing[X_AXIS] );
  188. SERIAL_ECHOPAIR(" Y" ,add_homing[Y_AXIS] );
  189. SERIAL_ECHOPAIR(" Z" ,add_homing[Z_AXIS] );
  190. SERIAL_ECHOLN("");
  191. #ifdef PIDTEMP
  192. SERIAL_ECHO_START;
  193. SERIAL_ECHOLNPGM("PID settings:");
  194. SERIAL_ECHO_START;
  195. SERIAL_ECHOPAIR(" M301 P",Kp);
  196. SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki));
  197. SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd));
  198. SERIAL_ECHOLN("");
  199. #endif
  200. #ifdef PIDTEMPBED
  201. SERIAL_ECHO_START;
  202. SERIAL_ECHOLNPGM("PID heatbed settings:");
  203. SERIAL_ECHO_START;
  204. SERIAL_ECHOPAIR(" M304 P", bedKp);
  205. SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi));
  206. SERIAL_ECHOPAIR(" D", unscalePID_d(bedKd));
  207. SERIAL_ECHOLN("");
  208. #endif
  209. #ifdef FWRETRACT
  210. SERIAL_ECHO_START;
  211. SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
  212. SERIAL_ECHO_START;
  213. SERIAL_ECHOPAIR(" M207 S",retract_length);
  214. SERIAL_ECHOPAIR(" F" ,retract_feedrate*60);
  215. SERIAL_ECHOPAIR(" Z" ,retract_zlift);
  216. SERIAL_ECHOLN("");
  217. SERIAL_ECHO_START;
  218. SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
  219. SERIAL_ECHO_START;
  220. SERIAL_ECHOPAIR(" M208 S",retract_recover_length);
  221. SERIAL_ECHOPAIR(" F", retract_recover_feedrate*60);
  222. SERIAL_ECHOLN("");
  223. SERIAL_ECHO_START;
  224. SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
  225. SERIAL_ECHO_START;
  226. SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0));
  227. SERIAL_ECHOLN("");
  228. #if EXTRUDERS > 1
  229. SERIAL_ECHO_START;
  230. SERIAL_ECHOLNPGM("Multi-extruder settings:");
  231. SERIAL_ECHO_START;
  232. SERIAL_ECHOPAIR(" Swap retract length (mm): ", retract_length_swap);
  233. SERIAL_ECHOLN("");
  234. SERIAL_ECHO_START;
  235. SERIAL_ECHOPAIR(" Swap rec. addl. length (mm): ", retract_recover_length_swap);
  236. SERIAL_ECHOLN("");
  237. #endif
  238. SERIAL_ECHO_START;
  239. if (volumetric_enabled) {
  240. SERIAL_ECHOLNPGM("Filament settings:");
  241. SERIAL_ECHO_START;
  242. SERIAL_ECHOPAIR(" M200 D", filament_size[0]);
  243. SERIAL_ECHOLN("");
  244. #if EXTRUDERS > 1
  245. SERIAL_ECHO_START;
  246. SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]);
  247. SERIAL_ECHOLN("");
  248. #if EXTRUDERS > 2
  249. SERIAL_ECHO_START;
  250. SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]);
  251. SERIAL_ECHOLN("");
  252. #endif
  253. #endif
  254. } else {
  255. SERIAL_ECHOLNPGM("Filament settings: Disabled");
  256. }
  257. #endif
  258. if (level >= 10) {
  259. #ifdef LIN_ADVANCE
  260. SERIAL_ECHO_START;
  261. SERIAL_ECHOLNPGM("Linear advance settings:");
  262. SERIAL_ECHOPAIR(" M900 K", extruder_advance_k);
  263. SERIAL_ECHOPAIR(" E/D = ", advance_ed_ratio);
  264. #endif //LIN_ADVANCE
  265. }
  266. }
  267. #endif
  268. #ifdef EEPROM_SETTINGS
  269. bool Config_RetrieveSettings(uint16_t offset, uint8_t level)
  270. {
  271. int i=offset;
  272. bool previous_settings_retrieved = true;
  273. char stored_ver[4];
  274. char ver[4]=EEPROM_VERSION;
  275. EEPROM_READ_VAR(i,stored_ver); //read stored version
  276. // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
  277. if (strncmp(ver,stored_ver,3) == 0)
  278. {
  279. // version number match
  280. EEPROM_READ_VAR(i,axis_steps_per_unit);
  281. EEPROM_READ_VAR(i,max_feedrate);
  282. EEPROM_READ_VAR(i,max_acceleration_units_per_sq_second);
  283. // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
  284. reset_acceleration_rates();
  285. EEPROM_READ_VAR(i,acceleration);
  286. EEPROM_READ_VAR(i,retract_acceleration);
  287. EEPROM_READ_VAR(i,minimumfeedrate);
  288. EEPROM_READ_VAR(i,mintravelfeedrate);
  289. EEPROM_READ_VAR(i,minsegmenttime);
  290. EEPROM_READ_VAR(i,max_jerk[X_AXIS]);
  291. EEPROM_READ_VAR(i,max_jerk[Y_AXIS]);
  292. EEPROM_READ_VAR(i,max_jerk[Z_AXIS]);
  293. EEPROM_READ_VAR(i,max_jerk[E_AXIS]);
  294. if (max_jerk[X_AXIS] > DEFAULT_XJERK) max_jerk[X_AXIS] = DEFAULT_XJERK;
  295. if (max_jerk[Y_AXIS] > DEFAULT_YJERK) max_jerk[Y_AXIS] = DEFAULT_YJERK;
  296. EEPROM_READ_VAR(i,add_homing);
  297. #ifndef ULTIPANEL
  298. int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed;
  299. int absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
  300. #endif
  301. /*
  302. EEPROM_READ_VAR(i,plaPreheatHotendTemp);
  303. EEPROM_READ_VAR(i,plaPreheatHPBTemp);
  304. EEPROM_READ_VAR(i,plaPreheatFanSpeed);
  305. EEPROM_READ_VAR(i,absPreheatHotendTemp);
  306. EEPROM_READ_VAR(i,absPreheatHPBTemp);
  307. EEPROM_READ_VAR(i,absPreheatFanSpeed);
  308. */
  309. EEPROM_READ_VAR(i,zprobe_zoffset);
  310. #ifndef PIDTEMP
  311. float Kp,Ki,Kd;
  312. #endif
  313. // do not need to scale PID values as the values in EEPROM are already scaled
  314. EEPROM_READ_VAR(i,Kp);
  315. EEPROM_READ_VAR(i,Ki);
  316. EEPROM_READ_VAR(i,Kd);
  317. #ifdef PIDTEMPBED
  318. EEPROM_READ_VAR(i, bedKp);
  319. EEPROM_READ_VAR(i, bedKi);
  320. EEPROM_READ_VAR(i, bedKd);
  321. #endif
  322. #ifndef DOGLCD
  323. int lcd_contrast;
  324. #endif
  325. EEPROM_READ_VAR(i,lcd_contrast);
  326. #ifdef FWRETRACT
  327. EEPROM_READ_VAR(i,autoretract_enabled);
  328. EEPROM_READ_VAR(i,retract_length);
  329. #if EXTRUDERS > 1
  330. EEPROM_READ_VAR(i,retract_length_swap);
  331. #endif
  332. EEPROM_READ_VAR(i,retract_feedrate);
  333. EEPROM_READ_VAR(i,retract_zlift);
  334. EEPROM_READ_VAR(i,retract_recover_length);
  335. #if EXTRUDERS > 1
  336. EEPROM_READ_VAR(i,retract_recover_length_swap);
  337. #endif
  338. EEPROM_READ_VAR(i,retract_recover_feedrate);
  339. #endif
  340. EEPROM_READ_VAR(i, volumetric_enabled);
  341. EEPROM_READ_VAR(i, filament_size[0]);
  342. #if EXTRUDERS > 1
  343. EEPROM_READ_VAR(i, filament_size[1]);
  344. #if EXTRUDERS > 2
  345. EEPROM_READ_VAR(i, filament_size[2]);
  346. #endif
  347. #endif
  348. #ifdef LIN_ADVANCE
  349. if (level >= 10) {
  350. EEPROM_READ_VAR(i, extruder_advance_k);
  351. EEPROM_READ_VAR(i, advance_ed_ratio);
  352. }
  353. calculate_volumetric_multipliers();
  354. #endif //LIN_ADVANCE
  355. // Call updatePID (similar to when we have processed M301)
  356. updatePID();
  357. SERIAL_ECHO_START;
  358. SERIAL_ECHOLNPGM("Stored settings retrieved");
  359. }
  360. else
  361. {
  362. Config_ResetDefault();
  363. //Return false to inform user that eeprom version was changed and firmware is using default hardcoded settings now.
  364. //In case that storing to eeprom was not used yet, do not inform user that hardcoded settings are used.
  365. if (eeprom_read_byte((uint8_t *)offset) != 0xFF ||
  366. eeprom_read_byte((uint8_t *)offset + 1) != 0xFF ||
  367. eeprom_read_byte((uint8_t *)offset + 2) != 0xFF) {
  368. previous_settings_retrieved = false;
  369. }
  370. }
  371. #ifdef EEPROM_CHITCHAT
  372. Config_PrintSettings();
  373. #endif
  374. return previous_settings_retrieved;
  375. }
  376. #endif
  377. void Config_ResetDefault()
  378. {
  379. float tmp1[]=DEFAULT_AXIS_STEPS_PER_UNIT;
  380. float tmp2[]=DEFAULT_MAX_FEEDRATE;
  381. long tmp3[]=DEFAULT_MAX_ACCELERATION;
  382. for (short i=0;i<4;i++)
  383. {
  384. axis_steps_per_unit[i]=tmp1[i];
  385. max_feedrate[i]=tmp2[i];
  386. max_acceleration_units_per_sq_second[i]=tmp3[i];
  387. }
  388. // steps per sq second need to be updated to agree with the units per sq second
  389. reset_acceleration_rates();
  390. acceleration=DEFAULT_ACCELERATION;
  391. retract_acceleration=DEFAULT_RETRACT_ACCELERATION;
  392. minimumfeedrate=DEFAULT_MINIMUMFEEDRATE;
  393. minsegmenttime=DEFAULT_MINSEGMENTTIME;
  394. mintravelfeedrate=DEFAULT_MINTRAVELFEEDRATE;
  395. max_jerk[X_AXIS] = DEFAULT_XJERK;
  396. max_jerk[Y_AXIS] = DEFAULT_YJERK;
  397. max_jerk[Z_AXIS] = DEFAULT_ZJERK;
  398. max_jerk[E_AXIS] = DEFAULT_EJERK;
  399. add_homing[X_AXIS] = add_homing[Y_AXIS] = add_homing[Z_AXIS] = 0;
  400. #ifdef ENABLE_AUTO_BED_LEVELING
  401. zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
  402. #endif
  403. #ifdef DOGLCD
  404. lcd_contrast = DEFAULT_LCD_CONTRAST;
  405. #endif
  406. #ifdef PIDTEMP
  407. Kp = DEFAULT_Kp;
  408. Ki = scalePID_i(DEFAULT_Ki);
  409. Kd = scalePID_d(DEFAULT_Kd);
  410. // call updatePID (similar to when we have processed M301)
  411. updatePID();
  412. #ifdef PID_ADD_EXTRUSION_RATE
  413. Kc = DEFAULT_Kc;
  414. #endif//PID_ADD_EXTRUSION_RATE
  415. #endif//PIDTEMP
  416. #ifdef FWRETRACT
  417. autoretract_enabled = false;
  418. retract_length = RETRACT_LENGTH;
  419. #if EXTRUDERS > 1
  420. retract_length_swap = RETRACT_LENGTH_SWAP;
  421. #endif
  422. retract_feedrate = RETRACT_FEEDRATE;
  423. retract_zlift = RETRACT_ZLIFT;
  424. retract_recover_length = RETRACT_RECOVER_LENGTH;
  425. #if EXTRUDERS > 1
  426. retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
  427. #endif
  428. retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
  429. #endif
  430. volumetric_enabled = false;
  431. filament_size[0] = DEFAULT_NOMINAL_FILAMENT_DIA;
  432. #if EXTRUDERS > 1
  433. filament_size[1] = DEFAULT_NOMINAL_FILAMENT_DIA;
  434. #if EXTRUDERS > 2
  435. filament_size[2] = DEFAULT_NOMINAL_FILAMENT_DIA;
  436. #endif
  437. #endif
  438. calculate_extruder_multipliers();
  439. SERIAL_ECHO_START;
  440. SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
  441. }