Commit 41d26978 authored by MagoKimbra's avatar MagoKimbra

Update 4.0.3

parent 1e446da3
...@@ -5,16 +5,9 @@ ...@@ -5,16 +5,9 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef BLINKM #ifdef BLINKM
#if (ARDUINO >= 100)
# include "Arduino.h"
#else
# include "WProgram.h"
#endif
#include "BlinkM.h" #include "BlinkM.h"
void SendColors(byte red, byte grn, byte blu) void SendColors(byte red, byte grn, byte blu) {
{
Wire.begin(); Wire.begin();
Wire.beginTransmission(0x09); Wire.beginTransmission(0x09);
Wire.write('o'); //to disable ongoing script, only needs to be used once Wire.write('o'); //to disable ongoing script, only needs to be used once
......
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
BlinkM.h BlinkM.h
Library header file for BlinkM library Library header file for BlinkM library
*/ */
#if (ARDUINO >= 100) #if ARDUINO >= 100
# include "Arduino.h" #include "Arduino.h"
#else #else
# include "WProgram.h" #include "WProgram.h"
#endif #endif
#include "Wire.h" #include "Wire.h"
void SendColors(byte red, byte grn, byte blu); void SendColors(byte red, byte grn, byte blu);
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
// User-specified version info of this build to display in [Pronterface, etc] terminal window during // 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 // 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. // build by the user have been successfully uploaded into firmware.
#define STRING_VERSION "4.0.2" #define STRING_VERSION " 4.0.3"
#define STRING_URL "reprap.org" #define STRING_URL "reprap.org"
#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
......
...@@ -5,39 +5,36 @@ ...@@ -5,39 +5,36 @@
#include "ultralcd.h" #include "ultralcd.h"
#include "ConfigurationStore.h" #include "ConfigurationStore.h"
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
{
uint8_t c; uint8_t c;
while(size--) while(size--) {
{
eeprom_write_byte((unsigned char*)pos, *value); eeprom_write_byte((unsigned char*)pos, *value);
c = eeprom_read_byte((unsigned char*)pos); c = eeprom_read_byte((unsigned char*)pos);
if (c != *value) if (c != *value) {
{
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
} }
pos++; pos++;
value++; value++;
} };
} }
void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
{ do {
do
{
*value = eeprom_read_byte((unsigned char*)pos); *value = eeprom_read_byte((unsigned char*)pos);
pos++; pos++;
value++; value++;
} while (--size); } while (--size);
} }
#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value)) #define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value)) #define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
//====================================================================================== //======================================================================================
#define DUMMY_PID_VALUE 3000.0f #define DUMMY_PID_VALUE 3000.0f
#define EEPROM_OFFSET 100 #define EEPROM_OFFSET 100
// IMPORTANT: Whenever there are changes made to the variables stored in EEPROM // IMPORTANT: Whenever there are changes made to the variables stored in EEPROM
// in the functions below, also increment the version number. This makes sure that // in the functions below, also increment the version number. This makes sure that
// the default values are used whenever there is a change to the data, to prevent // the default values are used whenever there is a change to the data, to prevent
...@@ -47,8 +44,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) ...@@ -47,8 +44,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
#define EEPROM_VERSION "V13" #define EEPROM_VERSION "V13"
#ifdef EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
void Config_StoreSettings() void Config_StoreSettings() {
{
float dummy = 0.0f; float dummy = 0.0f;
char ver[4] = "000"; char ver[4] = "000";
int i = EEPROM_OFFSET; int i = EEPROM_OFFSET;
......
#ifndef CONFIG_STORE_H #ifndef __CONFIGURATIONSTORE_H
#define CONFIG_STORE_H #define __CONFIGURATIONSTORE_H
#include "Configuration.h" #include "Configuration.h"
...@@ -19,4 +19,4 @@ void Config_ResetDefault(); ...@@ -19,4 +19,4 @@ void Config_ResetDefault();
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); } FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endif #endif
#endif //CONFIG_STORE_H #endif //__CONFIGURATIONSTORE_H
// Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware. // Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
// License: GPL // License: GPL
#ifndef MARLIN_H #ifndef __MARLIN_H
#define MARLIN_H #define __MARLIN_H
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n')) #define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n'))
#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n')) #define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n'))
extern const char errormagic[] PROGMEM; extern const char errormagic[] PROGMEM;
extern const char echomagic[] PROGMEM; extern const char echomagic[] PROGMEM;
...@@ -143,8 +144,8 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -143,8 +144,8 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } #define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#endif #endif
#else #else
#define enable_z(); #define enable_z() ;
#define disable_z(); #define disable_z() ;
#endif #endif
#if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1)
...@@ -181,8 +182,12 @@ void manage_inactivity(bool ignore_stepper_queue=false); ...@@ -181,8 +182,12 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e() {disable_e0(); disable_e1(); disable_e2(); disable_e3();} #define disable_e() {disable_e0(); disable_e1(); disable_e2(); disable_e3();}
enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3}; #ifdef COREXY
enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
#else
enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3};
#endif
void FlushSerialRequestResend(); void FlushSerialRequestResend();
void ClearToSend(); void ClearToSend();
...@@ -342,4 +347,4 @@ void FirmwareTest(); ...@@ -342,4 +347,4 @@ void FirmwareTest();
extern void calculate_volumetric_multipliers(); extern void calculate_volumetric_multipliers();
#endif //MARLIN_H #endif //__MARLIN_H
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
This diff is collapsed.
#ifndef CARDREADER_H #ifndef __CARDREADER_H
#define CARDREADER_H #define __CARDREADER_H
#ifdef SDSUPPORT #ifdef SDSUPPORT
#define MAX_DIR_DEPTH 10 #define MAX_DIR_DEPTH 10 // Maximum folder depth
#include "SdFile.h" #include "SdFile.h"
enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename}; enum LsAction { LS_SerialPrint, LS_Count, LS_GetFilename };
class CardReader
{ class CardReader {
public: public:
CardReader(); CardReader();
...@@ -33,7 +33,6 @@ public: ...@@ -33,7 +33,6 @@ public:
void getAbsFilename(char *t); void getAbsFilename(char *t);
void ls(); void ls();
void chdir(const char * relpath); void chdir(const char * relpath);
void updir(); void updir();
...@@ -41,56 +40,52 @@ public: ...@@ -41,56 +40,52 @@ public:
FORCE_INLINE bool isFileOpen() { return file.isOpen(); } FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
FORCE_INLINE bool eof() { return sdpos>=filesize ;}; FORCE_INLINE bool eof() { return sdpos >= filesize; }
FORCE_INLINE int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();}; FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); }
FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);}; FORCE_INLINE void setIndex(long index) { sdpos = index; file.seekSet(index); }
FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 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; bool saving, logging, sdprinting, cardOK, filenameIsDir;
bool logging; char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
bool sdprinting;
bool cardOK;
char filename[FILENAME_LENGTH];
char longFilename[LONG_FILENAME_LENGTH];
bool filenameIsDir;
int autostart_index; int autostart_index;
private: private:
SdFile root,*curDir,workDir,workDirParents[MAX_DIR_DEPTH]; SdFile root, *curDir, workDir, 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];
uint32_t filesize; uint32_t filesize;
//int16_t n;
unsigned long autostart_atmillis; unsigned long autostart_atmillis;
uint32_t sdpos ; uint32_t sdpos;
bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware. bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
LsAction lsAction; //stored for recursion. LsAction lsAction; //stored for recursion.
int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
char* diveDirName; char* diveDirName;
void lsDive(const char *prepend, SdFile parent, const char * const match=NULL); void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
}; };
extern CardReader card; extern CardReader card;
#define IS_SD_PRINTING (card.sdprinting) #define IS_SD_PRINTING (card.sdprinting)
#if (SDCARDDETECT > -1) #if (SDCARDDETECT > -1)
# ifdef SDCARDDETECTINVERTED #ifdef SDCARDDETECTINVERTED
# define IS_SD_INSERTED (READ(SDCARDDETECT)!=0) #define IS_SD_INSERTED (READ(SDCARDDETECT) != 0)
# else #else
# define IS_SD_INSERTED (READ(SDCARDDETECT)==0) #define IS_SD_INSERTED (READ(SDCARDDETECT) == 0)
# endif //SDCARDTETECTINVERTED #endif
#else #else
//If we don't have a card detect line, aways asume the card is inserted //No card detect line? Assume the card is inserted.
# define IS_SD_INSERTED true #define IS_SD_INSERTED true
#endif #endif
#else #else
...@@ -98,4 +93,5 @@ extern CardReader card; ...@@ -98,4 +93,5 @@ extern CardReader card;
#define IS_SD_PRINTING (false) #define IS_SD_PRINTING (false)
#endif //SDSUPPORT #endif //SDSUPPORT
#endif
#endif //__CARDREADER_H
#include "Configuration.h" #include "Configuration.h"
#ifdef DIGIPOT_I2C #ifdef DIGIPOT_I2C
#include "Stream.h" #include "Stream.h"
#include "utility/twi.h" #include "utility/twi.h"
#include "Wire.h" #include "Wire.h"
// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro // Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
#if MB(5DPRINT) #if MB(5DPRINT)
#define DIGIPOT_I2C_FACTOR 117.96 #define DIGIPOT_I2C_FACTOR 117.96
#define DIGIPOT_I2C_MAX_CURRENT 1.736 #define DIGIPOT_I2C_MAX_CURRENT 1.736
#else #else
#define DIGIPOT_I2C_FACTOR 106.7 #define DIGIPOT_I2C_FACTOR 106.7
#define DIGIPOT_I2C_MAX_CURRENT 2.5 #define DIGIPOT_I2C_MAX_CURRENT 2.5
#endif #endif
static byte current_to_wiper( float current ){ static byte current_to_wiper(float current) {
return byte(ceil(float((DIGIPOT_I2C_FACTOR*current)))); return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
} }
static void i2c_send(byte addr, byte a, byte b) static void i2c_send(byte addr, byte a, byte b) {
{
Wire.beginTransmission(addr); Wire.beginTransmission(addr);
Wire.write(a); Wire.write(a);
Wire.write(b); Wire.write(b);
...@@ -27,33 +27,32 @@ static void i2c_send(byte addr, byte a, byte b) ...@@ -27,33 +27,32 @@ static void i2c_send(byte addr, byte a, byte b)
} }
// This is for the MCP4451 I2C based digipot // This is for the MCP4451 I2C based digipot
void digipot_i2c_set_current( int channel, float current ) void digipot_i2c_set_current(int channel, float current) {
{
current = min( (float) max( current, 0.0f ), DIGIPOT_I2C_MAX_CURRENT); current = min( (float) max( current, 0.0f ), DIGIPOT_I2C_MAX_CURRENT);
// these addresses are specific to Azteeg X3 Pro, can be set to others, // these addresses are specific to Azteeg X3 Pro, can be set to others,
// In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1 // 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 byte addr = 0x2C; // channel 0-3
if(channel >= 4) { if (channel >= 4) {
addr= 0x2E; // channel 4-7 addr = 0x2E; // channel 4-7
channel-= 4; channel -= 4;
} }
// Initial setup // Initial setup
i2c_send( addr, 0x40, 0xff ); i2c_send(addr, 0x40, 0xff);
i2c_send( addr, 0xA0, 0xff ); i2c_send(addr, 0xA0, 0xff);
// Set actual wiper value // Set actual wiper value
byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 }; byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 };
i2c_send( addr, addresses[channel], current_to_wiper(current) ); i2c_send(addr, addresses[channel], current_to_wiper(current));
} }
void digipot_i2c_init() void digipot_i2c_init() {
{
const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS; const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
Wire.begin(); Wire.begin();
// setup initial currents as defined in Configuration_adv.h // setup initial currents as defined in Configuration_adv.h
for(int i=0;i<=sizeof(digipot_motor_current)/sizeof(float);i++) { for(int i = 0; i <= sizeof(digipot_motor_current) / sizeof(float); i++) {
digipot_i2c_set_current(i, digipot_motor_current[i]); digipot_i2c_set_current(i, digipot_motor_current[i]);
} }
} }
#endif
#endif //DIGIPOT_I2C
...@@ -14,24 +14,20 @@ ...@@ -14,24 +14,20 @@
#ifndef DOGM_LCD_IMPLEMENTATION_H #ifndef DOGM_LCD_IMPLEMENTATION_H
#define DOGM_LCD_IMPLEMENTATION_H #define DOGM_LCD_IMPLEMENTATION_H
#define MARLIN_VERSION "4.0.2" #define MARLIN_VERSION " 4.0.3"
/** /**
* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays. * Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
**/ **/
#ifdef ULTIPANEL #ifdef ULTIPANEL
#define BLEN_A 0 #define BLEN_A 0
#define BLEN_B 1 #define BLEN_B 1
#define BLEN_C 2 #define BLEN_C 2
#define EN_A (1<<BLEN_A) #define EN_A (1<<BLEN_A)
#define EN_B (1<<BLEN_B) #define EN_B (1<<BLEN_B)
#define EN_C (1<<BLEN_C) #define EN_C (1<<BLEN_C)
#define encrot0 0 #define LCD_CLICKED (buttons&EN_C)
#define encrot1 2
#define encrot2 3
#define encrot3 1
#define LCD_CLICKED (buttons&EN_C)
#endif #endif
#include <U8glib.h> #include <U8glib.h>
......
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
/// check if pin is an timer wrapper /// check if pin is an timer wrapper
#define GET_TIMER(IO) _GET_TIMER(IO) #define GET_TIMER(IO) _GET_TIMER(IO)
/// Shorthand
#define OUT_WRITE(IO, v) { SET_OUTPUT(IO); WRITE(IO, v); }
/* /*
ports and functions ports and functions
......
#ifndef LANGUAGE_H #ifndef __LANGUAGE_H
#define LANGUAGE_H #define __LANGUAGE_H
// NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES // NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES
// //
...@@ -149,6 +149,7 @@ ...@@ -149,6 +149,7 @@
#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" #define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!"
// temperature.cpp strings
#define MSG_PID_AUTOTUNE "PID Autotune" #define MSG_PID_AUTOTUNE "PID Autotune"
#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start" #define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE " start"
#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!" #define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!"
...@@ -185,6 +186,7 @@ ...@@ -185,6 +186,7 @@
#define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX #define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX
#define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX #define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX
// LCD Menu Messages
// Add your own character. Reference: https://www.sparkfun.com/datasheets/LCD/HD44780.pdf page 17-18 // Add your own character. Reference: https://www.sparkfun.com/datasheets/LCD/HD44780.pdf page 17-18
#ifdef DOGLCD #ifdef DOGLCD
#define STR_Ae "\304" // 'Ä' U8glib #define STR_Ae "\304" // 'Ä' U8glib
......
...@@ -473,12 +473,6 @@ ...@@ -473,12 +473,6 @@
//Cheaptronic v1.0 does not use this port //Cheaptronic v1.0 does not use this port
#define SDCARDDETECT -1 #define SDCARDDETECT -1
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // CHEAPTRONIC #endif // CHEAPTRONIC
/****************************************************************************************/ /****************************************************************************************/
...@@ -643,13 +637,6 @@ ...@@ -643,13 +637,6 @@
#define BLEN_C 2 #define BLEN_C 2
#define BLEN_B 1 #define BLEN_B 1
#define BLEN_A 0 #define BLEN_A 0
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif //RA_CONTROL_PANEL #endif //RA_CONTROL_PANEL
#ifdef RA_DISCO #ifdef RA_DISCO
...@@ -1743,11 +1730,6 @@ ...@@ -1743,11 +1730,6 @@
#define SDCARDDETECT 81 // Ramps does not use this port #define SDCARDDETECT 81 // Ramps does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#else //old style panel with shift register #else //old style panel with shift register
//arduino pin witch triggers an piezzo beeper //arduino pin witch triggers an piezzo beeper
#define BEEPER 33 No Beeper added #define BEEPER 33 No Beeper added
...@@ -1765,12 +1747,6 @@ ...@@ -1765,12 +1747,6 @@
#define LCD_PINS_D6 27 #define LCD_PINS_D6 27
#define LCD_PINS_D7 29 #define LCD_PINS_D7 29
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
//bits in the shift register that carry the buttons for: //bits in the shift register that carry the buttons for:
// left up center down right red // left up center down right red
#define BL_LE 7 #define BL_LE 7
...@@ -2715,13 +2691,8 @@ ...@@ -2715,13 +2691,8 @@
#define BLEN_A 0 #define BLEN_A 0
#define SDCARDDETECT -1 // Ramps does not use this port #define SDCARDDETECT -1 // Ramps does not use this port
#endif //NEWPANEL
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif
#endif //ULTRA_LCD #endif //ULTRA_LCD
#endif // MEGATRONICS #endif // MEGATRONICS
...@@ -2836,12 +2807,6 @@ ...@@ -2836,12 +2807,6 @@
#define SDCARDDETECT -1 // Megatronics does not use this port #define SDCARDDETECT -1 // Megatronics does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // MEGATRONICS_2 #endif // MEGATRONICS_2
/****************************************************************************************/ /****************************************************************************************/
...@@ -2939,12 +2904,6 @@ ...@@ -2939,12 +2904,6 @@
#define SDCARDDETECT -1 // Megatronics does not use this port #define SDCARDDETECT -1 // Megatronics does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // MEGATRONICS_1 #endif // MEGATRONICS_1
/****************************************************************************************/ /****************************************************************************************/
...@@ -3070,12 +3029,6 @@ ...@@ -3070,12 +3029,6 @@
#define SDCARDDETECT -1 // Megatronics does not use this port #define SDCARDDETECT -1 // Megatronics does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // MEGATRONICS_3 #endif // MEGATRONICS_3
/****************************************************************************************/ /****************************************************************************************/
...@@ -4424,6 +4377,21 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -4424,6 +4377,21 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
************************************* FEATURE ******************************************* ************************************* FEATURE *******************************************
/****************************************************************************************/ /****************************************************************************************/
#ifdef SINGLENOZZLE
#undef HEATER_1_PIN
#undef HEATER_2_PIN
#undef HEATER_3_PIN
#define HEATER_1_PIN -1
#define HEATER_2_PIN -1
#define HEATER_3_PIN -1
#undef TEMP_1_PIN
#undef TEMP_2_PIN
#undef TEMP_3_PIN
#define TEMP_1_PIN -1
#define TEMP_2_PIN -1
#define TEMP_3_PIN -1
#endif //SINGLENOZZLE
#ifdef MKR4 #ifdef MKR4
#if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS==1) // Use this for one driver and two extruder #if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS==1) // Use this for one driver and two extruder
#define E0E1_CHOICE_PIN 5 #define E0E1_CHOICE_PIN 5
...@@ -4488,21 +4456,27 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -4488,21 +4456,27 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif #endif
#if X_HOME_DIR > 0 //Home X to MAX #if X_HOME_DIR > 0 //Home X to MAX
#undef X_MIN_PIN
#define X_MIN_PIN -1 #define X_MIN_PIN -1
#elif X_HOME_DIR < 0 //Home X to MIN #elif X_HOME_DIR < 0 //Home X to MIN
#undef X_MAX_PIN
#define X_MAX_PIN -1 #define X_MAX_PIN -1
#endif //X_HOME_DIR > 0 #endif //X_HOME_DIR > 0
#if Y_HOME_DIR > 0 //Home Y to MAX #if Y_HOME_DIR > 0 //Home Y to MAX
#undef Y_MIN_PIN
#define Y_MIN_PIN -1 #define Y_MIN_PIN -1
#elif Y_HOME_DIR < 0 //Home Y to MIN #elif Y_HOME_DIR < 0 //Home Y to MIN
#undef Y_MAX_PIN
#define Y_MAX_PIN -1 #define Y_MAX_PIN -1
#endif //Y_HOME_DIR > 0 #endif //Y_HOME_DIR > 0
#ifndef DELTA #ifndef DELTA
#if Z_HOME_DIR > 0 //Home Z to MAX #if Z_HOME_DIR > 0 //Home Z to MAX
#undef Z_MIN_PIN
#define Z_MIN_PIN -1 #define Z_MIN_PIN -1
#elif Z_HOME_DIR < 0 //Home Z to MIN #elif Z_HOME_DIR < 0 //Home Z to MIN
#undef Z_MAX_PIN
#define Z_MAX_PIN -1 #define Z_MAX_PIN -1
#endif //Z_HOME_DIR > 0 #endif //Z_HOME_DIR > 0
#endif //!DELTA #endif //!DELTA
......
...@@ -2,5 +2,42 @@ ...@@ -2,5 +2,42 @@
//==================== Change PIN width Configurator Tool ==================== //==================== Change PIN width Configurator Tool ====================
//============================================================================ //============================================================================
//X axis pins
#define ORIG_X_STEP_PIN X_STEP_PIN
#define ORIG_X_DIR_PIN X_DIR_PIN
#define ORIG_X_ENABLE_PIN X_ENABLE_PIN
//Y axis pins
#define ORIG_Y_STEP_PIN Y_STEP_PIN
#define ORIG_Y_DIR_PIN Y_DIR_PIN
#define ORIG_Y_ENABLE_PIN Y_ENABLE_PIN
//Z axis pins
#define ORIG_Z_STEP_PIN Z_STEP_PIN
#define ORIG_Z_DIR_PIN Z_DIR_PIN
#define ORIG_Z_ENABLE_PIN Z_ENABLE_PIN
//E axis pins
#define ORIG_E0_STEP_PIN E0_STEP_PIN
#define ORIG_E0_DIR_PIN E0_DIR_PIN
#define ORIG_E0_ENABLE_PIN E0_ENABLE_PIN
#define ORIG_E1_STEP_PIN E1_STEP_PIN
#define ORIG_E1_DIR_PIN E1_DIR_PIN
#define ORIG_E1_ENABLE_PIN E1_ENABLE_PIN
#define ORIG_E2_STEP_PIN E2_STEP_PIN
#define ORIG_E2_DIR_PIN E2_DIR_PIN
#define ORIG_E2_ENABLE_PIN E2_ENABLE_PIN
#define ORIG_E3_STEP_PIN E3_STEP_PIN
#define ORIG_E3_DIR_PIN E3_DIR_PIN
#define ORIG_E3_ENABLE_PIN E3_ENABLE_PIN
//FAN pin
#define ORIG_FAN_PIN FAN_PIN
//============================================================================
//============================================================================ //============================================================================
\ No newline at end of file
...@@ -669,7 +669,15 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -669,7 +669,15 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
{ {
block->direction_bits |= (1<<Y_AXIS); block->direction_bits |= (1<<Y_AXIS);
} }
#else #else //COREXY
if (target[X_AXIS] < position[X_AXIS])
{
block->direction_bits |= (1<<X_HEAD);
}
if (target[Y_AXIS] < position[Y_AXIS])
{
block->direction_bits |= (1<<Y_HEAD);
}
if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0) if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
{ {
block->direction_bits |= (1<<X_AXIS); block->direction_bits |= (1<<X_AXIS);
...@@ -678,7 +686,7 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -678,7 +686,7 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
{ {
block->direction_bits |= (1<<Y_AXIS); block->direction_bits |= (1<<Y_AXIS);
} }
#endif #endif //COREXY
if (target[Z_AXIS] < position[Z_AXIS]) if (target[Z_AXIS] < position[Z_AXIS])
{ {
block->direction_bits |= (1<<Z_AXIS); block->direction_bits |= (1<<Z_AXIS);
...@@ -692,15 +700,14 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -692,15 +700,14 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
//enable active axes //enable active axes
#ifdef COREXY #ifdef COREXY
if((block->steps_x != 0) || (block->steps_y != 0)) if((block->steps_x != 0) || (block->steps_y != 0)) {
{
enable_x(); enable_x();
enable_y(); enable_y();
} }
#else #else //NO COREXY
if(block->steps_x != 0) enable_x(); if(block->steps_x != 0) enable_x();
if(block->steps_y != 0) enable_y(); if(block->steps_y != 0) enable_y();
#endif // COREXY #endif //NOCOREXY
#ifndef Z_LATE_ENABLE #ifndef Z_LATE_ENABLE
if(block->steps_z != 0) enable_z(); if(block->steps_z != 0) enable_z();
#endif #endif
...@@ -770,14 +777,24 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -770,14 +777,24 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
if(feed_rate<minimumfeedrate) feed_rate=minimumfeedrate; if(feed_rate<minimumfeedrate) feed_rate=minimumfeedrate;
} }
float delta_mm[4]; /* This part of the code calculates the total length of the movement.
For cartesian bots, the X_AXIS is the real X movement and same for Y_AXIS.
But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors (that should be named to A_AXIS
and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y.
So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
*/
#ifndef COREXY #ifndef COREXY
float delta_mm[4];
delta_mm[X_AXIS] = (target[X_AXIS]-position[X_AXIS])/axis_steps_per_unit[X_AXIS]; delta_mm[X_AXIS] = (target[X_AXIS]-position[X_AXIS])/axis_steps_per_unit[X_AXIS];
delta_mm[Y_AXIS] = (target[Y_AXIS]-position[Y_AXIS])/axis_steps_per_unit[Y_AXIS]; delta_mm[Y_AXIS] = (target[Y_AXIS]-position[Y_AXIS])/axis_steps_per_unit[Y_AXIS];
#else #else
float delta_mm[6];
delta_mm[X_HEAD] = (target[X_AXIS]-position[X_AXIS])/axis_steps_per_unit[X_AXIS];
delta_mm[Y_HEAD] = (target[Y_AXIS]-position[Y_AXIS])/axis_steps_per_unit[Y_AXIS];
delta_mm[X_AXIS] = ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[X_AXIS]; delta_mm[X_AXIS] = ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[X_AXIS];
delta_mm[Y_AXIS] = ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[Y_AXIS]; delta_mm[Y_AXIS] = ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[Y_AXIS];
#endif // COREXY #endif
delta_mm[Z_AXIS] = (target[Z_AXIS]-position[Z_AXIS])/axis_steps_per_unit[Z_AXIS]; delta_mm[Z_AXIS] = (target[Z_AXIS]-position[Z_AXIS])/axis_steps_per_unit[Z_AXIS];
delta_mm[E_AXIS] = ((target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[active_extruder+3])*volumetric_multiplier[active_extruder]*extruder_multiplier[active_extruder]/100.0; delta_mm[E_AXIS] = ((target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[active_extruder+3])*volumetric_multiplier[active_extruder]*extruder_multiplier[active_extruder]/100.0;
if ( block->steps_x <=dropsegments && block->steps_y <=dropsegments && block->steps_z <=dropsegments ) if ( block->steps_x <=dropsegments && block->steps_y <=dropsegments && block->steps_z <=dropsegments )
...@@ -786,7 +803,11 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -786,7 +803,11 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
} }
else else
{ {
#ifndef COREXY
block->millimeters = sqrt(square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS])); block->millimeters = sqrt(square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS]));
#else
block->millimeters = sqrt(square(delta_mm[X_HEAD]) + square(delta_mm[Y_HEAD]) + square(delta_mm[Z_AXIS]));
#endif
} }
float inverse_millimeters = 1.0/block->millimeters; // Inverse millimeters to remove multiple divides float inverse_millimeters = 1.0/block->millimeters; // Inverse millimeters to remove multiple divides
...@@ -809,9 +830,9 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi ...@@ -809,9 +830,9 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
if (segment_time < minsegmenttime) if (segment_time < minsegmenttime)
{ // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. { // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
inverse_second=1000000.0/(segment_time+lround(2*(minsegmenttime-segment_time)/moves_queued)); inverse_second=1000000.0/(segment_time+lround(2*(minsegmenttime-segment_time)/moves_queued));
#ifdef XY_FREQUENCY_LIMIT #ifdef XY_FREQUENCY_LIMIT
segment_time = lround(1000000.0/inverse_second); segment_time = lround(1000000.0/inverse_second);
#endif // XY_FREQUENCY_LIMIT #endif
} }
} }
#endif // SLOWDOWN #endif // SLOWDOWN
...@@ -1136,17 +1157,12 @@ uint8_t movesplanned() ...@@ -1136,17 +1157,12 @@ uint8_t movesplanned()
} }
#ifdef PREVENT_DANGEROUS_EXTRUDE #ifdef PREVENT_DANGEROUS_EXTRUDE
void set_extrude_min_temp(float temp) void set_extrude_min_temp(float temp) { extrude_min_temp = temp; }
{
extrude_min_temp=temp;
}
#endif #endif
// Calculate the steps/s^2 acceleration rates, based on the mm/s^s // Calculate the steps/s^2 acceleration rates, based on the mm/s^s
void reset_acceleration_rates() void reset_acceleration_rates() {
{ for(int8_t i=0; i < 3 + EXTRUDERS; i++) {
for(int8_t i=0; i < 3 + EXTRUDERS; i++)
{
axis_steps_per_sqr_second[i] = max_acceleration_units_per_sq_second[i] * axis_steps_per_unit[i]; axis_steps_per_sqr_second[i] = max_acceleration_units_per_sq_second[i] * axis_steps_per_unit[i];
} }
} }
...@@ -41,12 +41,12 @@ typedef struct { ...@@ -41,12 +41,12 @@ typedef struct {
long acceleration_rate; // The acceleration rate used for acceleration calculation long acceleration_rate; // The acceleration rate used for acceleration calculation
unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h) unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
unsigned char active_driver; // Selects the active driver unsigned char active_driver; // Selects the active driver
#ifdef ADVANCE #ifdef ADVANCE
long advance_rate; long advance_rate;
volatile long initial_advance; volatile long initial_advance;
volatile long final_advance; volatile long final_advance;
float advance; float advance;
#endif #endif
// Fields used by the motion planner to manage acceleration // Fields used by the motion planner to manage acceleration
// float speed_x, speed_y, speed_z, speed_e; // Nominal mm/sec for each axis // float speed_x, speed_y, speed_z, speed_e; // Nominal mm/sec for each axis
...@@ -64,13 +64,13 @@ typedef struct { ...@@ -64,13 +64,13 @@ typedef struct {
unsigned long final_rate; // The minimal rate at exit unsigned long final_rate; // The minimal rate at exit
unsigned long acceleration_st; // acceleration steps/sec^2 unsigned long acceleration_st; // acceleration steps/sec^2
unsigned long fan_speed; unsigned long fan_speed;
#ifdef BARICUDA #ifdef BARICUDA
unsigned long valve_pressure; unsigned long valve_pressure;
unsigned long e_to_p_pressure; unsigned long e_to_p_pressure;
#endif #endif
#ifdef LASERBEAM #ifdef LASERBEAM
unsigned long laser_ttlmodulation; unsigned long laser_ttlmodulation;
#endif #endif
volatile char busy; volatile char busy;
} block_t; } block_t;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1096,13 +1096,26 @@ const short temptable_1047[][2] PROGMEM = { ...@@ -1096,13 +1096,26 @@ const short temptable_1047[][2] PROGMEM = {
#endif #endif
#if (THERMISTORHEATER_0 == 999) || (THERMISTORHEATER_1 == 999) || (THERMISTORHEATER_2 == 999) || (THERMISTORHEATER_3 == 999) || (THERMISTORBED == 999) //User defined table #if (THERMISTORHEATER_0 == 999) || (THERMISTORHEATER_1 == 999) || (THERMISTORHEATER_2 == 999) || (THERMISTORHEATER_3 == 999) || (THERMISTORBED == 999) //User defined table
// Dummy Thermistor table.. It will ALWAYS read 25C. // Dummy Thermistor table.. It will ALWAYS read a fixed value.
const short temptable_999[][2] PROGMEM = { #ifndef DUMMY_THERMISTOR_999_VALUE
{1*OVERSAMPLENR, 25}, #define DUMMY_THERMISTOR_999_VALUE 25
{1023*OVERSAMPLENR, 25} #endif
const short temptable_999[][2] PROGMEM = {
{1*OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE},
{1023*OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE}
}; };
#endif #endif
#if (THERMISTORHEATER_0 == 998) || (THERMISTORHEATER_1 == 998) || (THERMISTORHEATER_2 == 998) || (THERMISTORHEATER_3 == 998) || (THERMISTORBED == 998) //User defined table
// Dummy Thermistor table.. It will ALWAYS read a fixed value.
#ifndef DUMMY_THERMISTOR_998_VALUE
#define DUMMY_THERMISTOR_998_VALUE 25
#endif
const short temptable_998[][2] PROGMEM = {
{1*OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE},
{1023*OVERSAMPLENR, DUMMY_THERMISTOR_998_VALUE}
};
#endif
#define _TT_NAME(_N) temptable_ ## _N #define _TT_NAME(_N) temptable_ ## _N
......
...@@ -802,7 +802,7 @@ static void lcd_control_menu() { ...@@ -802,7 +802,7 @@ static void lcd_control_menu() {
MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
#ifdef DOGLCD #ifdef DOGLCD
// MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
#endif #endif
#ifdef FWRETRACT #ifdef FWRETRACT
...@@ -869,9 +869,9 @@ static void lcd_control_temperature_menu() { ...@@ -869,9 +869,9 @@ static void lcd_control_temperature_menu() {
#if TEMP_SENSOR_3 != 0 #if TEMP_SENSOR_3 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
#endif #endif
#endif #endif //EXTRUDERS > 3
#endif #endif //EXTRUDERS > 2
#endif #endif //EXTRUDERS > 1
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
#endif #endif
...@@ -1037,6 +1037,7 @@ static void lcd_control_volumetric_menu() ...@@ -1037,6 +1037,7 @@ static void lcd_control_volumetric_menu()
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
} }
END_MENU(); END_MENU();
} }
...@@ -1495,6 +1496,16 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } ...@@ -1495,6 +1496,16 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#ifdef ULTIPANEL #ifdef ULTIPANEL
// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
// These values are independent of which pins are used for EN_A and EN_B indications
// The rotary encoder part is also independent to the chipset used for the LCD
#if defined(EN_A) && defined(EN_B)
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif
/* Warning: This function is called from interrupt context */ /* Warning: This function is called from interrupt context */
void lcd_buttons_update() { void lcd_buttons_update() {
#ifdef NEWPANEL #ifdef NEWPANEL
...@@ -1887,20 +1898,20 @@ char *ftostr52(const float &x) ...@@ -1887,20 +1898,20 @@ char *ftostr52(const float &x)
// grab the PID i value out of the temp variable; scale it; then update the PID driver // grab the PID i value out of the temp variable; scale it; then update the PID driver
void copy_and_scalePID_i() void copy_and_scalePID_i()
{ {
#ifdef PIDTEMP #ifdef PIDTEMP
Ki[active_extruder] = scalePID_i(raw_Ki); Ki[active_extruder] = scalePID_i(raw_Ki);
updatePID(); updatePID();
#endif #endif
} }
// Callback for after editing PID d value // Callback for after editing PID d value
// grab the PID d value out of the temp variable; scale it; then update the PID driver // grab the PID d value out of the temp variable; scale it; then update the PID driver
void copy_and_scalePID_d() void copy_and_scalePID_d()
{ {
#ifdef PIDTEMP #ifdef PIDTEMP
Kd[active_extruder] = scalePID_d(raw_Kd); Kd[active_extruder] = scalePID_d(raw_Kd);
updatePID(); updatePID();
#endif #endif
} }
#endif //ULTRA_LCD #endif //ULTRA_LCD
...@@ -123,17 +123,6 @@ ...@@ -123,17 +123,6 @@
#define LCD_CLICKED (buttons&(B_MI|B_ST)) #define LCD_CLICKED (buttons&(B_MI|B_ST))
#endif #endif
////////////////////////
// Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
// These values are independent of which pins are used for EN_A and EN_B indications
// The rotary encoder part is also independent to the chipset used for the LCD
#if defined(EN_A) && defined(EN_B)
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif
#endif //ULTIPANEL #endif //ULTIPANEL
//////////////////////////////////// ////////////////////////////////////
......
...@@ -47,12 +47,9 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo ...@@ -47,12 +47,9 @@ uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, vo
{ {
case U8G_DEV_MSG_INIT: case U8G_DEV_MSG_INIT:
{ {
SET_OUTPUT(ST7920_CS_PIN); OUT_WRITE(ST7920_CS_PIN,LOW);
WRITE(ST7920_CS_PIN,0); OUT_WRITE(ST7920_DAT_PIN,LOW);
SET_OUTPUT(ST7920_DAT_PIN); OUT_WRITE(ST7920_CLK_PIN,HIGH);
WRITE(ST7920_DAT_PIN,0);
SET_OUTPUT(ST7920_CLK_PIN);
WRITE(ST7920_CLK_PIN,1);
ST7920_CS(); ST7920_CS();
u8g_Delay(120); //initial delay for boot up u8g_Delay(120); //initial delay for boot up
......
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