Commit 30264bfb authored by MagoKimbra's avatar MagoKimbra

Clear code

parent 9ba19359
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
// How much the nozzle will be raised when travelling from between next probing points // How much the nozzle will be raised when travelling from between next probing points
#define Z_RAISE_BETWEEN_PROBINGS 5 #define Z_RAISE_BETWEEN_PROBINGS 5
// Works best with ACCURATE_BED_LEVELING_POINTS 5 or higher. // Define the grid for bed level AUTO BED LEVELING GRID POINTS X AUTO BED LEVELING GRID POINTS.
#define AUTO_BED_LEVELING_GRID_POINTS 9 #define AUTO_BED_LEVELING_GRID_POINTS 9
/*****************************************************************************************/ /*****************************************************************************************/
...@@ -327,7 +327,7 @@ ...@@ -327,7 +327,7 @@
// Maximum start speed for accelerated moves. X, Y, Z, E0...(per extruder) // Maximum start speed for accelerated moves. X, Y, Z, E0...(per extruder)
#define DEFAULT_MAX_ACCELERATION {5000, 5000, 5000, 1000, 1000, 1000, 1000} #define DEFAULT_MAX_ACCELERATION {5000, 5000, 5000, 1000, 1000, 1000, 1000}
// Maximum acceleration in mm/s^2 for retracts E0... (per extruder) // Maximum acceleration in mm/s^2 for retracts E0... (per extruder)
#define DEFAULT_RETRACT_ACCELERATION {10000, 10000, 10000, 10000} #define DEFAULT_RETRACT_ACCELERATION {10000, 10000, 10000, 10000}
// X, Y, Z and E* maximum acceleration in mm/s^2 for printing moves // X, Y, Z and E* maximum acceleration in mm/s^2 for printing moves
#define DEFAULT_ACCELERATION 3000 #define DEFAULT_ACCELERATION 3000
// X, Y, Z acceleration in mm/s^2 for travel (non printing) moves // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
......
...@@ -59,8 +59,9 @@ ...@@ -59,8 +59,9 @@
* - Laser beam * - Laser beam
* ADVANCED MOTION FEATURES: * ADVANCED MOTION FEATURES:
* - Stepper auto deactivation * - Stepper auto deactivation
* - Microstepping
* - Low speed stepper * - Low speed stepper
* - High speed stepper
* - Microstepping
* - Motor's current * - Motor's current
* - I2C DIGIPOT * - I2C DIGIPOT
* - Toshiba steppers * - Toshiba steppers
...@@ -1266,31 +1267,43 @@ ...@@ -1266,31 +1267,43 @@
/*********************************************************************** /***********************************************************************
*************************** Microstepping ***************************** ************************* Low speed stepper ***************************
*********************************************************************** ***********************************************************************
* * * *
* Microstep setting (Only functional when stepper driver * * Use it if you have low speed stepper driver *
* microstep pins are connected to MCU. *
* * * *
* Alligator Board support 16 or 32 only value * * Uncomment STEPPER_HIGH_LOW to enable this feature *
* * * *
***********************************************************************/ ***********************************************************************/
//#define USE_MICROSTEPS //#define STEPPER_HIGH_LOW
#define MICROSTEP_MODES {16, 16, 16, 16} // X Y Z E - [1,2,4,8,16,32] #define STEPPER_HIGH_LOW_DELAY 1u // Delay in microseconds
/***********************************************************************/ /***********************************************************************/
/*********************************************************************** /***********************************************************************
************************* Low speed stepper *************************** ************************* High speed stepper **************************
*********************************************************************** ***********************************************************************
* * * *
* Use it if you have low speed stepper driver * * Activate for very high stepping rates, normally only needed for 1/64*
* or more micro steps (AXIS_STEPS_PER_UNIT * MAX_FEEDRATE > 150,000) *
* * * *
* Uncomment STEPPER_HIGH_LOW to enable this feature * ***********************************************************************/
//#define ENABLE_HIGH_SPEED_STEPPING
/***********************************************************************/
/***********************************************************************
*************************** Microstepping *****************************
***********************************************************************
* *
* Microstep setting (Only functional when stepper driver *
* microstep pins are connected to MCU. *
* *
* Alligator Board support 16 or 32 only value *
* * * *
***********************************************************************/ ***********************************************************************/
//#define STEPPER_HIGH_LOW //#define USE_MICROSTEPS
#define STEPPER_HIGH_LOW_DELAY 1u // Delay in microseconds #define MICROSTEP_MODES {16, 16, 16, 16} // X Y Z E - [1,2,4,8,16,32]
/***********************************************************************/ /***********************************************************************/
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
* M218 - Set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y> * M218 - Set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
* M220 - Set speed factor override percentage: S<factor in percent> * M220 - Set speed factor override percentage: S<factor in percent>
* M221 - Set extrude factor override percentage: S<factor in percent> * M221 - Set extrude factor override percentage: S<factor in percent>
* M222 - Set density extrusion percentage: S<factor in percent> * M222 - Set density extrusion percentage for purge: S<factor in percent>
* M226 - Wait until the specified pin reaches the state required: P<pin number> S<pin state> * M226 - Wait until the specified pin reaches the state required: P<pin number> S<pin state>
* M240 - Trigger a camera to take a photograph * M240 - Trigger a camera to take a photograph
* M250 - Set LCD contrast C<contrast value> (value 0..63) * M250 - Set LCD contrast C<contrast value> (value 0..63)
...@@ -2514,7 +2514,7 @@ static void clean_up_after_endstop_move() { ...@@ -2514,7 +2514,7 @@ static void clean_up_after_endstop_move() {
double xProbe = left_probe_bed_position + xGridSpacing * xCount; double xProbe = left_probe_bed_position + xGridSpacing * xCount;
// Avoid probing the corners (outside the round or hexagon print surface) on a delta printer. // Avoid probing the corners (outside the round or hexagon print surface) on a delta printer.
float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe); float distance_from_center = sqrt(xProbe * xProbe + yProbe * yProbe);
if (distance_from_center > DELTA_PROBABLE_RADIUS) continue; if (distance_from_center > DELTA_PROBABLE_RADIUS) continue;
bed_level[xCount][yCount] = probe_bed(xProbe, yProbe); bed_level[xCount][yCount] = probe_bed(xProbe, yProbe);
...@@ -7442,11 +7442,11 @@ void process_next_command() { ...@@ -7442,11 +7442,11 @@ void process_next_command() {
gcode_M218(); break; gcode_M218(); break;
#endif #endif
case 220: // M220 S<factor in percent>- set speed factor override percentage case 220: // M220 S<factor in percent> - set speed factor override percentage
gcode_M220(); break; gcode_M220(); break;
case 221: // M221 T<extruder> S<factor in percent>- set extrude factor override percentage case 221: // M221 T<extruder> S<factor in percent> - set extrude factor override percentage
gcode_M221(); break; gcode_M221(); break;
case 222: // M222 T<extruder> S<factor in percent>- set Density extrude factor override percentage case 222: // M222 T<extruder> S<factor in percent> - set density extrude factor percentage for purge
gcode_M222(); break; gcode_M222(); break;
case 226: // M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required case 226: // M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required
gcode_M226(); break; gcode_M226(); break;
......
...@@ -5369,12 +5369,8 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -5369,12 +5369,8 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define MOSI_PIN 75 #define MOSI_PIN 75
#define MISO_PIN 74 #define MISO_PIN 74
#define SCK_PIN 76 #define SCK_PIN 76
#define SS_PIN 77
#else #else
#define DUE_SOFTWARE_SPI #define DUE_SOFTWARE_SPI
#define MOSI_PIN 51
#define MISO_PIN 50
#define SCK_PIN 52
#endif #endif
/****************************************************************************************/ /****************************************************************************************/
......
...@@ -294,11 +294,13 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -294,11 +294,13 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
ECHO_EMV("\" pos", sdpos); ECHO_EMV("\" pos", sdpos);
filespos[file_subcall_ctr] = sdpos; filespos[file_subcall_ctr] = sdpos;
file_subcall_ctr++; file_subcall_ctr++;
} else { }
else {
ECHO_LMV(DB, "Now doing file: ", name); ECHO_LMV(DB, "Now doing file: ", name);
} }
file.close(); file.close();
} else { // opening fresh file }
else { // opening fresh file
file_subcall_ctr = 0; // resetting procedure depth in case user cancels print while in procedure file_subcall_ctr = 0; // resetting procedure depth in case user cancels print while in procedure
ECHO_LMV(DB, "Now fresh file: ", name); ECHO_LMV(DB, "Now fresh file: ", name);
} }
...@@ -320,12 +322,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -320,12 +322,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
ECHO_SMV(ER, SERIAL_SD_OPEN_FILE_FAIL, subdirname); ECHO_SMV(ER, SERIAL_SD_OPEN_FILE_FAIL, subdirname);
ECHO_EM("."); ECHO_EM(".");
return; return;
} else { }
else {
//ECHO_EM("dive ok"); //ECHO_EM("dive ok");
} }
curDir = &myDir; curDir = &myDir;
dirname_start = dirname_end + 1; dirname_start = dirname_end + 1;
} else { // the remainder after all /fsa/fdsa/ is the filename }
else { // the remainder after all /fsa/fdsa/ is the filename
fname = dirname_start; fname = dirname_start;
//ECHO_EM("remainder"); //ECHO_EM("remainder");
//ECHO_EV(fname); //ECHO_EV(fname);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename }; enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename };
class CardReader { class CardReader {
public: public:
CardReader(); CardReader();
void initsd(); void initsd();
...@@ -30,9 +30,9 @@ class CardReader { ...@@ -30,9 +30,9 @@ class CardReader {
void getStatus(); void getStatus();
void printingHasFinished(); void printingHasFinished();
#if ENABLED(LONG_FILENAME_HOST_SUPPORT) #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
void printLongPath(char* path); void printLongPath(char* path);
#endif #endif
void getfilename(uint16_t nr, const char* const match = NULL); void getfilename(uint16_t nr, const char* const match = NULL);
uint16_t getnrfilenames(); uint16_t getnrfilenames();
...@@ -53,18 +53,18 @@ class CardReader { ...@@ -53,18 +53,18 @@ class CardReader {
FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
public: public:
bool saving, logging, sdprinting, cardOK, filenameIsDir; bool saving, logging, sdprinting, cardOK, filenameIsDir;
char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
int autostart_index; int autostart_index;
private: private:
SdFile root, *curDir, workDir, lastDir, workDirParents[MAX_DIR_DEPTH]; SdFile root, *curDir, workDir, lastDir, workDirParents[MAX_DIR_DEPTH];
uint16_t workDirDepth; uint16_t workDirDepth;
Sd2Card card; Sd2Card card;
SdVolume volume; SdVolume volume;
SdFile file; SdFile file;
#define SD_PROCEDURE_DEPTH 1 #define SD_PROCEDURE_DEPTH 1
#define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1) #define MAXPATHNAMELENGTH (FILENAME_LENGTH * MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1)
uint8_t file_subcall_ctr; uint8_t file_subcall_ctr;
uint32_t filespos[SD_PROCEDURE_DEPTH]; uint32_t filespos[SD_PROCEDURE_DEPTH];
char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH];
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
#endif // BLUETOOTH #endif // BLUETOOTH
#else #else
#ifdef __SAM3X8E__ #ifdef __SAM3X8E__
#if SERIAL_PORT == 0 #if SERIAL_PORT == -1
#define MYSERIAL SerialUSB
#elif SERIAL_PORT == 0
#define MYSERIAL Serial #define MYSERIAL Serial
#elif SERIAL_PORT == 1 #elif SERIAL_PORT == 1
#define MYSERIAL Serial1 #define MYSERIAL Serial1
......
...@@ -337,14 +337,14 @@ ...@@ -337,14 +337,14 @@
#define HOMING_BUMP_DIVISOR {XYZ_BUMP_DIVISOR, XYZ_BUMP_DIVISOR, XYZ_BUMP_DIVISOR} #define HOMING_BUMP_DIVISOR {XYZ_BUMP_DIVISOR, XYZ_BUMP_DIVISOR, XYZ_BUMP_DIVISOR}
// Effective horizontal distance bridged by diagonal push rods. // Effective horizontal distance bridged by diagonal push rods.
#define DEFAULT_DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET) #define DEFAULT_DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET - DELTA_EFFECTOR_OFFSET - DELTA_CARRIAGE_OFFSET)
#define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
#define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
#define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
#define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
// Radius for probe // Radius for probe
#define DELTA_PROBABLE_RADIUS BED_PRINTER_RADIUS #define DELTA_PROBABLE_RADIUS BED_PRINTER_RADIUS - 5
#endif #endif
/** /**
......
...@@ -1681,7 +1681,7 @@ ...@@ -1681,7 +1681,7 @@
#error DEPENDENCY ERROR: You have to set E0E1_CHOICE_PIN, E0E2_CHOICE_PIN and E0E3_CHOICE_PIN to a valid pin if you enable MKR4 with 4 extruder and 1 driver #error DEPENDENCY ERROR: You have to set E0E1_CHOICE_PIN, E0E2_CHOICE_PIN and E0E3_CHOICE_PIN to a valid pin if you enable MKR4 with 4 extruder and 1 driver
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 2) && !PIN_EXISTS(E0E2_CHOICE) #elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 2) && !PIN_EXISTS(E0E2_CHOICE)
#error DEPENDENCY ERROR: You have to set E0E2_CHOICE_PIN to a valid pin if you enable MKR4 with 3 extruder and 2 driver #error DEPENDENCY ERROR: You have to set E0E2_CHOICE_PIN to a valid pin if you enable MKR4 with 3 extruder and 2 driver
#elif (EXTRUDERS == 4) && (DRIVER_EXTRUDERS == 2) && (!PIN_EXISTS(E0E1_CHOICE) || !PIN_EXISTS(E1E3_CHOICE)) #elif (EXTRUDERS == 4) && (DRIVER_EXTRUDERS == 2) && (!PIN_EXISTS(E0E2_CHOICE) || !PIN_EXISTS(E1E3_CHOICE))
#error DEPENDENCY ERROR: You have to set E0E2_CHOICE_PIN and E1E3_CHOICE_PIN to a valid pin if you enable MKR4 with 4 extruder and 2 driver #error DEPENDENCY ERROR: You have to set E0E2_CHOICE_PIN and E1E3_CHOICE_PIN to a valid pin if you enable MKR4 with 4 extruder and 2 driver
#endif #endif
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment