first_lay_cal.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * first_lay_cal.cpp
  3. *
  4. * Created on: Jun 10, 2019
  5. * Author: marek
  6. */
  7. #include "first_lay_cal.h"
  8. #include "Configuration_prusa.h"
  9. #include "language.h"
  10. #include "Marlin.h"
  11. #include <avr/pgmspace.h>
  12. static const char cmd_0[] PROGMEM = "M107";
  13. static const char cmd_1[] PROGMEM = "M104 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP);
  14. static const char cmd_2[] PROGMEM = "M140 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP);
  15. static const char cmd_3[] PROGMEM = "M190 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP);
  16. static const char cmd_4[] PROGMEM = "M109 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP);
  17. static const char cmd_5[] PROGMEM = "G28";
  18. static const char cmd_6[] PROGMEM = "G92 E0.0";
  19. static const char * const preheat_cmd[] PROGMEM =
  20. {
  21. cmd_0,
  22. cmd_1,
  23. cmd_2,
  24. cmd_3,
  25. cmd_4,
  26. cmd_5, //call MSG_M117_V2_CALIBRATION before
  27. cmd_6,
  28. };
  29. void lay1cal_preheat()
  30. {
  31. for (uint8_t i = 0; i < (sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); ++i)
  32. {
  33. if (5 == i) enquecommand_P(_T(MSG_M117_V2_CALIBRATION));
  34. enquecommand_P(static_cast<char*>(pgm_read_ptr(&preheat_cmd[i])));
  35. }
  36. }