Commit 5dbe02da authored by Simone Primarosa's avatar Simone Primarosa

Update 4.1.4 dev

See changelog.md for more info
parent b97aff98
......@@ -45,6 +45,8 @@
* Firmware test
* Support for a filament diameter sensor, which adjusts extrusion volume
* Support for a hall effect sensor for calucalte Wh. Example sensor ACS712 20A range Current Sensor Module. http://i.ebayimg.com/images/i/310506962976-0-1/s-l1000.jpg
* Anti extruder idle oozing system
* Statistics save on SD
The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
......
### Versione 4.1.4
* Improved firmare test dialog.
* Bugfix for SDCONFIG routine. Now the configuration file will be readed and created only on the root of the SD.
* Improved "Thermal Runaway Protection" now the system will be halted also if the thermistor is missing before the temperature is reached as suggested in Issue #35.
* Improved "Extruder Idle Oozing Prevention" by adding a more efficient way to detect planned movements. Now this feature seems stable and can be used by anyone.
* Bugfix for sdinit.
* Removed tab character from the code.
* Removed some unuseful spacing from the code.
### Version 4.1.3
* Improved support for Delta, SCARA, COREXY & COREXZ kinematics.
* Improved stepper timer for high velocity driver and not.
* Add calibrate surface width DELTA.
* Improved serial comunication width most popular Host.
* Add Acceleration retraction for extruder.
* Add EJerk for extruder
* Add EJerk for extruder.
* Remove limit for virtual extruder to 4. Now width MKR4 or NPr2 is possible have infinite extruder...
* Add M92 T* E (Set step per unit for any extruder)
* Add M203 T* E (Set max feedrate for any extruder)
* Add M204 T* R (Set acc retraction for any extruder)
* Add M205 T* E (Set E Jerk for any extruder)
* Add Slot for G60 & G61
* Add M92 T* E (Set step per unit for any extruder).
* Add M203 T* E (Set max feedrate for any extruder).
* Add M204 T* R (Set acc retraction for any extruder).
* Add M205 T* E (Set E Jerk for any extruder).
* Add Slot for G60 & G61.
* G60 Save current position coordinates (all axes, for active extruder). S<SLOT> - specifies memory slot # (0-based) to save into (default 0).
* G61 Apply/restore saved coordinates to the active extruder. X Y Z E - Value to add at stored coordinates. F<speed> - Set Feedrate. S<SLOT> - specifies memory slot # (0-based) to save into (default 0).
### Version 4.1.2
* Serial message function standardized for a better code style
* Auto-Create configuration file if not exist
* FIX for sdcard crash problem during configuration file reading
* FIX for some undefined SCARA defines
* Serial message function standardized for a better code style.
* Auto-Create configuration file if not exist.
* FIX for sdcard crash problem during configuration file reading.
* FIX for some undefined SCARA defines.
### Version 4.1.1
* Add Power (Watt) Sensor
* Add Anti OOZING
* Add Power Consumation and Power On Time
* Added Power (Watt) Sensor.
* Added Anti OOZING.
* Add Power Consumation and Power On Time.
* Configurations stored in the SD are updated in real-time (every SD_CFG_SECONDS seconds) also if you remove-insert the sd or you start your printer without the SD card.
* Reduced code size, maybe a lot depending on your configuration.
* Improved support for Delta, SCARA, and COREXY kinematics.
......@@ -45,4 +54,4 @@
* Moved GCode handling code into individual functions per-code.
### Version 4.1.0
* Initial release
* Initial release.
......@@ -28,7 +28,7 @@
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define BUILD_VERSION "4.1.3 dev"
#define BUILD_VERSION "4.1.4 dev"
#define STRING_DISTRIBUTION_DATE __DATE__ " " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define STRING_SPLASH_LINE1 "v" BUILD_VERSION // will be shown during bootup in line 1
......
......@@ -19,7 +19,7 @@
#define SCARA_offset_y -56 //mm
#define SCARA_RAD2DEG 57.2957795 // to convert RAD to degrees
#define THETA_HOMING_OFFSET 0 //calculatated from Calibration Guide and command M360 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
#define THETA_HOMING_OFFSET 0 //calculatated from Calibration Guide and command M360 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
#define PSI_HOMING_OFFSET 0 // calculatated from Calibration Guide and command M364 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
//some helper variables to make kinematics faster
......
......@@ -65,17 +65,18 @@
//#define SHOW_TEMP_ADC_VALUES
/**
* extruder idle oozing prevention
* if the extruder motor is idle for more than SECONDS, and the temperature over MINTEMP,
* Extruder Idle Oozing Prevention
* If the extruder motor is idle for more than SECONDS, and the temperature is over IDLE_OOZING_MINTEMP,
* some filament is retracted. The filament retracted is re-added before the next extrusion
* or when the target temperature is less than EXTRUDE_MINTEMP and the actual temperature
* is greater than IDLE_OOZING_MINTEMP and less than IDLE_OOZING_FEEDRATE
* or when the target temperature is less than IDLE_OOZING_MINTEMP and the actual temperature
* is greater than IDLE_OOZING_MINTEMP.
* PS: Always remember to set your extruder target temperature to 0°C before shoudown the printer if you enable this feature.
*/
//#define IDLE_OOZING_PREVENT
#define IDLE_OOZING_MINTEMP EXTRUDE_MINTEMP + 5
#define IDLE_OOZING_MAXTEMP IDLE_OOZING_MINTEMP + 5
#define IDLE_OOZING_FEEDRATE 45 //default feedrate for retracting (mm/s)
#define IDLE_OOZING_SECONDS 10
#define IDLE_OOZING_FEEDRATE 50 //default feedrate for retracting (mm/s)
#define IDLE_OOZING_SECONDS 5
#define IDLE_OOZING_LENGTH 15 //default retract length (positive mm)
#define IDLE_OOZING_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
#define IDLE_OOZING_RECOVER_FEEDRATE 50 //default feedrate for recovering from retraction (mm/s)
......
......@@ -293,7 +293,8 @@ extern int fanSpeed;
#endif
#if ENABLED(IDLE_OOZING_PREVENT)
extern bool idleoozing_enabled;
extern bool IDLE_OOZING_enabled;
extern void IDLE_OOZING_retract(bool retracting);
#endif
#if ENABLED(FWRETRACT)
......
......@@ -95,7 +95,7 @@ void MarlinSerial::begin(long baud) {
void MarlinSerial::end() {
cbi(M_UCSRxB, M_RXENx);
cbi(M_UCSRxB, M_TXENx);
cbi(M_UCSRxB, M_RXCIEx);
cbi(M_UCSRxB, M_RXCIEx);
}
......@@ -178,7 +178,7 @@ void MarlinSerial::print(double n, int digits) {
void MarlinSerial::println(void) {
print('\r');
print('\n');
print('\n');
}
void MarlinSerial::println(const String &s) {
......
......@@ -29,9 +29,9 @@
// The presence of the UBRRH register is used to detect a UART.
#define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \
(port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \
(port == 3 && defined(UBRR3H)))
(port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \
(port == 3 && defined(UBRR3H)))
// These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor
// requires two levels of indirection to expand macro values properly)
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
......
......@@ -440,16 +440,12 @@ unsigned long printer_usage_seconds;
#endif
#if ENABLED(FILAMENTCHANGEENABLE)
bool filament_changing = false;
#endif
#if ENABLED(IDLE_OOZING_PREVENT) || ENABLED(EXTRUDER_RUNOUT_PREVENT)
unsigned long axis_last_activity = 0;
bool axis_is_moving = false;
bool filament_changing = false;
#endif
#if ENABLED(IDLE_OOZING_PREVENT)
bool idleoozing_enabled = true;
unsigned long axis_last_activity = 0;
bool IDLE_OOZING_enabled = true;
bool IDLE_OOZING_retracted[EXTRUDERS] = ARRAY_BY_EXTRUDERS(false);
#endif
......@@ -740,7 +736,7 @@ void setup() {
ECHO_SMV(DB, MSG_FREE_MEMORY, freeMemory());
ECHO_EMV(MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t)*BLOCK_BUFFER_SIZE);
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
for (int8_t i = 0; i < BUFSIZE; i++) fromsd[i] = false;
#endif
......@@ -810,13 +806,13 @@ void setup() {
void loop() {
if (commands_in_queue < BUFSIZE - 1) get_command();
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
card.checkautostart(false);
#endif
if (commands_in_queue) {
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
if (card.saving) {
char *command = command_queue[cmd_queue_index_r];
......@@ -904,7 +900,7 @@ void get_command() {
command[serial_count] = 0; // terminate string
// this item in the queue is not from sd
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
fromsd[cmd_queue_index_w] = false;
#endif
......@@ -990,7 +986,7 @@ void get_command() {
}
}
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
if (!card.sdprinting || serial_count) return;
......@@ -1926,11 +1922,11 @@ static void clean_up_after_endstop_move() {
if ((t1_err == false) and (t2_err == false) and (t3_err == true)) err_tower = 3;
ECHO_SM(DB, "t1:");
if (t1_err == true) ECHO_M("Err"); else ECHO_M("OK");
if (t1_err == true) ECHO_M("Err"); else ECHO_M("OK");
ECHO_M(" t2:");
if (t2_err == true) ECHO_M("Err"); else ECHO_M("OK");
ECHO_M(" t3:");
if (t3_err == true) ECHO_M("Err"); else ECHO_M("OK");
if (t3_err == true) ECHO_M("Err"); else ECHO_M("OK");
ECHO_E;
if (err_tower == 0) {
......@@ -2537,27 +2533,29 @@ static void clean_up_after_endstop_move() {
#endif //DELTA
#ifdef IDLE_OOZING_PREVENT
#if ENABLED(IDLE_OOZING_PREVENT)
void IDLE_OOZING_retract(bool retracting) {
if (retracting && !IDLE_OOZING_retracted[active_extruder]) {
set_destination_to_current();
current_position[E_AXIS]+=IDLE_OOZING_LENGTH/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate;
feedrate=IDLE_OOZING_FEEDRATE*60;
IDLE_OOZING_retracted[active_extruder]=true;
prepare_move();
feedrate = oldFeedrate;
float oldFeedrate = feedrate;
set_destination_to_current();
current_position[E_AXIS] += IDLE_OOZING_LENGTH / volumetric_multiplier[active_extruder];
feedrate = IDLE_OOZING_FEEDRATE * 60;
plan_set_e_position(current_position[E_AXIS]);
prepare_move();
feedrate = oldFeedrate;
IDLE_OOZING_retracted[active_extruder] = true;
//ECHO_EM("-");
}
else if (!retracting && IDLE_OOZING_retracted[active_extruder]) {
set_destination_to_current();
current_position[E_AXIS]-=(IDLE_OOZING_LENGTH+IDLE_OOZING_RECOVER_LENGTH)/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate;
feedrate=IDLE_OOZING_RECOVER_FEEDRATE * 60;
IDLE_OOZING_retracted[active_extruder] = false;
prepare_move();
float oldFeedrate = feedrate;
set_destination_to_current();
current_position[E_AXIS] -= (IDLE_OOZING_LENGTH+IDLE_OOZING_RECOVER_LENGTH) / volumetric_multiplier[active_extruder];
feedrate = IDLE_OOZING_RECOVER_FEEDRATE * 60;
plan_set_e_position(current_position[E_AXIS]);
prepare_move();
feedrate = oldFeedrate;
IDLE_OOZING_retracted[active_extruder] = false;
//ECHO_EM("+");
}
}
#endif
......@@ -2740,11 +2738,16 @@ inline void wait_bed() {
* - Set the feedrate, if included
*/
void gcode_get_destination() {
#if ENABLED(IDLE_OOZING_PREVENT)
if(code_seen(axis_codes[E_AXIS])) IDLE_OOZING_retract(false);
#endif
for (int i = 0; i < NUM_AXIS; i++) {
if (code_seen(axis_codes[i]))
if (code_seen(axis_codes[i])) {
destination[i] = code_value() + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0);
else
}
else {
destination[i] = current_position[i];
}
}
if (code_seen('F')) {
float next_feedrate = code_value();
......@@ -2762,11 +2765,6 @@ void unknown_command_error() {
*/
inline void gcode_G0_G1() {
if (IsRunning()) {
#ifdef IDLE_OOZING_PREVENT
IDLE_OOZING_retract(false);
#endif
gcode_get_destination(); // For X Y Z E F
#ifdef FWRETRACT
......@@ -3728,7 +3726,7 @@ inline void gcode_G28() {
}
if (code_seen('D')) {
ECHO_LM(DB, "Adjusting Diagonal Rod Length");
ECHO_LM(DB, "Adjusting Diagonal Rod Length");
adj_diagrod_length();
ECHO_LM(DB, "Diagonal Rod Length adjustment complete");
}
......@@ -4018,7 +4016,7 @@ inline void gcode_M17() {
enable_all_steppers();
}
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
/**
* M20: List SD card to serial output
......@@ -4123,7 +4121,7 @@ inline void gcode_M31() {
autotempShutdown();
}
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
/**
* M32: Select file and start SD Print
......@@ -5620,7 +5618,7 @@ inline void gcode_M400() { st_synchronize(); }
* M407: Get measured filament diameter on serial output
*/
inline void gcode_M407() {
ECHO_LMV(DB, "Filament dia (measured mm):", filament_width_meas);
ECHO_LMV(DB, "Filament dia (measured mm):", filament_width_meas);
}
#endif // FILAMENT_SENSOR
......@@ -5971,12 +5969,12 @@ inline void gcode_M503() {
if (code_seen('U')) {
diagrod_adj[0] = code_value();
set_delta_constants();
}
if (code_seen('V')) {
}
if (code_seen('V')) {
diagrod_adj[1] = code_value();
set_delta_constants();
}
if (code_seen('W')) {
}
if (code_seen('W')) {
diagrod_adj[2] = code_value();
set_delta_constants();
}
......@@ -6226,7 +6224,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
WRITE(E1E3_CHOICE_PIN,LOW);
active_driver = 1;
delay(500); // 500 microseconds delay for relay
enable_e1();
enable_e1();
break;
case 2:
WRITE(E0E2_CHOICE_PIN,HIGH);
......@@ -6489,7 +6487,7 @@ void process_next_command() {
case 17: //M17 - Enable/Power all stepper motors
gcode_M17(); break;
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
case 20: // M20 - list SD card
gcode_M20(); break;
case 21: // M21 - init SD card
......@@ -6829,7 +6827,7 @@ void FlushSerialRequestResend() {
void ok_to_send() {
refresh_cmd_timeout();
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
if (fromsd[cmd_queue_index_r]) return;
#endif
ECHO_S(OK);
......@@ -7026,12 +7024,7 @@ void prepare_move() {
#if defined(CARTESIAN) || defined(COREXY) || defined(COREXZ)
if (!prepare_move_cartesian()) return;
#endif
#ifdef IDLE_OOZING_PREVENT || EXTRUDER_RUNOUT_PREVENT
axis_last_activity = millis();
axis_is_moving = false;
#endif
set_current_to_destination();
}
......@@ -7501,8 +7494,9 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
}
#endif
#ifdef IDLE_OOZING_PREVENT
if (degHotend(active_extruder) > IDLE_OOZING_MINTEMP && !(debugLevel & DEBUG_DRYRUN) && !axis_is_moving && idleoozing_enabled) {
#if ENABLED(IDLE_OOZING_PREVENT)
if (blocks_queued()) axis_last_activity = millis();
if (degHotend(active_extruder) > IDLE_OOZING_MINTEMP && !(debugLevel & DEBUG_DRYRUN) && IDLE_OOZING_enabled) {
#ifdef FILAMENTCHANGEENABLE
if (!filament_changing)
#endif
......
......@@ -58,7 +58,7 @@ bool NexButton::setText(const char *buffer)
cmd += buffer;
cmd += "\"";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
return recvRetCommandFinished();
}
/**
......@@ -78,7 +78,7 @@ void NexButton::attachPop(NexTouchEventCb pop, void *ptr)
*/
void NexButton::detachPop(void)
{
NexTouch::detachPop();
NexTouch::detachPop();
}
......@@ -30,8 +30,8 @@ public: /* methods */
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
void detachPop(void);
uint16_t getText(char *buffer, uint16_t len);
bool setText(const char *buffer);
uint16_t getText(char *buffer, uint16_t len);
bool setText(const char *buffer);
};
#endif /* #ifdef __cplusplus */
......
......@@ -63,5 +63,5 @@ void NexHotspot::attachPop(NexTouchEventCb pop, void *ptr)
*/
void NexHotspot::detachPop(void)
{
NexTouch::detachPop();
NexTouch::detachPop();
}
......@@ -63,5 +63,5 @@ void NexPage::attachPop(NexTouchEventCb pop, void *ptr)
*/
void NexPage::detachPop(void)
{
NexTouch::detachPop();
NexTouch::detachPop();
}
......@@ -80,6 +80,6 @@ void NexPicture::attachPop(NexTouchEventCb pop, void *ptr)
*/
void NexPicture::detachPop(void)
{
NexTouch::detachPop();
NexTouch::detachPop();
}
......@@ -80,6 +80,6 @@ void NexSlice::attachPop(NexTouchEventCb pop, void *ptr)
*/
void NexSlice::detachPop(void)
{
NexTouch::detachPop();
NexTouch::detachPop();
}
......@@ -58,7 +58,7 @@ bool NexText::setText(const char *buffer)
cmd += buffer;
cmd += "\"";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
return recvRetCommandFinished();
}
/**
......@@ -80,7 +80,7 @@ bool NexText::setColor(uint32_t value)
cmd += buf;
sendCommand(cmd.c_str());
return recvRetCommandFinished();
return recvRetCommandFinished();
}
/**
......@@ -100,6 +100,6 @@ void NexText::attachPop(NexTouchEventCb pop, void *ptr)
*/
void NexText::detachPop(void)
{
NexTouch::detachPop();
NexTouch::detachPop();
}
......@@ -30,8 +30,8 @@ public: /* methods */
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
void detachPop(void);
uint16_t getText(char *buffer, uint16_t len);
bool setText(const char *buffer);
uint16_t getText(char *buffer, uint16_t len);
bool setText(const char *buffer);
bool setColor(uint32_t value);
};
......
......@@ -140,7 +140,7 @@ void NexTouch::attachPop(NexTouchEventCb pop, void *ptr) {
}
void NexTouch::detachPop(void) {
this->cbPop = NULL;
this->cbPop = NULL;
this->__cbpop_ptr = NULL;
}
......@@ -261,7 +261,7 @@ uint16_t NexTouch::recvRetString(char *buffer, uint16_t len, uint32_t timeout) {
if (str_start_flag)
{
if (0xFF == c) {
cnt_0xff++;
cnt_0xff++;
if (cnt_0xff >= 3) {
break;
}
......@@ -526,7 +526,7 @@ bool recoverySerialCommand(void)
dbSerialPrintln("recoverySerialCommand err ");
}
return ret;
return ret;
}
/**
......@@ -561,7 +561,7 @@ bool setCurrentBrightness(uint8_t dimValue)
dbSerialPrintln("setCurrentBrightness err ");
}
return ret;
return ret;
}
/**
......
......@@ -68,7 +68,7 @@ public: /* methods */
NexTouchEventCb pop = NULL, void *pop_ptr = NULL,
NexTouchEventCb push = NULL, void *push_ptr = NULL);
NexPid getPid(void);
NexPid getPid(void);
NexCid getCid(void);
const char *getObjName(void);
void print(void);
......
......@@ -337,10 +337,10 @@ struct fat32_boot {
* Bits 0-3 -- Zero-based number of active FAT.
* Only valid if mirroring is disabled.
* Bits 4-6 -- Reserved.
* Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs.
* -- 1 means only one FAT is active; it is the one referenced
* in bits 0-3.
* Bits 8-15 -- Reserved.
* Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs.
* -- 1 means only one FAT is active; it is the one referenced
* in bits 0-3.
* Bits 8-15 -- Reserved.
*/
uint16_t fat32Flags;
/**
......
......@@ -26,7 +26,7 @@ CardReader::CardReader() {
OUT_WRITE(SDPOWER, HIGH);
#endif //SDPOWER
next_autostart_ms = millis() + 5000;
next_autostart_ms = millis() + SPLASH_SCREEN_DURATION;
}
char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters
......@@ -222,14 +222,20 @@ void CardReader::initsd() {
*/
}
void CardReader::setroot() {
void CardReader::setroot(bool temporary) {
/*if (!workDir.openRoot(&volume)) {
ECHO_EM(MSG_SD_WORKDIR_FAIL);
}*/
if(temporary) lastDir = workDir;
workDir = root;
curDir = &workDir;
}
void CardReader::setlast() {
workDir = lastDir;
curDir = &workDir;
}
void CardReader::release() {
sdprinting = false;
cardOK = false;
......@@ -441,7 +447,7 @@ void CardReader::write_command(char *buf) {
}
void CardReader::checkautostart(bool force) {
if (!force && (!autostart_stilltocheck || next_autostart_ms < millis()))
if (!force && (!autostart_stilltocheck || next_autostart_ms >= millis()))
return;
autostart_stilltocheck = false;
......@@ -503,7 +509,7 @@ void CardReader::parseKeyLine(char *key, char *value, int &len_k, int &len_v) {
int ln_buf = 0;
char ln_char;
bool ln_space = false, ln_ignore = false, key_found = false;
while(!eof()) { //READ KEY
while(!eof()) { //READ KEY
ln_char = (char)get();
if(ln_char == '\n') {
ln_buf = 0;
......@@ -536,12 +542,12 @@ void CardReader::parseKeyLine(char *key, char *value, int &len_k, int &len_v) {
}
ln_buf = 0;
ln_ignore = false;
while(!eof()) { //READ VALUE
while(!eof()) { //READ VALUE
ln_char = (char)get();
if(ln_char == '\n') {
if(ln_char == '\n') {
value[ln_buf] = '\0';
len_v = ln_buf;
break; //new line reached, we can stop
break; //new line reached, we can stop
}
if(ln_ignore|| ln_char == ' ' && ln_buf == 0) continue; //ignore also initial spaces of the value
if(ln_char == ';' || ln_buf+1 >= len_v) { //comments reached or value len longer than len_v. Stop buffering and go to the next line.
......
......@@ -42,7 +42,8 @@ public:
void ls();
void chdir(const char * relpath);
void updir();
void setroot();
void setroot(bool temporary = false);
void setlast();
FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
......@@ -57,7 +58,7 @@ public:
char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
int autostart_index;
private:
SdFile root, *curDir, workDir, workDirParents[MAX_DIR_DEPTH];
SdFile root, *curDir, workDir, lastDir, workDirParents[MAX_DIR_DEPTH];
uint16_t workDirDepth;
Sd2Card card;
SdVolume volume;
......
......@@ -90,7 +90,7 @@
*
* M200 T D filament_size (x4) (T0..3)
*
* M??? S idleoozing_enabled
* M??? S IDLE_OOZING_enabled
*
*
*
......@@ -247,7 +247,7 @@ void Config_StoreSettings() {
}
#if ENABLED(IDLE_OOZING_PREVENT)
EEPROM_WRITE_VAR(i, idleoozing_enabled);
EEPROM_WRITE_VAR(i, IDLE_OOZING_enabled);
#endif
char ver2[4] = EEPROM_VERSION;
......@@ -384,7 +384,7 @@ void Config_RetrieveSettings() {
calculate_volumetric_multipliers();
#if ENABLED(IDLE_OOZING_PREVENT)
EEPROM_READ_VAR(i, idleoozing_enabled);
EEPROM_READ_VAR(i, IDLE_OOZING_enabled);
#endif
// Call updatePID (similar to when we have processed M301)
......@@ -570,7 +570,7 @@ void Config_ResetDefault() {
calculate_volumetric_multipliers();
#ifdef IDLE_OOZING_PREVENT
idleoozing_enabled = true;
IDLE_OOZING_enabled = true;
#endif
ECHO_LM(DB, "Hardcoded Default Settings Loaded");
......@@ -819,11 +819,11 @@ void Config_ResetDefault() {
void ConfigSD_PrintSettings(bool forReplay) {
// Always have this function, even with SD_SETTINGS disabled, the current values will be shown
#ifdef POWER_CONSUMPTION
#if HAS_POWER_CONSUMPTION_SENSOR
if (!forReplay) {
ECHO_LM(DB, "Watt/h consumed:");
}
ECHO_LVM(OK, power_consumption_hour," W/h");
ECHO_LVM(OK, power_consumption_hour," Wh");
#endif
if (!forReplay) {
ECHO_LM(DB, "Power on time:");
......@@ -843,7 +843,7 @@ void Config_ResetDefault() {
*
*/
void ConfigSD_ResetDefault() {
#ifdef POWER_CONSUMPTION
#if HAS_POWER_CONSUMPTION_SENSOR
power_consumption_hour = 0;
#endif
printer_usage_seconds = 0;
......@@ -854,9 +854,10 @@ void ConfigSD_ResetDefault() {
void ConfigSD_StoreSettings() {
if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting) return;
card.setroot(true);
card.openFile(CFG_SD_FILE, false, true, false);
char buff[CFG_SD_MAX_VALUE_LEN];
#ifdef POWER_CONSUMPTION
#if HAS_POWER_CONSUMPTION_SENSOR
ltoa(power_consumption_hour,buff,10);
card.unparseKeyLine(cfgSD_KEY[SD_CFG_PWR], buff);
#endif
......@@ -864,6 +865,7 @@ void ConfigSD_ResetDefault() {
card.unparseKeyLine(cfgSD_KEY[SD_CFG_TME], buff);
card.closeFile(false);
card.setlast();
config_last_update = millis();
}
......@@ -872,7 +874,7 @@ void ConfigSD_ResetDefault() {
char key[CFG_SD_MAX_KEY_LEN], value[CFG_SD_MAX_VALUE_LEN];
int k_idx;
int k_len, v_len;
card.setroot(true);
card.openFile(CFG_SD_FILE, true, true, false);
while(true) {
k_len = CFG_SD_MAX_KEY_LEN;
......@@ -882,7 +884,7 @@ void ConfigSD_ResetDefault() {
k_idx = ConfigSD_KeyIndex(key);
if(k_idx == -1) continue; //unknow key ignore it
switch(k_idx) {
#ifdef POWER_CONSUMPTION
#if HAS_POWER_CONSUMPTION_SENSOR
case SD_CFG_PWR: {
if(addValue) power_consumption_hour += (unsigned long)atol(value);
else power_consumption_hour = (unsigned long)atol(value);
......@@ -897,6 +899,7 @@ void ConfigSD_ResetDefault() {
}
}
card.closeFile(false);
card.setlast();
config_readed = true;
}
......
......@@ -24,14 +24,14 @@ void ConfigSD_ResetDefault();
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#ifdef POWER_CONSUMPTION
#if HAS_POWER_CONSUMPTION_SENSOR
"PWR",
#endif
"TME",
};
enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY
#ifdef POWER_CONSUMPTION
enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY
#if HAS_POWER_CONSUMPTION_SENSOR
SD_CFG_PWR,
#endif
SD_CFG_TME,
......
......@@ -33,8 +33,8 @@ void digipot_i2c_set_current(int channel, float current) {
// In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
byte addr = 0x2C; // channel 0-3
if (channel >= 4) {
addr = 0x2E; // channel 4-7
channel -= 4;
addr = 0x2E; // channel 4-7
channel -= 4;
}
// Initial setup
......
This diff is collapsed.
......@@ -204,11 +204,11 @@ static void lcd_implementation_init() {
#endif
#if ENABLED(LCD_PIN_RESET)
pinMode(LCD_PIN_RESET, OUTPUT);
pinMode(LCD_PIN_RESET, OUTPUT);
digitalWrite(LCD_PIN_RESET, HIGH);
#endif
#ifndef MINIPANEL//setContrast not working for Mini Panel
u8g.setContrast(lcd_contrast);
u8g.setContrast(lcd_contrast);
#endif
// FIXME: remove this workaround
// Uncomment this if you have the first generation (V1.10) of STBs board
......@@ -309,7 +309,7 @@ static void lcd_implementation_status_screen() {
}
else {
lcd_print(itostr4(power_consumption_hour-startpower));
lcd_print('Wh');
lcd_print("Wh");
}
#else
uint16_t time = (millis() - print_job_start_ms) / 60000;
......
This diff is collapsed.
......@@ -35,9 +35,22 @@ void FirmwareTest()
}
else
{
ECHO_EM("X ENDSTOP ERROR");
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define X_MIN_ENDSTOP_INVERTING");
ECHO_M("X ENDSTOP ");
ECHO_EM(MSG_FWTEST_ERROR);
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define X_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_V(MSG_FWTEST_PRESS);
......@@ -64,9 +77,22 @@ void FirmwareTest()
}
else
{
ECHO_EM("X ENDSTOP ERROR");
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define X_MAX_ENDSTOP_INVERTING");
ECHO_M("X ENDSTOP ");
ECHO_EM(MSG_FWTEST_ERROR);
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define X_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_V(MSG_FWTEST_PRESS);
......@@ -87,10 +113,14 @@ void FirmwareTest()
return;
}
#elif X_HOME_DIR == -1
ECHO_EM("ERROR!!! X_MIN_PIN not defined");
ECHO_M(MSG_FWTEST_ERROR);
ECHO_M("!!! X_MIN_PIN ");
ECHO_EM(MSG_FWTEST_NDEF);
return;
#elif X_HOME_DIR == 1
ECHO_EM("ERROR!!! X_MAX_PIN not defined");
ECHO_M(MSG_FWTEST_ERROR);
ECHO_M("!!! X_MAX_PIN ");
ECHO_EM(MSG_FWTEST_NDEF);
return;
#endif
......@@ -103,9 +133,22 @@ void FirmwareTest()
}
else
{
ECHO_EM("Y ENDSTOP ERROR");
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define Y_MIN_ENDSTOP_INVERTING");
ECHO_M("Y ENDSTOP ");
ECHO_EM(MSG_FWTEST_ERROR);
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Y_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_V(MSG_FWTEST_PRESS);
......@@ -132,9 +175,22 @@ void FirmwareTest()
}
else
{
ECHO_EM("Y ENDSTOP ERROR");
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define Y_MAX_ENDSTOP_INVERTING");
ECHO_M("Y ENDSTOP ");
ECHO_EM(MSG_FWTEST_ERROR);
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Y_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_V(MSG_FWTEST_PRESS);
......@@ -155,10 +211,14 @@ void FirmwareTest()
return;
}
#elif Y_HOME_DIR == -1
ECHO_EM("ERROR!!! Y_MIN_PIN not defined");
ECHO_M(MSG_FWTEST_ERROR);
ECHO_M("!!! Y_MIN_PIN ");
ECHO_EM(MSG_FWTEST_NDEF);
return;
#elif Y_HOME_DIR == 1
ECHO_EM("ERROR!!! Y_MAX_PIN not defined");
ECHO_M(MSG_FWTEST_ERROR);
ECHO_M("!!! Y_MAX_PIN ");
ECHO_EM(MSG_FWTEST_NDEF);
return;
#endif
......@@ -171,9 +231,22 @@ void FirmwareTest()
}
else
{
ECHO_EM("Z ENDSTOP ERROR");
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define Z_MIN_ENDSTOP_INVERTING");
ECHO_M("Z ENDSTOP ");
ECHO_EM(MSG_FWTEST_ERROR);
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Z_MIN_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_V(MSG_FWTEST_PRESS);
......@@ -200,9 +273,22 @@ void FirmwareTest()
}
else
{
ECHO_EM("Z ENDSTOP ERROR");
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define Z_MAX_ENDSTOP_INVERTING");
ECHO_M("Z ENDSTOP ");
ECHO_EM(MSG_FWTEST_ERROR);
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define Z_MAX_ENDSTOP_LOGIC ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_V(MSG_FWTEST_PRESS);
......@@ -223,14 +309,19 @@ void FirmwareTest()
return;
}
#elif Z_HOME_DIR == -1
ECHO_EM("ERROR!!! Z_MIN_PIN not defined");
ECHO_M(MSG_FWTEST_ERROR);
ECHO_M("!!! Z_MIN_PIN ");
ECHO_EM(MSG_FWTEST_NDEF);
return;
#elif Z_HOME_DIR == 1
ECHO_EM("ERROR!!! Z_MAX_PIN not defined");
ECHO_M(MSG_FWTEST_ERROR);
ECHO_M("!!! Z_MAX_PIN ");
ECHO_EM(MSG_FWTEST_NDEF);
return;
#endif
ECHO_EM("ENDSTOP OK");
ECHO_EM("ENDSTOP ");
ECHO_M(MSG_FWTEST_OK);
ECHO_EM(" ");
}
......@@ -265,12 +356,25 @@ void FirmwareTest()
serial_answer = MYSERIAL.read();
}
if(serial_answer=='y' || serial_answer=='Y'){
ECHO_EM("MOTOR X OK");
ECHO_EM("MOTOR X ");
ECHO_M(MSG_FWTEST_OK);
}
else
{
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define INVERT_X_DIR");
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_X_DIR ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_EM(" ");
......@@ -285,12 +389,25 @@ void FirmwareTest()
serial_answer = MYSERIAL.read();
}
if(serial_answer=='y' || serial_answer=='Y'){
ECHO_EM("MOTOR Y OK");
ECHO_EM("MOTOR Y ");
ECHO_M(MSG_FWTEST_OK);
}
else
{
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define INVERT_Y_DIR");
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_Y_DIR ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_EM(" ");
......@@ -305,15 +422,29 @@ void FirmwareTest()
serial_answer = MYSERIAL.read();
}
if(serial_answer=='y' || serial_answer=='Y'){
ECHO_EM("MOTOR Z OK");
ECHO_EM("MOTOR Z ");
ECHO_M(MSG_FWTEST_OK);
}
else
{
ECHO_V(MSG_FWTEST_INVERT);
ECHO_EM("#define INVERT_Z_DIR");
ECHO_M(MSG_FWTEST_INVERT);
ECHO_M("#define INVERT_Z_DIR ");
ECHO_M(MSG_FWTEST_INTO);
#if ENABLED(CARTESIAN)
ECHO_EM("Configuration_Cartesian.h");
#elif ENABLED(COREXY)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(COREXZ)
ECHO_EM("Configuration_Core.h");
#elif ENABLED(DELTA)
ECHO_EM("Configuration_Delta.h");
#elif ENABLED(SCARA)
ECHO_EM("Configuration_Scara.h");
#endif
return;
}
ECHO_EM("MOTOR OK");
ECHO_EM("MOTOR ");
ECHO_M(MSG_FWTEST_OK);
ECHO_EM(" ");
ECHO_V(MSG_FWTEST_END);
}
......@@ -195,7 +195,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -205,6 +205,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_AN_H
......@@ -195,7 +195,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -205,6 +205,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_EN_H
......@@ -196,7 +196,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -206,6 +206,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_DE_H
......@@ -200,7 +200,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -210,6 +210,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_EN_H
......@@ -195,7 +195,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -205,6 +205,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_ES_H
......@@ -64,6 +64,7 @@
#define MSG_MIN " " STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Fact"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Auto tenperatura"
#define MSG_ON "On "
#define MSG_OFF "Off"
......@@ -94,7 +95,7 @@
#define MSG_TEMPERATURE "Tenperatura"
#define MSG_MOTION "Mugimendua"
#define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3
#define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia."
#define MSG_CONTRAST "LCD kontrastea"
#define MSG_STORE_EPROM "Gorde memoria"
......@@ -169,7 +170,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -179,6 +180,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_EU_H
......@@ -64,6 +64,7 @@
#define MSG_MIN STR_THERMOMETER " Min"
#define MSG_MAX STR_THERMOMETER " Max"
#define MSG_FACTOR STR_THERMOMETER " Kerr"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "On "
#define MSG_OFF "Off"
......@@ -94,7 +95,7 @@
#define MSG_TEMPERATURE "L" STR_ae "mp" STR_oe "tila"
#define MSG_MOTION "Liike"
#define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3
#define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia."
#define MSG_CONTRAST "LCD kontrasti"
#define MSG_STORE_EPROM "Tallenna muistiin"
......@@ -169,7 +170,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -179,6 +180,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_FI_H
......@@ -65,6 +65,7 @@
#define MSG_MIN " " STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Facteur"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Temp. Auto."
#define MSG_ON "Marche "
#define MSG_OFF "Arret"
......@@ -172,7 +173,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -182,6 +183,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_FR_H
......@@ -196,7 +196,7 @@
#define MSG_FWTEST_YES_NO "Dai il comando Y o N per andare avanti"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Controllare cavi e connessioni"
#define MSG_FWTEST_PRESS "Premere e tenere premuto l'endstop "
#define MSG_FWTEST_INVERT "Invertire valore in "
#define MSG_FWTEST_INVERT "Invertire valore di "
#define MSG_FWTEST_XAXIS "Il nozzle si e' spostato a destra?"
#define MSG_FWTEST_YAXIS "Il nozzle si e' spostato in avanti?"
#define MSG_FWTEST_ZAXIS "Il nozzle si e' spostato in alto?"
......@@ -206,6 +206,10 @@
#define MSG_FWTEST_04 "Inizio controllo MOTORI"
#define MSG_FWTEST_ATTENTION "ATTENZIONE! Controlla che i tre assi siano a piu' di 5 mm dagli endstop!"
#define MSG_FWTEST_END "Test finito. Disabilitare FIRMWARE_TEST e ricompilare."
#define MSG_FWTEST_INTO "in "
#define MSG_FWTEST_ERROR "ERRORE"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "non definito"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_IT_H
......@@ -64,6 +64,7 @@
#define MSG_MIN " " STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Fact"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "Aan "
#define MSG_OFF "Uit"
......@@ -169,7 +170,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -179,6 +180,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_NL_H
......@@ -64,6 +64,7 @@
#define MSG_MIN " " STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Fact"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Auto. temperatura"
#define MSG_ON "Wl. "
#define MSG_OFF "Wyl."
......@@ -169,7 +170,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -179,6 +180,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_PL_H
......@@ -178,7 +178,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -188,6 +188,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_PT_BR_H
......@@ -64,6 +64,7 @@
#define MSG_MIN " " STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Fact"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "On "
#define MSG_OFF "Off"
......@@ -169,7 +170,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -179,6 +180,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_PT_H
......@@ -64,6 +64,7 @@
#define MSG_MIN " " STR_THERMOMETER "Минимум"
#define MSG_MAX " " STR_THERMOMETER "Максимум"
#define MSG_FACTOR " " STR_THERMOMETER "Фактор"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "Вкл."
#define MSG_OFF "Выкл."
......@@ -169,7 +170,7 @@
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_PRESS "Press and hold the endstop "
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_INVERT "Reverse value of "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
......@@ -179,6 +180,10 @@
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_INTO "into "
#define MSG_FWTEST_ERROR "ERROR"
#define MSG_FWTEST_OK "OK"
#define MSG_FWTEST_NDEF "not defined"
#endif // FIRMWARE_TEST
#endif // LANGUAGE_RU_H
......@@ -632,7 +632,7 @@
#define ORIG_TEMP_2_PIN 1 //ANALOG NUMBERING
#define ORIG_TEMP_BED_PIN 0 //ANALOG NUMBERING
#define BEEPER_PIN 36
#define BEEPER_PIN 36
#define KILL_PIN -1
......@@ -742,14 +742,14 @@
//bed pins
#define ORIG_HEATER_BED_PIN -1
#define ORIG_TEMP_BED_PIN -1
#define ORIG_TEMP_BED_PIN -1
#define SDSS -1
#define SDSS -1
#define SDPOWER -1
#define LED_PIN -1
//pin for controlling the PSU.
#define PS_ON_PIN 14 //Alex, Do this work on the card?
#define PS_ON_PIN 14 //Alex, Do this work on the card?
//Alex extras from Gen3+
#define KILL_PIN -1
......@@ -2142,12 +2142,12 @@
#ifdef ULTRA_LCD
// RADDS LCD panel
#ifdef NEWPANEL
#define LCD_PINS_RS 42
#define LCD_PINS_RS 42
#define LCD_PINS_ENABLE 43
#define LCD_PINS_D4 44
#define LCD_PINS_D5 45
#define LCD_PINS_D6 46
#define LCD_PINS_D7 47
#define LCD_PINS_D4 44
#define LCD_PINS_D5 45
#define LCD_PINS_D6 46
#define LCD_PINS_D7 47
#ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
#define BEEPER_PIN 41
......@@ -2513,11 +2513,11 @@
#define MOTOR_FAULT_PIN 22 // PB26 , motor X-Y-Z-E0 motor FAULT
#define SDPOWER -1
#define SDPOWER -1
#define SDSS 77 // PA28
#define SD_DETECT_PIN 87 // PA29
#define SD_DETECT_INVERTED false
#define LED_PIN -1
#define LED_PIN -1
#define ORIG_FAN_PIN 92 // PA5
#define FAN2_PIN 31 // PA7
......@@ -2668,7 +2668,7 @@
#if MB(STB_11)
#define ORIG_FAN_PIN 4
// Uncomment this if you have the first generation (V1.10) of STBs board
// Uncomment this if you have the first generation (V1.10) of STBs board
#define LCD_PIN_BL 17 // LCD backlight LED
#endif
......@@ -2743,10 +2743,10 @@
#define LCD_PINS_D4 17 //SCK (CLK) clock
#define BEEPER_PIN 27 // Pin 27 is take by LED_Pin, but Melzi LED do nothing with Marlin and I take this pin for BEEPER.... See here > [github.com] , If you want use this pin with Gcode M42 instead BEEPER
#else
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 30
#define DOGLCD_CS 29
#define LCD_CONTRAST 1
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 30
#define DOGLCD_CS 29
#define LCD_CONTRAST 1
#endif
// Uncomment screen orientation
#define LCD_SCREEN_ROT_0
......@@ -3595,9 +3595,9 @@
#define ORIG_HEATER_2_PIN 9 // thermo couple
#if TEMP_SENSOR_0 == -1
#define ORIG_TEMP_0_PIN 5 // ANALOG NUMBERING
#define ORIG_TEMP_0_PIN 5 // ANALOG NUMBERING
#else
#define ORIG_TEMP_0_PIN 7 // ANALOG NUMBERING
#define ORIG_TEMP_0_PIN 7 // ANALOG NUMBERING
#endif
#define ORIG_TEMP_1_PIN 6 // ANALOG NUMBERING
#define ORIG_TEMP_2_PIN -1 // ANALOG NUMBERING
......@@ -3605,7 +3605,7 @@
#define ORIG_HEATER_BED_PIN 3 // BED
#define ORIG_TEMP_BED_PIN 6 // ANALOG NUMBERING
#define BEEPER_PIN -1
#define BEEPER_PIN -1
#define LCD_PINS_RS -1
......@@ -3731,7 +3731,7 @@
#define ORIG_TEMP_BED_PIN 14 // ANALOG NUMBERING
#endif
#define BEEPER_PIN 61
#define BEEPER_PIN 61
#define LCD_PINS_RS 32
#define LCD_PINS_ENABLE 31
......@@ -3754,7 +3754,7 @@
#define BLEN_B 1
#define BLEN_A 0
#define SD_DETECT_PIN -1 // Megatronics does not use this port
#define SD_DETECT_PIN -1 // Megatronics does not use this port
#endif // MEGATRONICS_3
/****************************************************************************************/
......@@ -4651,7 +4651,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define ORIG_TEMP_2_PIN -1
#define SDPOWER -1
#define SD_DETECT_PIN -1
#define SD_DETECT_PIN -1
#define SDSS 20 // 8
#define LED_PIN 6
#define PS_ON_PIN 27
......@@ -5120,9 +5120,9 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
//#define DUE_SOFTWARE_SPI
#else
#define DUE_SOFTWARE_SPI
#define MOSI_PIN 51
#define MISO_PIN 50
#define SCK_PIN 52
#define MOSI_PIN 51
#define MISO_PIN 50
#define SCK_PIN 52
#endif
/****************************************************************************************/
......@@ -5296,7 +5296,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#ifdef LASERBEAM
#define LASER_PWR_PIN 41
#define LASER_TTL_PIN 42
#define LASER_TTL_PIN 42
#endif
#ifdef FILAMENT_RUNOUT_SENSOR
......
......@@ -317,5 +317,9 @@
#ifdef SDCARDDETECTINVERTED
#error SDCARDDETECTINVERTED is now SD_DETECT_INVERTED. Please update your configuration.
#endif
#if ENABLED(POWER_CONSUMPTION) && !PIN_EXISTS(POWER_CONSUMPTION)
#error You have to set a valid POWER_CONSUMPTION_PIN in pins.h in order to use this feature.
#endif
#endif //SANITYCHECK_H
......@@ -159,7 +159,7 @@ static void initISR(timer16_Sequence_t timer) {
TCNT3 = 0; // clear the timer count
#ifdef __AVR_ATmega128__
TIFR |= _BV(OCF3A); // clear any pending interrupts;
ETIMSK |= _BV(OCIE3A); // enable the output compare interrupt
ETIMSK |= _BV(OCIE3A); // enable the output compare interrupt
#else
TIFR3 = _BV(OCF3A); // clear any pending interrupts;
TIMSK3 = _BV(OCIE3A) ; // enable the output compare interrupt
......
......@@ -29,78 +29,78 @@
// Stepper objects of TMC steppers used
#if ENABLED(X_IS_TMC)
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR);
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR);
#endif
#if ENABLED(X2_IS_TMC)
TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR);
TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR);
#endif
#if ENABLED(Y_IS_TMC)
TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR);
TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR);
#endif
#if ENABLED(Y2_IS_TMC)
TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR);
TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR);
#endif
#if ENABLED(Z_IS_TMC)
TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR);
TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR);
#endif
#if ENABLED(Z2_IS_TMC)
TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR);
TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR);
#endif
#if ENABLED(E0_IS_TMC)
TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR);
TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR);
#endif
#if ENABLED(E1_IS_TMC)
TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR);
TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR);
#endif
#if ENABLED(E2_IS_TMC)
TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR);
TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR);
#endif
#if ENABLED(E3_IS_TMC)
TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR);
#endif
TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR);
#endif
#if ENABLED(HAVE_TMCDRIVER)
void tmc_init()
{
#if ENABLED(X_IS_TMC)
stepperX.setMicrosteps(X_MICROSTEPS);
stepperX.start();
stepperX.setMicrosteps(X_MICROSTEPS);
stepperX.start();
#endif
#if ENABLED(X2_IS_TMC)
stepperX2.setMicrosteps(X2_MICROSTEPS);
stepperX2.start();
stepperX2.setMicrosteps(X2_MICROSTEPS);
stepperX2.start();
#endif
#if ENABLED(Y_IS_TMC)
stepperY.setMicrosteps(Y_MICROSTEPS);
stepperY.start();
stepperY.setMicrosteps(Y_MICROSTEPS);
stepperY.start();
#endif
#if ENABLED(Y2_IS_TMC)
stepperY2.setMicrosteps(Y2_MICROSTEPS);
stepperY2.start();
stepperY2.setMicrosteps(Y2_MICROSTEPS);
stepperY2.start();
#endif
#if ENABLED(Z_IS_TMC)
stepperZ.setMicrosteps(Z_MICROSTEPS);
stepperZ.start();
stepperZ.setMicrosteps(Z_MICROSTEPS);
stepperZ.start();
#endif
#if ENABLED(Z2_IS_TMC)
stepperZ2.setMicrosteps(Z2_MICROSTEPS);
stepperZ2.start();
stepperZ2.setMicrosteps(Z2_MICROSTEPS);
stepperZ2.start();
#endif
#if ENABLED(E0_IS_TMC)
stepperE0.setMicrosteps(E0_MICROSTEPS);
stepperE0.start();
stepperE0.setMicrosteps(E0_MICROSTEPS);
stepperE0.start();
#endif
#if ENABLED(E1_IS_TMC)
stepperE1.setMicrosteps(E1_MICROSTEPS);
stepperE1.start();
stepperE1.setMicrosteps(E1_MICROSTEPS);
stepperE1.start();
#endif
#if ENABLED(E2_IS_TMC)
stepperE2.setMicrosteps(E2_MICROSTEPS);
stepperE2.start();
stepperE2.setMicrosteps(E2_MICROSTEPS);
stepperE2.start();
#endif
#if ENABLED(E3_IS_TMC)
stepperE3.setMicrosteps(E3_MICROSTEPS);
stepperE3.start();
stepperE3.setMicrosteps(E3_MICROSTEPS);
stepperE3.start();
#endif
}
#endif
......@@ -114,35 +114,35 @@ void tmc_init()
// L6470 Stepper objects
#if ENABLED(X_IS_L6470)
L6470 stepperX(X_ENABLE_PIN);
L6470 stepperX(X_ENABLE_PIN);
#endif
#if ENABLED(X2_IS_L6470)
L6470 stepperX2(X2_ENABLE_PIN);
L6470 stepperX2(X2_ENABLE_PIN);
#endif
#if ENABLED(Y_IS_L6470)
L6470 stepperY(Y_ENABLE_PIN);
L6470 stepperY(Y_ENABLE_PIN);
#endif
#if ENABLED(Y2_IS_L6470)
L6470 stepperY2(Y2_ENABLE_PIN);
L6470 stepperY2(Y2_ENABLE_PIN);
#endif
#if ENABLED(Z_IS_L6470)
L6470 stepperZ(Z_ENABLE_PIN);
L6470 stepperZ(Z_ENABLE_PIN);
#endif
#if ENABLED(Z2_IS_L6470)
L6470 stepperZ2(Z2_ENABLE_PIN);
L6470 stepperZ2(Z2_ENABLE_PIN);
#endif
#if ENABLED(E0_IS_L6470)
L6470 stepperE0(E0_ENABLE_PIN);
L6470 stepperE0(E0_ENABLE_PIN);
#endif
#if ENABLED(E1_IS_L6470)
L6470 stepperE1(E1_ENABLE_PIN);
L6470 stepperE1(E1_ENABLE_PIN);
#endif
#if ENABLED(E2_IS_L6470)
L6470 stepperE2(E2_ENABLE_PIN);
L6470 stepperE2(E2_ENABLE_PIN);
#endif
#if ENABLED(E3_IS_L6470)
L6470 stepperE3(E3_ENABLE_PIN);
#endif
L6470 stepperE3(E3_ENABLE_PIN);
#endif
// init routine
......@@ -150,75 +150,75 @@ void tmc_init()
void L6470_init()
{
#if ENABLED(X_IS_L6470)
stepperX.init(X_K_VAL);
stepperX.softFree();
stepperX.setMicroSteps(X_MICROSTEPS);
stepperX.init(X_K_VAL);
stepperX.softFree();
stepperX.setMicroSteps(X_MICROSTEPS);
stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection
stepperX.setStallCurrent(X_STALLCURRENT);
#endif
#if ENABLED(X2_IS_L6470)
stepperX2.init(X2_K_VAL);
stepperX2.softFree();
stepperX2.setMicroSteps(X2_MICROSTEPS);
stepperX2.init(X2_K_VAL);
stepperX2.softFree();
stepperX2.setMicroSteps(X2_MICROSTEPS);
stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection
stepperX2.setStallCurrent(X2_STALLCURRENT);
#endif
#if ENABLED(Y_IS_L6470)
stepperY.init(Y_K_VAL);
stepperY.softFree();
stepperY.setMicroSteps(Y_MICROSTEPS);
stepperY.init(Y_K_VAL);
stepperY.softFree();
stepperY.setMicroSteps(Y_MICROSTEPS);
stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection
stepperY.setStallCurrent(Y_STALLCURRENT);
#endif
#if ENABLED(Y2_IS_L6470)
stepperY2.init(Y2_K_VAL);
stepperY2.softFree();
stepperY2.setMicroSteps(Y2_MICROSTEPS);
stepperY2.init(Y2_K_VAL);
stepperY2.softFree();
stepperY2.setMicroSteps(Y2_MICROSTEPS);
stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection
stepperY2.setStallCurrent(Y2_STALLCURRENT);
#endif
#if ENABLED(Z_IS_L6470)
stepperZ.init(Z_K_VAL);
stepperZ.softFree();
stepperZ.setMicroSteps(Z_MICROSTEPS);
stepperZ.init(Z_K_VAL);
stepperZ.softFree();
stepperZ.setMicroSteps(Z_MICROSTEPS);
stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection
stepperZ.setStallCurrent(Z_STALLCURRENT);
#endif
#if ENABLED(Z2_IS_L6470)
stepperZ2.init(Z2_K_VAL);
stepperZ2.softFree();
stepperZ2.setMicroSteps(Z2_MICROSTEPS);
stepperZ2.init(Z2_K_VAL);
stepperZ2.softFree();
stepperZ2.setMicroSteps(Z2_MICROSTEPS);
stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection
stepperZ2.setStallCurrent(Z2_STALLCURRENT);
#endif
#if ENABLED(E0_IS_L6470)
stepperE0.init(E0_K_VAL);
stepperE0.softFree();
stepperE0.setMicroSteps(E0_MICROSTEPS);
stepperE0.init(E0_K_VAL);
stepperE0.softFree();
stepperE0.setMicroSteps(E0_MICROSTEPS);
stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection
stepperE0.setStallCurrent(E0_STALLCURRENT);
#endif
#if ENABLED(E1_IS_L6470)
stepperE1.init(E1_K_VAL);
stepperE1.softFree();
stepperE1.setMicroSteps(E1_MICROSTEPS);
stepperE1.init(E1_K_VAL);
stepperE1.softFree();
stepperE1.setMicroSteps(E1_MICROSTEPS);
stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection
stepperE1.setStallCurrent(E1_STALLCURRENT);
#endif
#if ENABLED(E2_IS_L6470)
stepperE2.init(E2_K_VAL);
stepperE2.softFree();
stepperE2.setMicroSteps(E2_MICROSTEPS);
stepperE2.init(E2_K_VAL);
stepperE2.softFree();
stepperE2.setMicroSteps(E2_MICROSTEPS);
stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection
stepperE2.setStallCurrent(E2_STALLCURRENT);
#endif
#if ENABLED(E3_IS_L6470)
stepperE3.init(E3_K_VAL);
stepperE3.softFree();
stepperE3.setMicroSteps(E3_MICROSTEPS);
stepperE3.init(E3_K_VAL);
stepperE3.softFree();
stepperE3.setMicroSteps(E3_MICROSTEPS);
stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection
stepperE3.setStallCurrent(E3_STALLCURRENT);
#endif
#endif
}
#endif
......@@ -960,7 +960,7 @@ void tp_init() {
// Use timer0 for temperature measurement
// Interleave temperature interrupt with millies interrupt
OCR0B = 128;
TIMSK0 |= BIT(OCIE0B);
TIMSK0 |= BIT(OCIE0B);
// Wait for temperature measurement to settle
delay(250);
......@@ -1052,7 +1052,7 @@ void tp_init() {
#if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED)
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
static float tr_last_temperature = 0.0
static float tr_target_temperature[HOTENDS + 1] = { 0.0 };
/*
ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: ");
......@@ -1070,31 +1070,49 @@ void tp_init() {
*state = TRReset;
switch (*state) {
case TRReset:
case TRReset: {
*timer = 0;
*state = TRInactive;
}
// Inactive state waits for a target temperature to be set
case TRInactive:
case TRInactive: {
if (target_temperature > 0) {
tr_last_temperature = temperature;
tr_target_temperature[heater_index] = target_temperature;
*timer = millis();
*state = TRFirstHeating;
}
break;
}
break;
// When first heating, wait for the temperature to be reached then go to Stable state
case TRFirstHeating:
// If the heater takes too long to reach the target temperature the sistem will be halt.
case TRFirstHeating: {
if (temperature >= tr_target_temperature[heater_index]) *state = TRStable;
break;
else if (temperature == tr_last_temperature) {
if (millis() > *timer + period_seconds * 1000UL) {
*state = TRRunaway;
}
}
else {
*timer = millis();
}
}
break;
// While the temperature is stable watch for a bad temperature
case TRStable:
case TRStable: {
// If the temperature is over the target (-hysteresis) restart the timer
if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc)
if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) {
*timer = millis();
}
// If the timer goes too long without a reset, trigger shutdown
else if (millis() > *timer + period_seconds * 1000UL)
else if (millis() > *timer + period_seconds * 1000UL) {
*state = TRRunaway;
break;
case TRRunaway:
}
}
break;
case TRRunaway: {
_temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), PSTR(MSG_THERMAL_RUNAWAY));
}
}
}
......
......@@ -45,7 +45,7 @@ void manage_heater(); //it is critical that this is called periodically.
// low level conversion routines
// do not use these routines and variables outside of temperature.cpp
extern int target_temperature[4];
extern int target_temperature[4];
extern float current_temperature[4];
#if ENABLED(SHOW_TEMP_ADC_VALUES)
extern int current_temperature_raw[4];
......
This diff is collapsed.
......@@ -301,7 +301,7 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const ui
*/
static void lcd_status_screen() {
encoderRateMultiplierEnabled = false;
encoderRateMultiplierEnabled = false;
#if ENABLED(LCD_PROGRESS_BAR)
millis_t ms = millis();
......@@ -861,6 +861,9 @@ static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, Y_MIN_POS, Y_MAX_
static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, Z_MIN_POS, Z_MAX_POS); }
static void lcd_move_e() {
if (encoderPosition != 0) {
#if ENABLED(IDLE_OOZING_PREVENT)
IDLE_OOZING_retract(false);
#endif
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
encoderPosition = 0;
line_to_current(E_AXIS);
......@@ -1021,7 +1024,7 @@ static void lcd_control_temperature_menu() {
//
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
#if ENABLED(IDLE_OOZING_PREVENT)
MENU_ITEM_EDIT(bool, MSG_IDLEOOZING, &idleoozing_enabled);
MENU_ITEM_EDIT(bool, MSG_IDLEOOZING, &IDLE_OOZING_enabled);
#endif
//
......@@ -1319,7 +1322,7 @@ static void lcd_sd_updir() {
*
*/
void lcd_sdcard_menu() {
if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
uint16_t fileCnt = card.getnrfilenames();
START_MENU(lcd_main_menu);
MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
......@@ -1969,18 +1972,20 @@ char *ftostr32(const float &x) {
// Convert float to string with 1.234 format
char *ftostr43(const float &x) {
long xx = x * 1000;
if (xx >= 0)
conv[0] = (xx / 1000) % 10 + '0';
else
conv[0] = '-';
xx = abs(xx);
conv[1] = '.';
conv[2] = (xx / 100) % 10 + '0';
conv[3] = (xx / 10) % 10 + '0';
conv[4] = (xx) % 10 + '0';
conv[5] = 0;
return conv;
long xx = x * 1000;
if (xx >= 0) {
conv[0] = (xx / 1000) % 10 + '0';
}
else {
conv[0] = '-';
}
xx = abs(xx);
conv[1] = '.';
conv[2] = (xx / 100) % 10 + '0';
conv[3] = (xx / 10) % 10 + '0';
conv[4] = (xx) % 10 + '0';
conv[5] = 0;
return conv;
}
// Convert float to string with 1.23 format
......@@ -2588,18 +2593,20 @@ char *ftostr32(const float &x) {
// Convert float to string with 1.234 format
char *ftostr43(const float &x) {
long xx = x * 1000;
if (xx >= 0)
conv[0] = (xx / 1000) % 10 + '0';
else
conv[0] = '-';
xx = abs(xx);
conv[1] = '.';
conv[2] = (xx / 100) % 10 + '0';
conv[3] = (xx / 10) % 10 + '0';
conv[4] = (xx) % 10 + '0';
conv[5] = 0;
return conv;
long xx = x * 1000;
if (xx >= 0) {
conv[0] = (xx / 1000) % 10 + '0';
}
else {
conv[0] = '-';
}
xx = abs(xx);
conv[1] = '.';
conv[2] = (xx / 100) % 10 + '0';
conv[3] = (xx / 10) % 10 + '0';
conv[4] = (xx) % 10 + '0';
conv[5] = 0;
return conv;
}
// Convert float to string with 1.23 format
......
......@@ -75,28 +75,28 @@
#define EN_A BIT(BLEN_A)
#define LCD_CLICKED (buttons&EN_C)
#if defined(BTN_BACK) && BTN_BACK > 0
#define EN_D BIT(BLEN_D)
#define LCD_BACK_CLICKED (buttons&EN_D)
#endif
#if defined(BTN_BACK) && BTN_BACK > 0
#define EN_D BIT(BLEN_D)
#define LCD_BACK_CLICKED (buttons&EN_D)
#endif
#if ENABLED(REPRAPWORLD_KEYPAD)
#define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3))
#define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2))
#define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1))
#define EN_REPRAPWORLD_KEYPAD_UP (BIT(BLEN_REPRAPWORLD_KEYPAD_UP))
#define EN_REPRAPWORLD_KEYPAD_RIGHT (BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT))
#define EN_REPRAPWORLD_KEYPAD_MIDDLE (BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
#define EN_REPRAPWORLD_KEYPAD_DOWN (BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN))
#define EN_REPRAPWORLD_KEYPAD_LEFT (BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT))
#define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
#define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
#define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
#define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
#define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
#define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
#define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
#define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
#define EN_REPRAPWORLD_KEYPAD_F3 (BIT(BLEN_REPRAPWORLD_KEYPAD_F3))
#define EN_REPRAPWORLD_KEYPAD_F2 (BIT(BLEN_REPRAPWORLD_KEYPAD_F2))
#define EN_REPRAPWORLD_KEYPAD_F1 (BIT(BLEN_REPRAPWORLD_KEYPAD_F1))
#define EN_REPRAPWORLD_KEYPAD_UP (BIT(BLEN_REPRAPWORLD_KEYPAD_UP))
#define EN_REPRAPWORLD_KEYPAD_RIGHT (BIT(BLEN_REPRAPWORLD_KEYPAD_RIGHT))
#define EN_REPRAPWORLD_KEYPAD_MIDDLE (BIT(BLEN_REPRAPWORLD_KEYPAD_MIDDLE))
#define EN_REPRAPWORLD_KEYPAD_DOWN (BIT(BLEN_REPRAPWORLD_KEYPAD_DOWN))
#define EN_REPRAPWORLD_KEYPAD_LEFT (BIT(BLEN_REPRAPWORLD_KEYPAD_LEFT))
#define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
#define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
#define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
#define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
#define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
#define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
#define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
#define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
#endif //REPRAPWORLD_KEYPAD
#else
//atomic, do not change
......
......@@ -403,7 +403,7 @@ static void lcd_implementation_init(
// required for RAMPS-FD, but does no harm for other targets
SET_OUTPUT(LCD_PINS_RS);
SET_OUTPUT(LCD_PINS_ENABLE);
#endif
#endif
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif
......
......@@ -27,36 +27,36 @@ vector_3::vector_3() : x(0), y(0), z(0) { }
vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
vector_3 vector_3::cross(vector_3 left, vector_3 right) {
return vector_3(left.y * right.z - left.z * right.y,
left.z * right.x - left.x * right.z,
left.x * right.y - left.y * right.x);
return vector_3(left.y * right.z - left.z * right.y,
left.z * right.x - left.x * right.z,
left.x * right.y - left.y * right.x);
}
vector_3 vector_3::operator+(vector_3 v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); }
vector_3 vector_3::operator-(vector_3 v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); }
vector_3 vector_3::get_normal() {
vector_3 normalized = vector_3(x, y, z);
normalized.normalize();
return normalized;
vector_3 normalized = vector_3(x, y, z);
normalized.normalize();
return normalized;
}
float vector_3::get_length() { return sqrt((x * x) + (y * y) + (z * z)); }
void vector_3::normalize() {
float length = get_length();
x /= length;
y /= length;
z /= length;
float length = get_length();
x /= length;
y /= length;
z /= length;
}
void vector_3::apply_rotation(matrix_3x3 matrix) {
float resultX = x * matrix.matrix[3*0+0] + y * matrix.matrix[3*1+0] + z * matrix.matrix[3*2+0];
float resultY = x * matrix.matrix[3*0+1] + y * matrix.matrix[3*1+1] + z * matrix.matrix[3*2+1];
float resultZ = x * matrix.matrix[3*0+2] + y * matrix.matrix[3*1+2] + z * matrix.matrix[3*2+2];
x = resultX;
y = resultY;
z = resultZ;
float resultX = x * matrix.matrix[3*0+0] + y * matrix.matrix[3*1+0] + z * matrix.matrix[3*2+0];
float resultY = x * matrix.matrix[3*0+1] + y * matrix.matrix[3*1+1] + z * matrix.matrix[3*2+1];
float resultZ = x * matrix.matrix[3*0+2] + y * matrix.matrix[3*1+2] + z * matrix.matrix[3*2+2];
x = resultX;
y = resultY;
z = resultZ;
}
void vector_3::debug(const char title[]) {
......@@ -67,29 +67,29 @@ void vector_3::debug(const char title[]) {
}
void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) {
vector_3 vector = vector_3(x, y, z);
vector.apply_rotation(matrix);
x = vector.x;
y = vector.y;
z = vector.z;
vector_3 vector = vector_3(x, y, z);
vector.apply_rotation(matrix);
x = vector.x;
y = vector.y;
z = vector.z;
}
matrix_3x3 matrix_3x3::create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2) {
//row_0.debug("row_0");
//row_1.debug("row_1");
//row_2.debug("row_2");
matrix_3x3 new_matrix;
new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z;
new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z;
new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z;
matrix_3x3 new_matrix;
new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z;
new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z;
new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z;
//new_matrix.debug("new_matrix");
return new_matrix;
return new_matrix;
}
void matrix_3x3::set_to_identity() {
matrix[0] = 1; matrix[1] = 0; matrix[2] = 0;
matrix[3] = 0; matrix[4] = 1; matrix[5] = 0;
matrix[6] = 0; matrix[7] = 0; matrix[8] = 1;
matrix[0] = 1; matrix[1] = 0; matrix[2] = 0;
matrix[3] = 0; matrix[4] = 1; matrix[5] = 0;
matrix[6] = 0; matrix[7] = 0; matrix[8] = 1;
}
matrix_3x3 matrix_3x3::create_look_at(vector_3 target) {
......
......@@ -24,35 +24,35 @@ class matrix_3x3;
struct vector_3
{
float x, y, z;
float x, y, z;
vector_3();
vector_3(float x, float y, float z);
vector_3(float x, float y, float z);
static vector_3 cross(vector_3 a, vector_3 b);
static vector_3 cross(vector_3 a, vector_3 b);
vector_3 operator+(vector_3 v);
vector_3 operator-(vector_3 v);
void normalize();
float get_length();
vector_3 get_normal();
vector_3 operator+(vector_3 v);
vector_3 operator-(vector_3 v);
void normalize();
float get_length();
vector_3 get_normal();
void debug(const char title[]);
void apply_rotation(matrix_3x3 matrix);
void debug(const char title[]);
void apply_rotation(matrix_3x3 matrix);
};
struct matrix_3x3
{
float matrix[9];
float matrix[9];
static matrix_3x3 create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2);
static matrix_3x3 create_look_at(vector_3 target);
static matrix_3x3 transpose(matrix_3x3 original);
static matrix_3x3 create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2);
static matrix_3x3 create_look_at(vector_3 target);
static matrix_3x3 transpose(matrix_3x3 original);
void set_to_identity();
void set_to_identity();
void debug(const char title[]);
void debug(const char title[]);
};
......
<img align="right" src="Documentation/Logo/MarlinKimbra%20Logo%20GitHub.png" />
# MarlinKimbra 3D Printer Firmware
## Version 4.1.3 dev
## Version 4.1.4 dev
* [Configuration & Compilation](/Documentation/Compilation.md)
* Supported
......@@ -34,16 +34,16 @@ Adding commands to facilitate purging of hotend.
Step per unit varied for each extruder as well as the feedrate.
The addition of a different feedrate for retraction.
Adding Debug Dryrun used by repetier.
Add total Power on time write in EEPROM
Added total Power on time writec in SD CARD.
Added total Power consumption writed in SD CARD.
Added anti extruder idle oozing system.
## Credits
The current MarlinKimbra dev team consists of:
- MagoKimbra - Alberto Cotronei (https://github.com/MagoKimbra)
More features have been added by:
- simone97 (https://github.com/simone97)
-
- simonepri - Simone Primarosa (https://github.com/simonepri)
## License
......
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