lots of fixes

This commit is contained in:
InsanityAutomation
2019-08-18 18:00:35 -04:00
parent ecdc3a0911
commit dd70e03767
27 changed files with 105 additions and 125 deletions
Binary file not shown.
+6 -6
View File
@@ -9,14 +9,14 @@
//#define MachineEnder3
//#define MachineEnder4
//#define MachineEnder5
#define MachineEnder5Plus
//#define MachineEnder5Plus
//#define MachineMini
//#define MachineCR20 //Buzzer doesnt work
//#define MachineCR20Pro
//#define MachineCR10
//#define MachineCR10S
//#define MachineCR10SPro // Graphics LCD Requires soldering R64 and R66
//#define MachineCRX
#define MachineCRX
//#define MachineCR10Max
//#define MachineS4
//#define MachineS5
@@ -99,7 +99,7 @@
*/
//#define ABL_EZABL // TH3D EZABL or Any NO Sensor
//#define ABL_NCSW //Creality ABL or Any NC Sensor
//#define ABL_BLTOUCH
#define ABL_BLTOUCH
//#define CREALITY_ABL_MOUNT //Using creality ABL mount
//#define E3D_DUALFAN_MOUNT // Using HD Modular mount as above with 2 5015 blowers and sensor on the right
@@ -827,9 +827,9 @@
#if ENABLED(HotendStock)
#if ANY(MachineCRX, MachineCR10SPro, MachineCR10Max)
#define DEFAULT_Kp 17.5
#define DEFAULT_Ki 1.37
#define DEFAULT_Kd 55.47
#define DEFAULT_Kp 20.22
#define DEFAULT_Ki 3.43
#define DEFAULT_Kd 29.81
#elif ENABLED(MachineEnder5Plus)
#define DEFAULT_Kp 14.72
#define DEFAULT_Ki 0.89
+1 -1
View File
@@ -2416,7 +2416,7 @@
#if (ENABLED(ABL_UBL))
#define USER_GCODE_1 "M190S" CommBedTmp "\nG28\nG29P1\nM109S215\nG29S1\nG29S0\nG29F0.0\nG29A\nG28\nG1X150Y150F5000\nG1Z0\nM500\nM400\nM117 Set Z Offset"
#elif ENABLED(ABL_BI)
#define USER_GCODE_1 "M190S" CommBedTmp "\nM104S215\nG28\nG29\nM400\nM109S215\nG28\nM420S1\nG1X100Y100F5000\nG1Z0\nM500\nM117 Set Z Offset"
#define USER_GCODE_1 "M190S" CommBedTmp "\nG28\nG29\nM400\nM109S215\nG28\nM420S1\nG1X100Y100F5000\nG1Z0\nM500\nM117 Set Z Offset"
#endif
#define USER_DESC_2 "PID Tune"
+5
View File
@@ -37,6 +37,10 @@
#include "runout.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extensible_ui/ui_api.h"
#endif
void host_action(const char * const pstr, const bool eol) {
SERIAL_ECHOPGM("//action:");
serialprintPGM(pstr);
@@ -88,6 +92,7 @@ void host_action(const char * const pstr, const bool eol) {
void host_action_prompt_show() { host_action_prompt(PSTR("show")); }
void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const pbtn/*=nullptr*/) {
host_prompt_reason = reason;
host_action_prompt_end();
host_action_prompt_begin(pstr);
if (pbtn) host_action_prompt_button(pbtn);
+7
View File
@@ -187,6 +187,9 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
host_action_prompt_button(PSTR("Continue"));
host_action_prompt_show();
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired("Load Filament");
#endif
while (wait_for_user) {
#if HAS_BUZZER
filament_change_beep(max_beep_count);
@@ -511,6 +514,10 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
extruder_duplication_enabled = false;
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired("Paused for User");
#endif
// Wait for filament insert by user and press button
KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = true; // LCD click or M108 will clear this
+3
View File
@@ -707,6 +707,9 @@ void MMU2::filament_runout() {
if (recover) {
LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
BUZZ(200, 404);
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired("MMU2 Eject Recover");
#endif
wait_for_user = true;
#if ENABLED(HOST_PROMPT_SUPPORT)
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue"));
+8
View File
@@ -42,6 +42,10 @@
#include "../../feature/host_actions.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extensible_ui/ui_api.h"
#endif
#ifndef GET_PIN_MAP_PIN_M43
#define GET_PIN_MAP_PIN_M43(Q) GET_PIN_MAP_PIN(Q)
#endif
@@ -324,6 +328,10 @@ void GcodeSuite::M43() {
}
#if HAS_RESUME_CONTINUE
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired("M43 Called");
#endif
KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = true;
#if ENABLED(HOST_PROMPT_SUPPORT)
@@ -3,7 +3,6 @@
#include <arduino.h>
#include <wstring.h>
#include <stdio.h>
#include "../ui_api.h"
namespace ExtUI
@@ -130,16 +129,18 @@ void onStartup()
void onIdle()
{
if(waitway && !commandsInQueue())
waitway_lock++;
else
waitway_lock = 0;
if(waitway_lock > 100) {
waitway_lock = 0;
waitway = 0; //clear waitway if nothing is going on
}
switch (waitway)
{
switch (waitway)
{
case 1:
if(isPositionKnown()) {
InforShowStatus = true;
@@ -151,19 +152,20 @@ void onIdle()
break;
case 2:
if (isPositionKnown())
if (isPositionKnown() && !commandsInQueue())
waitway = 0;
break;
case 3:
waitway = 0;
SERIAL_ECHOLN("==waitway 3==");
if(isPositionKnown())
if(isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED)-1))) {
rtscheck.RTS_SndData(ExchangePageBase + 64, ExchangepageAddr);
waitway = 0;
}
break;
case 4:
if (AutohomeKey && isPositionKnown())
if (AutohomeKey && isPositionKnown() && !commandsInQueue())
{ //Manual Move Home Done
SERIAL_ECHOLN("==waitway 4==");
rtscheck.RTS_SndData(ExchangePageBase + 71 + AxisPagenum, ExchangepageAddr);
@@ -172,92 +174,30 @@ void onIdle()
}
break;
case 5:
if(isPositionKnown()) {
if(isPositionKnown() && !commandsInQueue()) {
InforShowStatus = true;
waitway = 0;
SERIAL_ECHOLN("==waitway 5==");
rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); //exchange to 78 page
}
break;
}
#if ENABLED(POWER_LOSS_RECOVERY)
if (PoweroffContinue)
{
PoweroffContinue = false;
injectCommands_P(power_off_commands[3]);
card.startFileprint();
print_job_timer.power_off_start();
}
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
if (PoweroffContinue)
{
PoweroffContinue = false;
injectCommands_P(power_off_commands[3]);
card.startFileprint();
print_job_timer.power_off_start();
}
#endif
if (InforShowStatus)
{
if ((power_off_type_yes == 0) && lcd_sd_status && (power_off_commands_count > 0)) // print the file before the power is off.
{
SERIAL_ECHOLN(" ***test1*** ");
if (startprogress == 0)
{
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
rtscheck.RTS_SndData(5, VolumeIcon);
rtscheck.RTS_SndData(8, SoundIcon);
rtscheck.RTS_SndData(0xC0, VolumeIcon - 2);
if (VolumeSet == 0)
{
rtscheck.RTS_SndData(0, VolumeIcon);
rtscheck.RTS_SndData(9, SoundIcon);
}
else
{
rtscheck.RTS_SndData((VolumeSet + 1) / 32 - 1, VolumeIcon);
rtscheck.RTS_SndData(8, SoundIcon);
}
rtscheck.RTS_SndData(VolumeSet, VolumeIcon - 2);
rtscheck.RTS_SndData(VolumeSet << 8, SoundAddr + 1);
}
if (startprogress <= 100)
rtscheck.RTS_SndData(startprogress, StartIcon);
else
rtscheck.RTS_SndData((startprogress - 100), StartIcon + 1);
delay_ms(30);
if ((startprogress += 1) > 200)
{
#if ENABLED(POWER_LOSS_RECOVERY)
power_off_type_yes = 1;
for (uint16_t i = 0; i < CardRecbuf.Filesum; i++)
{
if (!strcmp(CardRecbuf.Cardfilename[i], &power_off_info.sd_filename[1]))
{
InforShowStatus = true;
int filelen = strlen(CardRecbuf.Cardshowfilename[i]);
filelen = (TEXTBYTELEN - filelen) / 2;
if (filelen > 0)
{
char buf[20];
memset(buf, 0, sizeof(buf));
strncpy(buf, " ", filelen);
strcpy(&buf[filelen], CardRecbuf.Cardshowfilename[i]);
RTS_SndData(buf, Printfilename);
}
else
RTS_SndData(CardRecbuf.Cardshowfilename[i], Printfilename); //filenames
RTS_SndData(ExchangePageBase + 76, ExchangepageAddr);
break;
}
}
#endif
}
return;
}
else if ((power_off_type_yes == 0) && !power_off_commands_count)
{
if (startprogress == 0)
if(power_off_type_yes ==0)
{
if (startprogress == 0)
{
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
@@ -278,30 +218,50 @@ void onIdle()
rtscheck.RTS_SndData(startprogress, StartIcon);
else
rtscheck.RTS_SndData((startprogress - 100), StartIcon + 1);
delay_ms(30);
if ((startprogress += 1) > 200)
if ((startprogress += 1) > 200)
{
SERIAL_ECHOLN(" startprogress ");
power_off_type_yes = 1;
InforShowStatus = true;
TPShowStatus = false;
rtscheck.RTS_SndData(ExchangePageBase + 45, ExchangepageAddr);
#if ENABLED(POWER_LOSS_RECOVERY)
if(lcd_sd_status && (power_off_commands_count > 0)) {
for (uint16_t i = 0; i < CardRecbuf.Filesum; i++)
{
if (!strcmp(CardRecbuf.Cardfilename[i], &power_off_info.sd_filename[1]))
{
InforShowStatus = true;
int filelen = strlen(CardRecbuf.Cardshowfilename[i]);
filelen = (TEXTBYTELEN - filelen) / 2;
if (filelen > 0)
{
char buf[20];
memset(buf, 0, sizeof(buf));
strncpy(buf, " ", filelen);
strcpy(&buf[filelen], CardRecbuf.Cardshowfilename[i]);
RTS_SndData(buf, Printfilename);
}
else
RTS_SndData(CardRecbuf.Cardshowfilename[i], Printfilename); //filenames
RTS_SndData(ExchangePageBase + 76, ExchangepageAddr);
break;
}
}
}
return;
#endif
SERIAL_ECHOLN(" startprogress ");
power_off_type_yes = 1;
InforShowStatus = true;
TPShowStatus = false;
rtscheck.RTS_SndData(ExchangePageBase + 45, ExchangepageAddr);
}
return;
}
else
{
}
if (TPShowStatus && isPrinting()) //need to optimize
{
static unsigned int last_cardpercentValue = 101;
rtscheck.RTS_SndData(getProgress_seconds_elapsed() / 3600, Timehour);
rtscheck.RTS_SndData((getProgress_seconds_elapsed() / 3600) / 60, Timemin);
if (last_cardpercentValue != getProgress_percent())
{
if (progress_bar_percent > 0)
rtscheck.RTS_SndData((getProgress_seconds_elapsed() % 3600) / 60, Timemin);
if (getProgress_percent() > 0)
{
Percentrecord = progress_bar_percent + 1;
Percentrecord = getProgress_percent() + 1;
if (Percentrecord <= 50)
{
rtscheck.RTS_SndData((unsigned int)Percentrecord * 2, PrintscheduleIcon);
@@ -319,37 +279,30 @@ void onIdle()
rtscheck.RTS_SndData(0, PrintscheduleIcon + 1);
}
rtscheck.RTS_SndData((unsigned int)getProgress_percent(), Percentage);
last_cardpercentValue = getProgress_percent();
}
}
rtscheck.RTS_SndData(getZOffset_mm() * 100, 0x1026);
//float temp_buf = getActualTemp_celsius(H0);
rtscheck.RTS_SndData(getActualTemp_celsius(H0), NozzleTemp);
rtscheck.RTS_SndData(getActualTemp_celsius(BED), Bedtemp);
if (last_target_temperature_bed != getTargetTemp_celsius(BED) || (last_target_temperature[0] != getTargetTemp_celsius(H0)))
{
rtscheck.RTS_SndData(getTargetTemp_celsius(H0), NozzlePreheat);
rtscheck.RTS_SndData(getTargetTemp_celsius(BED), BedPreheat);
rtscheck.RTS_SndData(getTargetTemp_celsius(H0), NozzlePreheat);
rtscheck.RTS_SndData(getTargetTemp_celsius(BED), BedPreheat);
if (isPrinting())
{
//keep the icon
}
else if (last_target_temperature_bed < getTargetTemp_celsius(BED) || (last_target_temperature[0] < getTargetTemp_celsius(H0)))
else if (getActualTemp_celsius(BED) < getTargetTemp_celsius(BED) || (getActualTemp_celsius(H0) < getTargetTemp_celsius(H0)))
{
rtscheck.RTS_SndData(1 + CEIconGrap, IconPrintstatus);
rtscheck.RTS_SndData(1 + CEIconGrap, IconPrintstatus); // Heating Status
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 1 : PrinterStatusKey[1]);
}
else if (last_target_temperature_bed > getTargetTemp_celsius(BED) || (last_target_temperature[0] > getTargetTemp_celsius(H0)))
else if (getActualTemp_celsius(BED) > getTargetTemp_celsius(BED) || (getActualTemp_celsius(H0) > getTargetTemp_celsius(H0)))
{
rtscheck.RTS_SndData(8 + CEIconGrap, IconPrintstatus);
rtscheck.RTS_SndData(8 + CEIconGrap, IconPrintstatus); // Cooling Status
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 2 : PrinterStatusKey[1]);
}
last_target_temperature_bed = getTargetTemp_celsius(BED);
last_target_temperature[0] = getTargetTemp_celsius(H0);
}
if (NozzleTempStatus[0] || NozzleTempStatus[2]) //statuse of loadfilement and unloadfinement when temperature is less than
{
@@ -402,7 +355,7 @@ void onIdle()
rtscheck.RTS_SndData(10 * getAxisPosition_mm((axis_t)X), DisplayXaxis);
rtscheck.RTS_SndData(10 * getAxisPosition_mm((axis_t)Y), DisplayYaxis);
rtscheck.RTS_SndData(10 * getAxisPosition_mm((axis_t)Z), DisplayZaxis);
}
if (getLevelingActive())
rtscheck.RTS_SndData(2, AutoLevelIcon); /*Off*/
@@ -410,7 +363,6 @@ void onIdle()
rtscheck.RTS_SndData(3, AutoLevelIcon); /*On*/
}
if (rtscheck.RTS_RecData() > 0)
//SERIAL_PROTOCOLLN(" Handle Data ");
rtscheck.RTS_HandleData();
}
@@ -823,7 +775,7 @@ void RTSSHOW::RTS_HandleData()
}
else
{
RTS_SndData(ExchangePageBase + 52, ExchangepageAddr);
RTS_SndData(ExchangePageBase + 53, ExchangepageAddr);
}
}
else if (recdat.data[0] == 3)
@@ -1413,7 +1365,7 @@ void RTSSHOW::RTS_HandleData()
PrintStatue[1] = 0;
PrinterStatusKey[1] = 3;
CardCheckStatus[0] = 1; // open the key of checking card in printing
RTS_SndData(ExchangePageBase + 52, ExchangepageAddr);
RTS_SndData(ExchangePageBase + 53, ExchangepageAddr);
FilementStatus[0] = 0; // recover the status waiting to check filements
}
@@ -1482,7 +1434,7 @@ void RTSSHOW::RTS_HandleData()
CardCheckStatus[0] = 1; // open the key of checking card in printing
RTS_SndData(1 + CEIconGrap, IconPrintstatus);
RTS_SndData(ExchangePageBase + 52, ExchangepageAddr);
RTS_SndData(ExchangePageBase + 53, ExchangepageAddr);
//card.startFileprint();
//print_job_timer.power_off_start();
@@ -1855,6 +1807,7 @@ void onFilamentRunout(extruder_t extruder)
}
void onUserConfirmRequired(const char *const msg)
{
PrintStatue[1] = 1; // for returning the corresponding page
PrinterStatusKey[1] = 4;
TPShowStatus = false;
FilementStatus[0] = 2;
@@ -1873,6 +1826,10 @@ void onFactoryReset()
}
void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval)
{
if(waitway==3)
if(isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED)-1)))
rtscheck.RTS_SndData(ExchangePageBase + 64, ExchangepageAddr);
bool zig = true;
for (uint8_t yCount = 0, showcount = 0; yCount < GRID_MAX_POINTS_Y; yCount++)
{