Lots of fixes

This commit is contained in:
InsanityAutomation
2019-08-17 19:29:45 -04:00
parent 412e3aa1f6
commit 9948054cb7
76 changed files with 78 additions and 46 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 KiB

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -6
View File
@@ -35,8 +35,8 @@
#define Force10SProDisplay
#define TM3DTouchscreenUpdates // Enables TM3D Error screens and eeprom screen not found in Creality screen firmware
//#define AddonFilSensor //Adds a filamnt runout sensor to the CR20 or Ender 4
//#define lerdgeFilSensor //Using lerdge filament sensor, which is opposite polarity to stock
//#define DualFilSensors //Using dual filament sensors on XMax and YMAX
#define lerdgeFilSensor //Using lerdge filament sensor, which is opposite polarity to stock
#define DualFilSensors //Using dual filament sensors on XMax and YMAX
/*
Hotend Type
@@ -105,8 +105,8 @@
Requires a sensor from above
Melzi board users may only select ABL_BI for bilinear leveling
*/
//#define ABL_BI
#define ABL_UBL
#define ABL_BI
//#define ABL_UBL
//#define POWER_LOSS_RECOVERY //Large and does not fit with any other features on Melzi, or UBL on Atmega
/*
@@ -410,7 +410,7 @@
#if(ENABLED(MachineCR10Orig))
#define MOTHERBOARD BOARD_MELZI_CREALITY
#else
#define MOTHERBOARD BOARD_RAMPS_14_EFB
#define MOTHERBOARD BOARD_RAMPS_CREALITY
#endif
#endif
@@ -1636,7 +1636,7 @@
#define Z_MAX_POS 250
#elif (ENABLED(MachineCRX))
#define X_BED_SIZE 315
#define Y_BED_SIZE 330
#define Y_BED_SIZE 315
#define Z_MAX_POS 400
#elif (ENABLED(MachineCR10Std))
#define X_BED_SIZE 315
+4 -4
View File
@@ -925,7 +925,7 @@
// as SD_DETECT_PIN in your board's pins definitions.
// This setting should be disabled unless you are using a push button, pulling the pin to ground.
// Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER).
#if DISABLED(MachineCR10SPro)
#if NONE(MachineCR10SPro, MachineCRX)
#define SD_DETECT_INVERTED
#endif
#define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished
@@ -2394,16 +2394,16 @@
#endif
#define USER_DESC_1 "Setup"
#if (ENABLED(ABL_UBL))
#define USER_GCODE_1 "M190S" CommBedTmp "\nG28\nG29P1\nM109S215\nG29S1\nG29S0\nG29F0.0\nG29A\nG28\nG1X150Y150F50\nG1Z0\nM500\nM400\nM77\nM117 Set Z Offset"
#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 "\n M117 Probing....\nM104S215\nG28\nG29\nM400\nM109S215\nG28\nM420S1\nG1X100Y100\nG1Z0\nM500\nM400\nM77\nM117 Set Z Offset"
#define USER_GCODE_1 "M190S" CommBedTmp "\n M117 Probing....\nM104S215\nG28\nG29\nM400\nM109S215\nG28\nM420S1\nG1X100Y100F5000\nG1Z0\nM500\nM400\nM117 Set Z Offset"
#endif
#define USER_DESC_2 "PID Tune"
#define USER_GCODE_2 "M106 S128 \n M303 C8 S215 E1 U \n M500 \n M117 PID Tune Done"
#define USER_DESC_3 "Prep for Z Adjust"
#define USER_GCODE_3 "M190S" CommBedTmp "\nM104S215\nG28\nG29L1\nG1 X100Y100\nG1Z0"
#define USER_GCODE_3 "M190S" CommBedTmp "\nM104S215\nG28\nG29L1\nG1 X100Y100F5000\nG1Z0"
#define USER_DESC_4 "Store Settings"
#define USER_GCODE_4 "M500\nM117 Settings Stored"
@@ -8,6 +8,7 @@
namespace ExtUI
{
uint8_t waitway_lock = 0;
const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
uint8_t progress_bar_percent;
int startprogress = 0;
@@ -131,34 +132,38 @@ void onIdle()
{
if(waitway && !commandsInQueue())
waitway_lock++;
if(waitway_lock > 100) {
waitway_lock = 0;
waitway = 0; //clear waitway if nothing is going on
}
// After homing, reset back to motion screen
if (isAxisPositionKnown((axis_t)X) && isAxisPositionKnown((axis_t)Y) && isAxisPositionKnown((axis_t)Z))
{
switch (waitway)
{
case 1:
InforShowStatus = true;
SERIAL_ECHOLN("==waitway 1==");
rtscheck.RTS_SndData(4 + CEIconGrap, IconPrintstatus); // 4 for Pause
rtscheck.RTS_SndData(ExchangePageBase + 54, ExchangepageAddr);
waitway = 0;
if(isPositionKnown()) {
InforShowStatus = true;
SERIAL_ECHOLN("==waitway 1==");
rtscheck.RTS_SndData(4 + CEIconGrap, IconPrintstatus); // 4 for Pause
rtscheck.RTS_SndData(ExchangePageBase + 54, ExchangepageAddr);
waitway = 0;
}
break;
case 2:
waitway = 0;
if (isPositionKnown())
waitway = 0;
break;
case 3:
waitway = 0;
SERIAL_ECHOLN("==waitway 3==");
if(!isPrinting())
if(isPositionKnown())
rtscheck.RTS_SndData(ExchangePageBase + 64, ExchangepageAddr);
break;
case 4:
if (AutohomeKey)
if (AutohomeKey && isPositionKnown())
{ //Manual Move Home Done
SERIAL_ECHOLN("==waitway 4==");
rtscheck.RTS_SndData(ExchangePageBase + 71 + AxisPagenum, ExchangepageAddr);
@@ -167,11 +172,14 @@ void onIdle()
}
break;
case 5:
InforShowStatus = true;
waitway = 0;
SERIAL_ECHOLN("==waitway 5==");
rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); //exchange to 78 page
break;
if(isPositionKnown()) {
InforShowStatus = true;
waitway = 0;
SERIAL_ECHOLN("==waitway 5==");
rtscheck.RTS_SndData(ExchangePageBase + 78, ExchangepageAddr); //exchange to 78 page
}
break;
}
#if ENABLED(POWER_LOSS_RECOVERY)
@@ -183,7 +191,7 @@ void onIdle()
print_job_timer.power_off_start();
}
#endif
}
if (InforShowStatus)
{
@@ -1041,9 +1049,9 @@ void RTSSHOW::RTS_HandleData()
RTS_SndData(10, FilenameIcon); //Motor Icon
if (!isPositionKnown())
injectCommands_P(PSTR("G28\nG1F100Z0.0"));
injectCommands_P(PSTR("G28\nG1F1000Z0.0"));
else
injectCommands_P(PSTR("G1F100Z0.0"));
injectCommands_P(PSTR("G1F1000Z0.0"));
waitway = 2;
RTS_SndData(ExchangePageBase + 64, ExchangepageAddr);
@@ -1102,28 +1110,28 @@ void RTSSHOW::RTS_HandleData()
#if (ENABLED(MachineCRX) && DISABLED(Force10SProDisplay)) || ENABLED(ForceCRXDisplay)
if (recdat.data[0] == 1) // Top Left
{
injectCommands_P(PSTR("G1F100Z3\nG1X30Y30F5000\nG1F100 Z0"));
injectCommands_P(PSTR("G1F1000Z3\nG1X30Y30F5000\nG1F1000 Z0"));
waitway = 2;
}
else if (recdat.data[0] == 2) // Top Right
{
injectCommands_P(PSTR("G1F100Z3\nG1X270Y30F5000\nG1F100Z0"));
injectCommands_P(PSTR("G1F1000Z3\nG1X270Y30F5000\nG1F1000Z0"));
waitway = 2;
}
else if (recdat.data[0] == 3) // Centre
{
injectCommands_P((PSTR("G1 F100 Z3\nG1 X150 Y150 F5000\nG1 F100 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X150 Y150 F5000\nG1 F1000 Z0")));
waitway = 2;
}
else if (recdat.data[0] == 4) // Bottom Left
{
injectCommands_P((PSTR("G1 F100 Z3\nG1 X30 Y270 F5000\nG1 F100 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X30 Y270 F5000\nG1 F1000 Z0")));
waitway = 2;
}
else if (recdat.data[0] == 5) // Bottom Right
{
waitway = 4; //only for prohibiting to receive massage
injectCommands_P((PSTR("G1 F100 Z3\nG1 X270 Y270 F5000\nG1 F200 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X270 Y270 F5000\nG1 F2000 Z0")));
waitway = 2;
}
break;
@@ -1132,9 +1140,9 @@ void RTSSHOW::RTS_HandleData()
{
// Disallow Z homing if X or Y are unknown
if (!isAxisPositionKnown((axis_t)X) || !isAxisPositionKnown((axis_t)Y))
injectCommands_P(PSTR("G28\nG1 F150 Z0.0"));
injectCommands_P(PSTR("G28\nG1F1500Z0.0"));
else
injectCommands_P(PSTR("G28 Z\nG1 F150 Z0.0"));
injectCommands_P(PSTR("G28Z\nG1F1500Z0.0"));
RTS_SndData(getZOffset_mm() * 100, 0x1026);
}
@@ -1164,9 +1172,9 @@ void RTSSHOW::RTS_HandleData()
{
setLevelingActive(false); // FIX ME
if (!isPositionKnown())
injectCommands_P((PSTR("G28\nG1 F100 Z0.0")));
injectCommands_P((PSTR("G28\nG1 F1000 Z0.0")));
else
injectCommands_P((PSTR("G1 F100 Z0.0")));
injectCommands_P((PSTR("G1 F1000 Z0.0")));
waitway = 2;
@@ -1181,27 +1189,27 @@ void RTSSHOW::RTS_HandleData()
}
else if (recdat.data[0] == 6) // Assitant Level , Centre 1
{
injectCommands_P(PSTR("G1 F100 Z3\nG1 X150 Y150 F5000\nG1 F100 Z0"));
injectCommands_P(PSTR("G1 F1000 Z3\nG1 X150 Y150 F5000\nG1 F1000 Z0"));
waitway = 2;
}
else if (recdat.data[0] == 7) // Assitant Level , Front Left 2
{
injectCommands_P((PSTR("G1 F100 Z3\nG1 X30 Y30 F5000\nG1 F100 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X30 Y30 F5000\nG1 F1000 Z0")));
waitway = 2;
}
else if (recdat.data[0] == 8) // Assitant Level , Front Right 3
{
injectCommands_P((PSTR("G1 F100 Z3\nG1 X270 Y30 F5000\nG1 F100 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X270 Y30 F5000\nG1 F1000 Z0")));
waitway = 2;
}
else if (recdat.data[0] == 9) // Assitant Level , Back Right 4
{
injectCommands_P((PSTR("G1 F100 Z3\nG1 X270 Y270 F5000\nG1 F100 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X270 Y270 F5000\nG1 F1000 Z0")));
waitway = 2;
}
else if (recdat.data[0] == 10) // Assitant Level , Back Left 5
{
injectCommands_P((PSTR("G1 F100 Z3\nG1 X30 Y270 F5000\nG1 F100 Z0")));
injectCommands_P((PSTR("G1 F1000 Z3\nG1 X30 Y270 F5000\nG1 F1000 Z0")));
waitway = 2;
}
else if (recdat.data[0] == 11) // Autolevel switch
@@ -1248,7 +1256,7 @@ void RTSSHOW::RTS_HandleData()
if (recdat.data[0] == 3) //autohome
{
waitway = 4;
injectCommands_P((PSTR("G28\nG1 F100 Z10")));
injectCommands_P((PSTR("G28\nG1 F1000 Z10")));
InforShowStatus = AutohomeKey = true;
AutoHomeIconNum = 0;
RTS_SndData(ExchangePageBase + 74, ExchangepageAddr);
@@ -1629,7 +1637,27 @@ void RTSSHOW::RTS_HandleData()
recdat.head[1] = FHTWO;
}
void onPrinterKilled(PGM_P const msg) {}
void onPrinterKilled(PGM_P msg) {
SERIAL_ECHOLN("***kill***");
rtscheck.RTS_SndData(ExchangePageBase + 15, ExchangepageAddr);
delay_ms(3);
int j = 0;
char outmsg[40];
for (j; j < 4; j++)
{
outmsg[j] = '*';
}
while (const char c = pgm_read_byte(msg++)) {
outmsg[j] = c;
j++;
}
for (j; j < 40; j++)
{
outmsg[j] = '*';
}
rtscheck.RTS_SndData(outmsg, MacVersion);
delay_ms(10);
}
void onMediaInserted()
{
@@ -1787,6 +1815,9 @@ void onUserConfirmRequired(const char *const msg)
}
void onStatusChanged(const char *const msg)
{
for (int j = 0; j < 40; j++) // Clear old message
rtscheck.RTS_SndData(' ', 0x20E8+j);
rtscheck.RTS_SndData(msg, 0x20E8);
}
void onFactoryReset()
{
+1 -1
View File
@@ -1663,7 +1663,7 @@ void homeaxis(const AxisEnum axis) {
];
if (backoff_mm) {
current_position[axis] -= ABS(backoff_mm) * axis_home_dir;
line_to_current_position();
line_to_current_position(HOMING_FEEDRATE_Z);
}
#endif
@@ -35,6 +35,7 @@
#define MOSFET_D_PIN 7
#define FIL_RUNOUT_PIN 2
#define SD_DETECT_PIN 49 //always define it here, even without an LCD as its onboard
#include "pins_RAMPS.h"