Use loop to enquecommand_P() in first layer calibration.
This commit is contained in:
parent
28e7772421
commit
4be8fa701e
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* first_lay_cal.cpp
|
||||||
|
*
|
||||||
|
* Created on: Jun 10, 2019
|
||||||
|
* Author: marek
|
||||||
|
*/
|
||||||
|
#include "first_lay_cal.h"
|
||||||
|
#include "Configuration_prusa.h"
|
||||||
|
#include "language.h"
|
||||||
|
|
||||||
|
static const char cmd_0[] PROGMEM = "M107";
|
||||||
|
static const char cmd_1[] PROGMEM = "M104 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP);
|
||||||
|
static const char cmd_2[] PROGMEM = "M140 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP);
|
||||||
|
static const char cmd_3[] PROGMEM = "M190 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP);
|
||||||
|
static const char cmd_4[] PROGMEM = "M109 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP);
|
||||||
|
static const char cmd_6[] PROGMEM = "G28";
|
||||||
|
static const char cmd_7[] PROGMEM = "G92 E0.0";
|
||||||
|
|
||||||
|
|
||||||
|
const char * const layer1_cal[8] PROGMEM =
|
||||||
|
{
|
||||||
|
cmd_0,
|
||||||
|
cmd_1,
|
||||||
|
cmd_2,
|
||||||
|
cmd_3,
|
||||||
|
cmd_4,
|
||||||
|
MSG_M117_V2_CALIBRATION, //TODO missing internationalization
|
||||||
|
cmd_6,
|
||||||
|
cmd_7,
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* first_lay_cal.h
|
||||||
|
*
|
||||||
|
* Created on: Jun 10, 2019
|
||||||
|
* Author: marek
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FIRMWARE_FIRST_LAY_CAL_H_
|
||||||
|
#define FIRMWARE_FIRST_LAY_CAL_H_
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern const char * const layer1_cal[8] PROGMEM;
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FIRMWARE_FIRST_LAY_CAL_H_ */
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
#include "static_assert.h"
|
#include "static_assert.h"
|
||||||
#include "io_atmega2560.h"
|
#include "io_atmega2560.h"
|
||||||
|
#include "first_lay_cal.h"
|
||||||
|
|
||||||
|
|
||||||
int scrollstuff = 0;
|
int scrollstuff = 0;
|
||||||
|
|
@ -1386,15 +1387,10 @@ void lcd_commands()
|
||||||
|
|
||||||
if (lcd_commands_step == 10)
|
if (lcd_commands_step == 10)
|
||||||
{
|
{
|
||||||
enquecommand_P(PSTR("M107"));
|
for (uint8_t i = 0; i < (sizeof(layer1_cal)/sizeof(layer1_cal[0])); ++i)
|
||||||
enquecommand_P(PSTR("M104 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)));
|
{
|
||||||
enquecommand_P(PSTR("M140 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP)));
|
enquecommand_P(static_cast<char*>(pgm_read_ptr(&layer1_cal[i])));
|
||||||
enquecommand_P(PSTR("M190 S" STRINGIFY(PLA_PREHEAT_HPB_TEMP)));
|
}
|
||||||
enquecommand_P(PSTR("M109 S" STRINGIFY(PLA_PREHEAT_HOTEND_TEMP)));
|
|
||||||
enquecommand_P(_T(MSG_M117_V2_CALIBRATION));
|
|
||||||
enquecommand_P(PSTR("G28"));
|
|
||||||
enquecommand_P(PSTR("G92 E0.0"));
|
|
||||||
|
|
||||||
lcd_commands_step = 9;
|
lcd_commands_step = 9;
|
||||||
}
|
}
|
||||||
if (lcd_commands_step == 9 && !blocks_queued() && cmd_buffer_empty())
|
if (lcd_commands_step == 9 && !blocks_queued() && cmd_buffer_empty())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue