Merge pull request #1 from MarlinFirmware/Development

dev pull
master
Wurstnase 10 years ago
commit 92ebb7f4c8

@ -33,7 +33,7 @@ rambo.build.variant=rambo
######################################## ########################################
sanguino.name=Sanguino sanguino.name=Sanguino
sanguino.upload.tool=ardunio:avrdude sanguino.upload.tool=arduino:avrdude
sanguino.upload.protocol=stk500 sanguino.upload.protocol=stk500
sanguino.upload.maximum_size=131072 sanguino.upload.maximum_size=131072
sanguino.upload.speed=57600 sanguino.upload.speed=57600

@ -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,7 +2,7 @@
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"
@ -11,4 +11,3 @@
#include "Wire.h" #include "Wire.h"
void SendColors(byte red, byte grn, byte blu); void SendColors(byte red, byte grn, byte blu);

@ -118,10 +118,15 @@ Here are some standard links for getting your machine calibrated:
// 1010 is Pt1000 with 1k pullup (non standard) // 1010 is Pt1000 with 1k pullup (non standard)
// 147 is Pt100 with 4k7 pullup // 147 is Pt100 with 4k7 pullup
// 110 is Pt100 with 1k pullup (non standard) // 110 is Pt100 with 1k pullup (non standard)
// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
// Use it for Testing or Development purposes. NEVER for production machine.
// #define DUMMY_THERMISTOR_998_VALUE 25
// #define DUMMY_THERMISTOR_999_VALUE 100
#define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_0 -1
#define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_1 -1
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_BED 0
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -139,6 +144,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -147,6 +153,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275 #define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -323,11 +330,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define DISABLE_MAX_ENDSTOPS //#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS //#define DISABLE_MIN_ENDSTOPS
// Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
#define DISABLE_MAX_ENDSTOPS
#endif
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0 #define X_ENABLE_ON 0
#define Y_ENABLE_ON 0 #define Y_ENABLE_ON 0
@ -347,6 +349,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -425,9 +428,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers // X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER -25 #define X_PROBE_OFFSET_FROM_EXTRUDER -25 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29 #define Y_PROBE_OFFSET_FROM_EXTRUDER -29 // -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35 // -below (always!)
#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance. #define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case // Be sure you have this distance over your Z_MAX_POS in case
@ -582,10 +585,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -619,6 +632,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -1,5 +1,5 @@
#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();
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

@ -284,6 +284,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

@ -14,10 +14,14 @@
// it is a Russian alphabet translation // it is a Russian alphabet translation
// except 0401 --> 0xa2 = ╗, 0451 --> 0xb5 // except 0401 --> 0xa2 = ╗, 0451 --> 0xb5
const PROGMEM uint8_t utf_recode[] = const PROGMEM uint8_t utf_recode[] =
{ 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f, { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,
0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, 0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f,0xa8,
0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f, 0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,
0xbe,0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7 0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1,
0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,
0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f,0xbe,
0x70,0x63,0xbf,0x79,0xe4,0x78,0xe5,0xc0,
0xc1,0xe6,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7
}; };
// When the display powers up, it is configured as follows: // When the display powers up, it is configured as follows:

@ -181,7 +181,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#endif #endif
enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; 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.
void FlushSerialRequestResend(); void FlushSerialRequestResend();
void ClearToSend(); void ClearToSend();
@ -201,8 +201,9 @@ void Stop();
bool IsStopped(); bool IsStopped();
void enquecommand(const char *cmd); //put an ASCII command at the end of the current buffer. bool enquecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full
void enquecommand_P(const char *cmd); //put an ASCII command at the end of the current buffer, read from flash void enquecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash
void prepare_arc_move(char isclockwise); void prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]); void clamp_to_software_endstops(float target[3]);

File diff suppressed because it is too large Load Diff

@ -50,10 +50,11 @@
#define BOARD_LEAPFROG 999 // Leapfrog #define BOARD_LEAPFROG 999 // Leapfrog
#define BOARD_WITBOX 41 // bq WITBOX #define BOARD_WITBOX 41 // bq WITBOX
#define BOARD_HEPHESTOS 42 // bq Prusa i3 Hephestos #define BOARD_HEPHESTOS 42 // bq Prusa i3 Hephestos
#define BOARD_BAM_DICE 401 // 2PrintBeta BAM&DICE with STK drivers
#define BOARD_BAM_DICE_DUE 402 // 2PrintBeta BAM&DICE Due with STK drivers
#define BOARD_99 99 // This is in pins.h but...? #define BOARD_99 99 // This is in pins.h but...?
#define MB(board) (MOTHERBOARD==BOARD_##board) #define MB(board) (MOTHERBOARD==BOARD_##board)
#define IS_RAMPS (MB(RAMPS_OLD) || MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF))
#endif //__BOARDS_H #endif //__BOARDS_H

@ -7,17 +7,13 @@
#ifdef SDSUPPORT #ifdef SDSUPPORT
CardReader::CardReader() {
CardReader::CardReader()
{
filesize = 0; filesize = 0;
sdpos = 0; sdpos = 0;
sdprinting = false; sdprinting = false;
cardOK = false; cardOK = false;
saving = false; saving = false;
logging = false; logging = false;
autostart_atmillis=0;
workDirDepth = 0; workDirDepth = 0;
file_subcall_ctr = 0; file_subcall_ctr = 0;
memset(workDirParents, 0, sizeof(workDirParents)); memset(workDirParents, 0, sizeof(workDirParents));
@ -26,49 +22,35 @@ CardReader::CardReader()
autostart_index = 0; autostart_index = 0;
//power to SD reader //power to SD reader
#if SDPOWER > -1 #if SDPOWER > -1
SET_OUTPUT(SDPOWER); OUT_WRITE(SDPOWER, HIGH);
WRITE(SDPOWER,HIGH);
#endif //SDPOWER #endif //SDPOWER
autostart_atmillis = millis() + 5000; autostart_atmillis = millis() + 5000;
} }
char *createFilename(char *buffer,const dir_t &p) //buffer>12characters char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters
{
char *pos = buffer; char *pos = buffer;
for (uint8_t i = 0; i < 11; i++) for (uint8_t i = 0; i < 11; i++) {
{
if (p.name[i] == ' ') continue; if (p.name[i] == ' ') continue;
if (i == 8) if (i == 8) *pos++ = '.';
{
*pos++='.';
}
*pos++ = p.name[i]; *pos++ = p.name[i];
} }
*pos++ = 0; *pos++ = 0;
return buffer; return buffer;
} }
void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/)
{
dir_t p; dir_t p;
uint8_t cnt = 0; uint8_t cnt = 0;
while (parent.readDir(p, longFilename) > 0) while (parent.readDir(p, longFilename) > 0) {
{ if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { // hence LS_SerialPrint
if( DIR_IS_SUBDIR(&p) && lsAction!=LS_Count && lsAction!=LS_GetFilename) // hence LS_SerialPrint
{
char path[FILENAME_LENGTH*2]; char path[FILENAME_LENGTH*2];
char lfilename[FILENAME_LENGTH]; char lfilename[FILENAME_LENGTH];
createFilename(lfilename, p); createFilename(lfilename, p);
path[0] = 0; path[0] = 0;
if(strlen(prepend)==0) //avoid leading / if already in prepend if (prepend[0] == 0) strcat(path, "/"); //avoid leading / if already in prepend
{
strcat(path,"/");
}
strcat(path, prepend); strcat(path, prepend);
strcat(path, lfilename); strcat(path, lfilename);
strcat(path, "/"); strcat(path, "/");
@ -76,10 +58,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
//Serial.print(path); //Serial.print(path);
SdFile dir; SdFile dir;
if(!dir.open(parent,lfilename, O_READ)) if (!dir.open(parent, lfilename, O_READ)) {
{ if (lsAction == LS_SerialPrint) {
if(lsAction==LS_SerialPrint)
{
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR); SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR);
SERIAL_ECHOLN(lfilename); SERIAL_ECHOLN(lfilename);
@ -87,96 +67,74 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
} }
lsDive(path, dir); lsDive(path, dir);
//close done automatically by destructor of SdFile //close done automatically by destructor of SdFile
} }
else else {
{
char pn0 = p.name[0]; char pn0 = p.name[0];
if (pn0 == DIR_NAME_FREE) break; if (pn0 == DIR_NAME_FREE) break;
if (pn0 == DIR_NAME_DELETED || pn0 == '.' || pn0 == '_') continue; if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue;
char lf0 = longFilename[0]; char lf0 = longFilename[0];
if (lf0 == '.' || lf0 == '_') continue; if (lf0 == '.') continue;
if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue; if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue;
filenameIsDir = DIR_IS_SUBDIR(&p); filenameIsDir = DIR_IS_SUBDIR(&p);
if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue;
if(!filenameIsDir)
{
if(p.name[8]!='G') continue;
if(p.name[9]=='~') continue;
}
//if (cnt++ != nr) continue; //if (cnt++ != nr) continue;
createFilename(filename, p); createFilename(filename, p);
if(lsAction==LS_SerialPrint) if (lsAction == LS_SerialPrint) {
{
SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(prepend);
SERIAL_PROTOCOLLN(filename); SERIAL_PROTOCOLLN(filename);
} }
else if(lsAction==LS_Count) else if (lsAction == LS_Count) {
{
nrFiles++; nrFiles++;
} }
else if(lsAction==LS_GetFilename) else if (lsAction == LS_GetFilename) {
{
if (match != NULL) { if (match != NULL) {
if (strcasecmp(match, filename) == 0) return; if (strcasecmp(match, filename) == 0) return;
} }
else if (cnt == nrFiles) return; else if (cnt == nrFiles) return;
cnt++; cnt++;
} }
} }
} }
} }
void CardReader::ls() void CardReader::ls() {
{
lsAction = LS_SerialPrint; lsAction = LS_SerialPrint;
if(lsAction==LS_Count)
nrFiles=0;
root.rewind(); root.rewind();
lsDive("", root); lsDive("", root);
} }
void CardReader::initsd() {
void CardReader::initsd()
{
cardOK = false; cardOK = false;
if(root.isOpen()) if (root.isOpen()) root.close();
root.close();
#ifdef SDSLOW #ifdef SDSLOW
if (!card.init(SPI_HALF_SPEED,SDSS) #define SPI_SPEED SPI_HALF_SPEED
#if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
&& !card.init(SPI_HALF_SPEED,LCD_SDSS)
#endif
)
#else #else
if (!card.init(SPI_FULL_SPEED,SDSS) #define SPI_SPEED SPI_FULL_SPEED
#if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
&& !card.init(SPI_FULL_SPEED,LCD_SDSS)
#endif #endif
)
if (!card.init(SPI_SPEED,SDSS)
#if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
&& !card.init(SPI_SPEED, LCD_SDSS)
#endif #endif
{ ) {
//if (!card.init(SPI_HALF_SPEED,SDSS)) //if (!card.init(SPI_HALF_SPEED,SDSS))
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL); SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL);
} }
else if (!volume.init(&card)) else if (!volume.init(&card)) {
{
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL); SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL);
} }
else if (!root.openRoot(&volume)) else if (!root.openRoot(&volume)) {
{
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL); SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL);
} }
else else {
{
cardOK = true; cardOK = true;
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_SD_CARD_OK); SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
@ -184,62 +142,46 @@ void CardReader::initsd()
workDir = root; workDir = root;
curDir = &root; curDir = &root;
/* /*
if(!workDir.openRoot(&volume)) if (!workDir.openRoot(&volume)) {
{
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
} }
*/ */
} }
void CardReader::setroot() void CardReader::setroot() {
{ /*if (!workDir.openRoot(&volume)) {
/*if(!workDir.openRoot(&volume))
{
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
}*/ }*/
workDir = root; workDir = root;
curDir = &workDir; curDir = &workDir;
} }
void CardReader::release()
{ void CardReader::release() {
sdprinting = false; sdprinting = false;
cardOK = false; cardOK = false;
} }
void CardReader::startFileprint() void CardReader::startFileprint() {
{ if (cardOK) {
if(cardOK)
{
sdprinting = true; sdprinting = true;
} }
} }
void CardReader::pauseSDPrint() void CardReader::pauseSDPrint() {
{ if (sdprinting) sdprinting = false;
if(sdprinting)
{
sdprinting = false;
} }
}
void CardReader::openLogFile(char* name) void CardReader::openLogFile(char* name) {
{
logging = true; logging = true;
openFile(name, false); openFile(name, false);
} }
void CardReader::getAbsFilename(char *t) void CardReader::getAbsFilename(char *t) {
{
uint8_t cnt = 0; uint8_t cnt = 0;
*t = '/'; t++; cnt++; *t = '/'; t++; cnt++;
for(uint8_t i=0;i<workDirDepth;i++) for (uint8_t i = 0; i < workDirDepth; i++) {
{
workDirParents[i].getFilename(t); //SDBaseFile.getfilename! workDirParents[i].getFilename(t); //SDBaseFile.getfilename!
while(*t!=0 && cnt< MAXPATHNAMELENGTH) while(*t && cnt < MAXPATHNAMELENGTH) { t++; cnt++; } //crawl counter forward.
{t++;cnt++;} //crawl counter forward.
} }
if (cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) if (cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH)
file.getFilename(t); file.getFilename(t);
@ -247,16 +189,11 @@ void CardReader::getAbsFilename(char *t)
t[0] = 0; t[0] = 0;
} }
void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/) void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) {
{ if (!cardOK) return;
if(!cardOK) if (file.isOpen()) { //replacing current file by new file, or subfile call
return; if (!replace_current) {
if(file.isOpen()) //replacing current file by new file, or subfile call if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
{
if(!replace_current)
{
if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1)
{
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
SERIAL_ERRORLN(SD_PROCEDURE_DEPTH); SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
@ -278,16 +215,14 @@ void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/)
filespos[file_subcall_ctr] = sdpos; filespos[file_subcall_ctr] = sdpos;
file_subcall_ctr++; file_subcall_ctr++;
} }
else else {
{
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPGM("Now doing file: "); SERIAL_ECHOPGM("Now doing file: ");
SERIAL_ECHOLN(name); SERIAL_ECHOLN(name);
} }
file.close(); file.close();
} }
else //opening fresh file else { //opening fresh file
{
file_subcall_ctr = 0; //resetting procedure depth in case user cancels print while in procedure file_subcall_ctr = 0; //resetting procedure depth in case user cancels print while in procedure
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPGM("Now fresh file: "); SERIAL_ECHOPGM("Now fresh file: ");
@ -295,59 +230,49 @@ void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/)
} }
sdprinting = false; sdprinting = false;
SdFile myDir; SdFile myDir;
curDir = &root; curDir = &root;
char *fname = name; char *fname = name;
char *dirname_start, *dirname_end; char *dirname_start, *dirname_end;
if(name[0]=='/') if (name[0] == '/') {
{ dirname_start = &name[1];
dirname_start=strchr(name,'/')+1; while(dirname_start > 0) {
while(dirname_start>0)
{
dirname_end = strchr(dirname_start, '/'); dirname_end = strchr(dirname_start, '/');
//SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name)); //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
//SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name)); //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name));
if(dirname_end>0 && dirname_end>dirname_start) if (dirname_end > 0 && dirname_end > dirname_start) {
{
char subdirname[FILENAME_LENGTH]; char subdirname[FILENAME_LENGTH];
strncpy(subdirname, dirname_start, dirname_end - dirname_start); strncpy(subdirname, dirname_start, dirname_end - dirname_start);
subdirname[dirname_end - dirname_start] = 0; subdirname[dirname_end - dirname_start] = 0;
SERIAL_ECHOLN(subdirname); SERIAL_ECHOLN(subdirname);
if(!myDir.open(curDir,subdirname,O_READ)) if (!myDir.open(curDir, subdirname, O_READ)) {
{
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
SERIAL_PROTOCOL(subdirname); SERIAL_PROTOCOL(subdirname);
SERIAL_PROTOCOLLNPGM("."); SERIAL_PROTOCOLLNPGM(".");
return; return;
} }
else else {
{
//SERIAL_ECHOLN("dive ok"); //SERIAL_ECHOLN("dive ok");
} }
curDir = &myDir; curDir = &myDir;
dirname_start = dirname_end + 1; dirname_start = dirname_end + 1;
} }
else // the reminder after all /fsa/fdsa/ is the filename else { // the remainder after all /fsa/fdsa/ is the filename
{
fname = dirname_start; fname = dirname_start;
//SERIAL_ECHOLN("remaider"); //SERIAL_ECHOLN("remainder");
//SERIAL_ECHOLN(fname); //SERIAL_ECHOLN(fname);
break; break;
} }
} }
} }
else //relative path else { //relative path
{
curDir = &workDir; curDir = &workDir;
} }
if(read)
{ if (read) {
if (file.open(curDir, fname, O_READ)) if (file.open(curDir, fname, O_READ)) {
{
filesize = file.fileSize(); filesize = file.fileSize();
SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED); SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED);
SERIAL_PROTOCOL(fname); SERIAL_PROTOCOL(fname);
@ -359,105 +284,87 @@ void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/)
getfilename(0, fname); getfilename(0, fname);
lcd_setstatus(longFilename[0] ? longFilename : fname); lcd_setstatus(longFilename[0] ? longFilename : fname);
} }
else else {
{
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
SERIAL_PROTOCOL(fname); SERIAL_PROTOCOL(fname);
SERIAL_PROTOCOLLNPGM("."); SERIAL_PROTOCOLLNPGM(".");
} }
} }
else else { //write
{ //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC))
{
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
SERIAL_PROTOCOL(fname); SERIAL_PROTOCOL(fname);
SERIAL_PROTOCOLLNPGM("."); SERIAL_PROTOCOLLNPGM(".");
} }
else else {
{
saving = true; saving = true;
SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE); SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE);
SERIAL_PROTOCOLLN(name); SERIAL_PROTOCOLLN(name);
lcd_setstatus(fname); lcd_setstatus(fname);
} }
} }
} }
void CardReader::removeFile(char* name) void CardReader::removeFile(char* name) {
{ if (!cardOK) return;
if(!cardOK)
return;
file.close(); file.close();
sdprinting = false; sdprinting = false;
SdFile myDir; SdFile myDir;
curDir = &root; curDir = &root;
char *fname = name; char *fname = name;
char *dirname_start, *dirname_end; char *dirname_start, *dirname_end;
if(name[0]=='/') if (name[0] == '/') {
{
dirname_start = strchr(name, '/') + 1; dirname_start = strchr(name, '/') + 1;
while(dirname_start>0) while (dirname_start > 0) {
{
dirname_end = strchr(dirname_start, '/'); dirname_end = strchr(dirname_start, '/');
//SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name)); //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
//SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name)); //SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name));
if(dirname_end>0 && dirname_end>dirname_start) if (dirname_end > 0 && dirname_end > dirname_start) {
{
char subdirname[FILENAME_LENGTH]; char subdirname[FILENAME_LENGTH];
strncpy(subdirname, dirname_start, dirname_end - dirname_start); strncpy(subdirname, dirname_start, dirname_end - dirname_start);
subdirname[dirname_end - dirname_start] = 0; subdirname[dirname_end - dirname_start] = 0;
SERIAL_ECHOLN(subdirname); SERIAL_ECHOLN(subdirname);
if(!myDir.open(curDir,subdirname,O_READ)) if (!myDir.open(curDir, subdirname, O_READ)) {
{
SERIAL_PROTOCOLPGM("open failed, File: "); SERIAL_PROTOCOLPGM("open failed, File: ");
SERIAL_PROTOCOL(subdirname); SERIAL_PROTOCOL(subdirname);
SERIAL_PROTOCOLLNPGM("."); SERIAL_PROTOCOLLNPGM(".");
return; return;
} }
else else {
{
//SERIAL_ECHOLN("dive ok"); //SERIAL_ECHOLN("dive ok");
} }
curDir = &myDir; curDir = &myDir;
dirname_start = dirname_end + 1; dirname_start = dirname_end + 1;
} }
else // the reminder after all /fsa/fdsa/ is the filename else { // the remainder after all /fsa/fdsa/ is the filename
{
fname = dirname_start; fname = dirname_start;
//SERIAL_ECHOLN("remaider"); //SERIAL_ECHOLN("remainder");
//SERIAL_ECHOLN(fname); //SERIAL_ECHOLN(fname);
break; break;
} }
} }
} }
else //relative path else { // relative path
{
curDir = &workDir; curDir = &workDir;
} }
if (file.remove(curDir, fname))
{ if (file.remove(curDir, fname)) {
SERIAL_PROTOCOLPGM("File deleted:"); SERIAL_PROTOCOLPGM("File deleted:");
SERIAL_PROTOCOLLN(fname); SERIAL_PROTOCOLLN(fname);
sdpos = 0; sdpos = 0;
} }
else else {
{
SERIAL_PROTOCOLPGM("Deletion failed, File: "); SERIAL_PROTOCOLPGM("Deletion failed, File: ");
SERIAL_PROTOCOL(fname); SERIAL_PROTOCOL(fname);
SERIAL_PROTOCOLLNPGM("."); SERIAL_PROTOCOLLNPGM(".");
} }
} }
void CardReader::getStatus() void CardReader::getStatus() {
{
if (cardOK) { if (cardOK) {
SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE);
SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL(sdpos);
@ -468,15 +375,14 @@ void CardReader::getStatus()
SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING); SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING);
} }
} }
void CardReader::write_command(char *buf)
{ void CardReader::write_command(char *buf) {
char* begin = buf; char* begin = buf;
char* npos = 0; char* npos = 0;
char* end = buf + strlen(buf) - 1; char* end = buf + strlen(buf) - 1;
file.writeError = false; file.writeError = false;
if((npos = strchr(buf, 'N')) != NULL) if ((npos = strchr(buf, 'N')) != NULL) {
{
begin = strchr(npos, ' ') + 1; begin = strchr(npos, ' ') + 1;
end = strchr(npos, '*') - 1; end = strchr(npos, '*') - 1;
} }
@ -484,55 +390,39 @@ void CardReader::write_command(char *buf)
end[2] = '\n'; end[2] = '\n';
end[3] = '\0'; end[3] = '\0';
file.write(begin); file.write(begin);
if (file.writeError) if (file.writeError) {
{
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE); SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE);
} }
} }
void CardReader::checkautostart(bool force) {
void CardReader::checkautostart(bool force) if (!force && (!autostart_stilltocheck || autostart_atmillis < millis()))
{
if(!force)
{
if(!autostart_stilltocheck)
return;
if(autostart_atmillis<millis())
return; return;
}
autostart_stilltocheck = false; autostart_stilltocheck = false;
if(!cardOK)
{ if (!cardOK) {
initsd(); initsd();
if(!cardOK) //fail if (!cardOK) return; // fail
return;
} }
char autoname[30]; char autoname[30];
sprintf_P(autoname, PSTR("auto%i.g"), autostart_index); sprintf_P(autoname, PSTR("auto%i.g"), autostart_index);
for(int8_t i=0;i<(int8_t)strlen(autoname);i++) for (int8_t i = 0; i < (int8_t)strlen(autoname); i++) autoname[i] = tolower(autoname[i]);
autoname[i]=tolower(autoname[i]);
dir_t p; dir_t p;
root.rewind(); root.rewind();
bool found = false; bool found = false;
while (root.readDir(p, NULL) > 0) while (root.readDir(p, NULL) > 0) {
{ for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]);
for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
p.name[i]=tolower(p.name[i]);
//Serial.print((char*)p.name);
//Serial.print(" ");
//Serial.println(autoname);
if(p.name[9]!='~') //skip safety copies
if(strncmp((char*)p.name,autoname,5)==0)
{
char cmd[30]; char cmd[30];
sprintf_P(cmd, PSTR("M23 %s"), autoname); sprintf_P(cmd, PSTR("M23 %s"), autoname);
enquecommand(cmd); enquecommand(cmd);
enquecommand_P(PSTR("M24")); enquecommands_P(PSTR("M24"));
found = true; found = true;
} }
} }
@ -542,35 +432,29 @@ void CardReader::checkautostart(bool force)
autostart_index++; autostart_index++;
} }
void CardReader::closefile(bool store_location) void CardReader::closefile(bool store_location) {
{
file.sync(); file.sync();
file.close(); file.close();
saving = false; saving = logging = false;
logging = false;
if(store_location) if (store_location) {
{
//future: store printer state, filename and position for continuing a stopped print //future: store printer state, filename and position for continuing a stopped print
// so one can unplug the printer and continue printing the next day. // so one can unplug the printer and continue printing the next day.
} }
} }
void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) /**
{ * Get the name of a file in the current directory by index
*/
void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) {
curDir = &workDir; curDir = &workDir;
lsAction = LS_GetFilename; lsAction = LS_GetFilename;
nrFiles = nr; nrFiles = nr;
curDir->rewind(); curDir->rewind();
lsDive("", *curDir, match); lsDive("", *curDir, match);
} }
uint16_t CardReader::getnrfilenames() uint16_t CardReader::getnrfilenames() {
{
curDir = &workDir; curDir = &workDir;
lsAction = LS_Count; lsAction = LS_Count;
nrFiles = 0; nrFiles = 0;
@ -580,66 +464,55 @@ uint16_t CardReader::getnrfilenames()
return nrFiles; return nrFiles;
} }
void CardReader::chdir(const char * relpath) void CardReader::chdir(const char * relpath) {
{
SdFile newfile; SdFile newfile;
SdFile *parent = &root; SdFile *parent = &root;
if(workDir.isOpen()) if (workDir.isOpen()) parent = &workDir;
parent=&workDir;
if(!newfile.open(*parent,relpath, O_READ)) if (!newfile.open(*parent, relpath, O_READ)) {
{
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR); SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
SERIAL_ECHOLN(relpath); SERIAL_ECHOLN(relpath);
} }
else else {
{
if (workDirDepth < MAX_DIR_DEPTH) { if (workDirDepth < MAX_DIR_DEPTH) {
for (int d = ++workDirDepth; d--;) ++workDirDepth;
workDirParents[d+1] = workDirParents[d]; for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d];
workDirParents[0] = *parent; workDirParents[0] = *parent;
} }
workDir = newfile; workDir = newfile;
} }
} }
void CardReader::updir() void CardReader::updir() {
{ if (workDirDepth > 0) {
if(workDirDepth > 0)
{
--workDirDepth; --workDirDepth;
workDir = workDirParents[0]; workDir = workDirParents[0];
int d;
for (int d = 0; d < workDirDepth; d++) for (int d = 0; d < workDirDepth; d++)
workDirParents[d] = workDirParents[d+1]; workDirParents[d] = workDirParents[d+1];
} }
} }
void CardReader::printingHasFinished() {
void CardReader::printingHasFinished()
{
st_synchronize(); st_synchronize();
if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure.
{
file.close(); file.close();
file_subcall_ctr--; file_subcall_ctr--;
openFile(filenames[file_subcall_ctr], true, true); openFile(filenames[file_subcall_ctr], true, true);
setIndex(filespos[file_subcall_ctr]); setIndex(filespos[file_subcall_ctr]);
startFileprint(); startFileprint();
} }
else else {
{
quickStop(); quickStop();
file.close(); file.close();
sdprinting = false; sdprinting = false;
if(SD_FINISHED_STEPPERRELEASE) if (SD_FINISHED_STEPPERRELEASE) {
{
//finishAndDisableSteppers(); //finishAndDisableSteppers();
enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND)); enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
} }
autotempShutdown(); autotempShutdown();
} }
} }
#endif //SDSUPPORT #endif //SDSUPPORT

@ -3,12 +3,12 @@
#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:
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,20 +40,15 @@ 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];
@ -68,18 +62,19 @@ private:
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)
@ -87,9 +82,9 @@ extern CardReader card;
#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
@ -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

@ -1,6 +1,7 @@
#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"
@ -18,8 +19,7 @@ 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,8 +27,7 @@ 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
@ -47,8 +46,7 @@ void digipot_i2c_set_current( int channel, float current )
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
@ -56,4 +54,5 @@ void digipot_i2c_init()
digipot_i2c_set_current(i, digipot_motor_current[i]); digipot_i2c_set_current(i, digipot_motor_current[i]);
} }
} }
#endif
#endif //DIGIPOT_I2C

@ -27,10 +27,6 @@
#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 encrot1 2
#define encrot2 3
#define encrot3 1
#define LCD_CLICKED (buttons&EN_C) #define LCD_CLICKED (buttons&EN_C)
#endif #endif
@ -92,6 +88,9 @@ U8GLIB_ST7920_128X64_RRD u8g(0);
#elif defined(MAKRPANEL) #elif defined(MAKRPANEL)
// The MaKrPanel display, ST7565 controller as well // The MaKrPanel display, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#elif defined(VIKI2) || defined(miniVIKI)
// Mini Viki and Viki 2.0 LCD, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#else #else
// for regular DOGM128 display with HW-SPI // for regular DOGM128 display with HW-SPI
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
@ -312,7 +311,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) { static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
char c; char c;
uint8_t n = LCD_WIDTH - 2 - (pgm ? strlen_P(data) : (strlen(data))); uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
lcd_implementation_mark_as_selected(row, pre_char); lcd_implementation_mark_as_selected(row, pre_char);
@ -374,18 +373,18 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
uint8_t char_width = DOG_CHAR_WIDTH; uint8_t char_width = DOG_CHAR_WIDTH;
#ifdef USE_BIG_EDIT_FONT #ifdef USE_BIG_EDIT_FONT
if (strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) { if (lcd_strlen_P(pstr) <= LCD_WIDTH_EDIT - 1) {
u8g.setFont(FONT_MENU_EDIT); u8g.setFont(FONT_MENU_EDIT);
lcd_width = LCD_WIDTH_EDIT + 1; lcd_width = LCD_WIDTH_EDIT + 1;
char_width = DOG_CHAR_WIDTH_EDIT; char_width = DOG_CHAR_WIDTH_EDIT;
if (strlen_P(pstr) >= LCD_WIDTH_EDIT - strlen(value)) rows = 2; if (lcd_strlen_P(pstr) >= LCD_WIDTH_EDIT - lcd_strlen(value)) rows = 2;
} }
else { else {
u8g.setFont(FONT_MENU); u8g.setFont(FONT_MENU);
} }
#endif #endif
if (strlen_P(pstr) > LCD_WIDTH - 2 - strlen(value)) rows = 2; if (lcd_strlen_P(pstr) > LCD_WIDTH - 2 - lcd_strlen(value)) rows = 2;
const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2; const float kHalfChar = DOG_CHAR_HEIGHT_EDIT / 2;
float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3 float rowHeight = u8g.getHeight() / (rows + 1); // 1/(rows+1) = 1/2 or 1/3
@ -393,7 +392,7 @@ void lcd_implementation_drawedit(const char* pstr, char* value) {
u8g.setPrintPos(0, rowHeight + kHalfChar); u8g.setPrintPos(0, rowHeight + kHalfChar);
lcd_printPGM(pstr); lcd_printPGM(pstr);
u8g.print(':'); u8g.print(':');
u8g.setPrintPos((lcd_width-1-strlen(value)) * char_width, rows * rowHeight + kHalfChar); u8g.setPrintPos((lcd_width-1-lcd_strlen(value)) * char_width, rows * rowHeight + kHalfChar);
u8g.print(value); u8g.print(value);
} }

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -122,6 +122,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 1 #define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_BED 0
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -139,6 +140,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -147,6 +149,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 260 #define HEATER_0_MAXTEMP 260
#define HEATER_1_MAXTEMP 260 #define HEATER_1_MAXTEMP 260
#define HEATER_2_MAXTEMP 260 #define HEATER_2_MAXTEMP 260
#define HEATER_3_MAXTEMP 260
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -353,6 +356,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -583,10 +587,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
#define REPRAP_DISCOUNT_SMART_CONTROLLER #define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -620,6 +634,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -284,6 +284,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -124,6 +124,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 5 #define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 5 #define TEMP_SENSOR_BED 5
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -141,6 +142,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -149,6 +151,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275 #define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -361,6 +364,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -593,10 +597,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -630,6 +644,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -284,6 +284,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -142,6 +142,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 1 #define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 1 #define TEMP_SENSOR_BED 1
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -159,6 +160,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -167,6 +169,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275 #define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -382,6 +385,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstop s when homing; 1=MAX, -1=MIN // Sets direction of endstop s when homing; 1=MAX, -1=MIN
@ -586,10 +590,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -623,6 +637,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -78,6 +78,7 @@
#define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
@ -286,6 +287,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@ -478,6 +484,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define THERMISTORHEATER_2 TEMP_SENSOR_2 #define THERMISTORHEATER_2 TEMP_SENSOR_2
#define HEATER_2_USES_THERMISTOR #define HEATER_2_USES_THERMISTOR
#endif #endif
#if TEMP_SENSOR_3 > 0
#define THERMISTORHEATER_3 TEMP_SENSOR_3
#define HEATER_3_USES_THERMISTOR
#endif
#if TEMP_SENSOR_BED > 0 #if TEMP_SENSOR_BED > 0
#define THERMISTORBED TEMP_SENSOR_BED #define THERMISTORBED TEMP_SENSOR_BED
#define BED_USES_THERMISTOR #define BED_USES_THERMISTOR
@ -491,6 +501,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#if TEMP_SENSOR_2 == -1 #if TEMP_SENSOR_2 == -1
#define HEATER_2_USES_AD595 #define HEATER_2_USES_AD595
#endif #endif
#if TEMP_SENSOR_3 == -1
#define HEATER_3_USES_AD595
#endif
#if TEMP_SENSOR_BED == -1 #if TEMP_SENSOR_BED == -1
#define BED_USES_AD595 #define BED_USES_AD595
#endif #endif
@ -509,6 +522,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#undef HEATER_2_MINTEMP #undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP #undef HEATER_2_MAXTEMP
#endif #endif
#if TEMP_SENSOR_3 == 0
#undef HEATER_3_MINTEMP
#undef HEATER_3_MAXTEMP
#endif
#if TEMP_SENSOR_BED == 0 #if TEMP_SENSOR_BED == 0
#undef BED_MINTEMP #undef BED_MINTEMP
#undef BED_MAXTEMP #undef BED_MAXTEMP

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -125,6 +125,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 1 #define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_BED 0
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -142,6 +143,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -150,6 +152,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 260 #define HEATER_0_MAXTEMP 260
#define HEATER_1_MAXTEMP 260 #define HEATER_1_MAXTEMP 260
#define HEATER_2_MAXTEMP 260 #define HEATER_2_MAXTEMP 260
#define HEATER_3_MAXTEMP 260
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -357,6 +360,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -587,10 +591,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
#define REPRAP_DISCOUNT_SMART_CONTROLLER #define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -624,6 +638,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -284,6 +284,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -147,6 +147,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_0 -1
#define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_1 -1
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_BED 0
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -164,6 +165,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -172,6 +174,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275 #define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -370,6 +373,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -491,10 +495,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -535,6 +549,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -78,6 +78,7 @@
#define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
@ -278,6 +279,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@ -472,6 +478,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define THERMISTORHEATER_2 TEMP_SENSOR_2 #define THERMISTORHEATER_2 TEMP_SENSOR_2
#define HEATER_2_USES_THERMISTOR #define HEATER_2_USES_THERMISTOR
#endif #endif
#if TEMP_SENSOR_3 > 0
#define THERMISTORHEATER_3 TEMP_SENSOR_3
#define HEATER_3_USES_THERMISTOR
#endif
#if TEMP_SENSOR_BED > 0 #if TEMP_SENSOR_BED > 0
#define THERMISTORBED TEMP_SENSOR_BED #define THERMISTORBED TEMP_SENSOR_BED
#define BED_USES_THERMISTOR #define BED_USES_THERMISTOR
@ -485,6 +495,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#if TEMP_SENSOR_2 == -1 #if TEMP_SENSOR_2 == -1
#define HEATER_2_USES_AD595 #define HEATER_2_USES_AD595
#endif #endif
#if TEMP_SENSOR_3 == -1
#define HEATER_3_USES_AD595
#endif
#if TEMP_SENSOR_BED == -1 #if TEMP_SENSOR_BED == -1
#define BED_USES_AD595 #define BED_USES_AD595
#endif #endif
@ -503,6 +516,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#undef HEATER_2_MINTEMP #undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP #undef HEATER_2_MAXTEMP
#endif #endif
#if TEMP_SENSOR_3 == 0
#undef HEATER_3_MINTEMP
#undef HEATER_3_MAXTEMP
#endif
#if TEMP_SENSOR_BED == 0 #if TEMP_SENSOR_BED == 0
#undef BED_MINTEMP #undef BED_MINTEMP
#undef BED_MAXTEMP #undef BED_MAXTEMP

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -127,6 +127,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 1 #define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 12 #define TEMP_SENSOR_BED 12
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -144,6 +145,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -152,6 +154,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275 #define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
@ -355,6 +358,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -561,10 +565,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -598,6 +612,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -78,6 +78,7 @@
#define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
@ -282,6 +283,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@ -469,6 +475,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define THERMISTORHEATER_2 TEMP_SENSOR_2 #define THERMISTORHEATER_2 TEMP_SENSOR_2
#define HEATER_2_USES_THERMISTOR #define HEATER_2_USES_THERMISTOR
#endif #endif
#if TEMP_SENSOR_3 > 0
#define THERMISTORHEATER_3 TEMP_SENSOR_3
#define HEATER_3_USES_THERMISTOR
#endif
#if TEMP_SENSOR_BED > 0 #if TEMP_SENSOR_BED > 0
#define THERMISTORBED TEMP_SENSOR_BED #define THERMISTORBED TEMP_SENSOR_BED
#define BED_USES_THERMISTOR #define BED_USES_THERMISTOR
@ -482,6 +492,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#if TEMP_SENSOR_2 == -1 #if TEMP_SENSOR_2 == -1
#define HEATER_2_USES_AD595 #define HEATER_2_USES_AD595
#endif #endif
#if TEMP_SENSOR_3 == -1
#define HEATER_3_USES_AD595
#endif
#if TEMP_SENSOR_BED == -1 #if TEMP_SENSOR_BED == -1
#define BED_USES_AD595 #define BED_USES_AD595
#endif #endif
@ -500,6 +513,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#undef HEATER_2_MINTEMP #undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP #undef HEATER_2_MAXTEMP
#endif #endif
#if TEMP_SENSOR_3 == 0
#undef HEATER_3_MINTEMP
#undef HEATER_3_MAXTEMP
#endif
#if TEMP_SENSOR_BED == 0 #if TEMP_SENSOR_BED == 0
#undef BED_MINTEMP #undef BED_MINTEMP
#undef BED_MAXTEMP #undef BED_MAXTEMP

@ -1,4 +1,4 @@
#ifndef CONFIGURATION_H #ifndef CONFIGURATION_H
#define CONFIGURATION_H #define CONFIGURATION_H
#include "boards.h" #include "boards.h"
@ -126,6 +126,7 @@ Here are some standard links for getting your machine calibrated:
#define TEMP_SENSOR_0 5 #define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0 #define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0 #define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 5 #define TEMP_SENSOR_BED 5
// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted. // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
@ -143,6 +144,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MINTEMP 5 #define HEATER_0_MINTEMP 5
#define HEATER_1_MINTEMP 5 #define HEATER_1_MINTEMP 5
#define HEATER_2_MINTEMP 5 #define HEATER_2_MINTEMP 5
#define HEATER_3_MINTEMP 5
#define BED_MINTEMP 5 #define BED_MINTEMP 5
// When temperature exceeds max temp, your heater will be switched off. // When temperature exceeds max temp, your heater will be switched off.
@ -151,6 +153,7 @@ Here are some standard links for getting your machine calibrated:
#define HEATER_0_MAXTEMP 275 #define HEATER_0_MAXTEMP 275
#define HEATER_1_MAXTEMP 275 #define HEATER_1_MAXTEMP 275
#define HEATER_2_MAXTEMP 275 #define HEATER_2_MAXTEMP 275
#define HEATER_3_MAXTEMP 275
#define BED_MAXTEMP 150 #define BED_MAXTEMP 150
#define CONFIG_STEPPERS_TOSHIBA 1 #define CONFIG_STEPPERS_TOSHIBA 1
@ -358,6 +361,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E3_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS: // ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN // Sets direction of endstops when homing; 1=MAX, -1=MIN
@ -574,10 +578,20 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne
//#define PANEL_ONE
// The MaKr3d Makr-Panel with graphic controller and SD support // The MaKr3d Makr-Panel with graphic controller and SD support
// http://reprap.org/wiki/MaKr3d_MaKrPanel // http://reprap.org/wiki/MaKr3d_MaKrPanel
//#define MAKRPANEL //#define MAKRPANEL
// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
// http://panucatt.com
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define VIKI2
//#define miniVIKI
// The RepRapDiscount Smart Controller (white PCB) // The RepRapDiscount Smart Controller (white PCB)
// http://reprap.org/wiki/RepRapDiscount_Smart_Controller // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
//#define REPRAP_DISCOUNT_SMART_CONTROLLER //#define REPRAP_DISCOUNT_SMART_CONTROLLER
@ -611,6 +625,26 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif #endif
#if defined(miniVIKI) || defined(VIKI2)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
#ifdef miniVIKI
#define DEFAULT_LCD_CONTRAST 95
#else
#define DEFAULT_LCD_CONTRAST 40
#endif
#define ENCODER_PULSES_PER_STEP 4
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif
#if defined (PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
#endif
#if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920

@ -78,6 +78,7 @@
#define EXTRUDER_0_AUTO_FAN_PIN -1 #define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1 #define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1 #define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed #define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
@ -283,6 +284,11 @@
//=============================Additional Features=========================== //=============================Additional Features===========================
//=========================================================================== //===========================================================================
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceed this value, multiple the steps moved by ten to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceed this value, multiple the steps moved by 100 to really quickly advance the value
//#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value
//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ //#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
@ -472,6 +478,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define THERMISTORHEATER_2 TEMP_SENSOR_2 #define THERMISTORHEATER_2 TEMP_SENSOR_2
#define HEATER_2_USES_THERMISTOR #define HEATER_2_USES_THERMISTOR
#endif #endif
#if TEMP_SENSOR_3 > 0
#define THERMISTORHEATER_3 TEMP_SENSOR_3
#define HEATER_3_USES_THERMISTOR
#endif
#if TEMP_SENSOR_BED > 0 #if TEMP_SENSOR_BED > 0
#define THERMISTORBED TEMP_SENSOR_BED #define THERMISTORBED TEMP_SENSOR_BED
#define BED_USES_THERMISTOR #define BED_USES_THERMISTOR
@ -485,6 +495,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#if TEMP_SENSOR_2 == -1 #if TEMP_SENSOR_2 == -1
#define HEATER_2_USES_AD595 #define HEATER_2_USES_AD595
#endif #endif
#if TEMP_SENSOR_3 == -1
#define HEATER_3_USES_AD595
#endif
#if TEMP_SENSOR_BED == -1 #if TEMP_SENSOR_BED == -1
#define BED_USES_AD595 #define BED_USES_AD595
#endif #endif
@ -503,6 +516,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#undef HEATER_2_MINTEMP #undef HEATER_2_MINTEMP
#undef HEATER_2_MAXTEMP #undef HEATER_2_MAXTEMP
#endif #endif
#if TEMP_SENSOR_3 == 0
#undef HEATER_3_MINTEMP
#undef HEATER_3_MAXTEMP
#endif
#if TEMP_SENSOR_BED == 0 #if TEMP_SENSOR_BED == 0
#undef BED_MINTEMP #undef BED_MINTEMP
#undef BED_MAXTEMP #undef BED_MAXTEMP

@ -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

@ -121,6 +121,7 @@
#define MSG_UNKNOWN_COMMAND "Unknown command: \"" #define MSG_UNKNOWN_COMMAND "Unknown command: \""
#define MSG_ACTIVE_EXTRUDER "Active Extruder: " #define MSG_ACTIVE_EXTRUDER "Active Extruder: "
#define MSG_INVALID_EXTRUDER "Invalid extruder" #define MSG_INVALID_EXTRUDER "Invalid extruder"
#define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_X_MIN "x_min: " #define MSG_X_MIN "x_min: "
#define MSG_X_MAX "x_max: " #define MSG_X_MAX "x_max: "
#define MSG_Y_MIN "y_min: " #define MSG_Y_MIN "y_min: "
@ -159,6 +160,43 @@
#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_START MSG_PID_AUTOTUNE " start"
#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE " failed!"
#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number"
#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high"
#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout"
#define MSG_BIAS " bias: "
#define MSG_D " d: "
#define MSG_MIN " min: "
#define MSG_MAX " max: "
#define MSG_KU " Ku: "
#define MSG_TU " Tu: "
#define MSG_CLASSIC_PID " Classic PID "
#define MSG_KP " Kp: "
#define MSG_KI " Ki: "
#define MSG_KD " Kd: "
#define MSG_OK_B "ok B:"
#define MSG_OK_T "ok T:"
#define MSG_AT " @:"
#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"
#define MSG_PID_DEBUG " PID_DEBUG "
#define MSG_PID_DEBUG_INPUT ": Input "
#define MSG_PID_DEBUG_OUTPUT " Output "
#define MSG_PID_DEBUG_PTERM " pTerm "
#define MSG_PID_DEBUG_ITERM " iTerm "
#define MSG_PID_DEBUG_DTERM " dTerm "
#define MSG_HEATING_FAILED "Heating failed"
#define MSG_EXTRUDER_SWITCHED_OFF "Extruder switched off. Temperature difference between temp sensors is too high !"
#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
#define MSG_THERMAL_RUNAWAY_STOP "Thermal Runaway, system stopped! Heater_ID: "
#define MSG_SWITCHED_OFF_MAX " switched off. MAXTEMP triggered !!"
#define MSG_MINTEMP_EXTRUDER_OFF ": Extruder switched off. MINTEMP triggered !"
#define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX
#define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX
// LCD Menu Messages // LCD Menu Messages
// Add your own character. Reference: https://github.com/MarlinFirmware/Marlin/pull/1434 photos // Add your own character. Reference: https://github.com/MarlinFirmware/Marlin/pull/1434 photos
@ -223,5 +261,6 @@
*/ */
#include LANGUAGE_INCLUDE #include LANGUAGE_INCLUDE
#include "language_en.h"
#endif //__LANGUAGE_H #endif //__LANGUAGE_H

@ -8,124 +8,416 @@
#ifndef LANGUAGE_EN_H #ifndef LANGUAGE_EN_H
#define LANGUAGE_EN_H #define LANGUAGE_EN_H
#ifndef WELCOME_MSG
#define WELCOME_MSG MACHINE_NAME " ready." #define WELCOME_MSG MACHINE_NAME " ready."
#endif
#ifndef MSG_SD_INSERTED
#define MSG_SD_INSERTED "Card inserted" #define MSG_SD_INSERTED "Card inserted"
#endif
#ifndef MSG_SD_REMOVED
#define MSG_SD_REMOVED "Card removed" #define MSG_SD_REMOVED "Card removed"
#endif
#ifndef MSG_MAIN
#define MSG_MAIN "Main" #define MSG_MAIN "Main"
#endif
#ifndef MSG_AUTOSTART
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#endif
#ifndef MSG_DISABLE_STEPPERS
#define MSG_DISABLE_STEPPERS "Disable steppers" #define MSG_DISABLE_STEPPERS "Disable steppers"
#endif
#ifndef MSG_AUTO_HOME
#define MSG_AUTO_HOME "Auto home" #define MSG_AUTO_HOME "Auto home"
#endif
#ifndef MSG_SET_HOME_OFFSETS
#define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_SET_HOME_OFFSETS "Set home offsets"
#endif
#ifndef MSG_SET_ORIGIN
#define MSG_SET_ORIGIN "Set origin" #define MSG_SET_ORIGIN "Set origin"
#endif
#ifndef MSG_PREHEAT_PLA
#define MSG_PREHEAT_PLA "Preheat PLA" #define MSG_PREHEAT_PLA "Preheat PLA"
#endif
#ifndef MSG_PREHEAT_PLA_N
#define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " " #define MSG_PREHEAT_PLA_N MSG_PREHEAT_PLA " "
#endif
#ifndef MSG_PREHEAT_PLA_ALL
#define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " All" #define MSG_PREHEAT_PLA_ALL MSG_PREHEAT_PLA " All"
#endif
#ifndef MSG_PREHEAT_PLA_BEDONLY
#define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Bed" #define MSG_PREHEAT_PLA_BEDONLY MSG_PREHEAT_PLA " Bed"
#endif
#ifndef MSG_PREHEAT_PLA_SETTINGS
#define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf" #define MSG_PREHEAT_PLA_SETTINGS MSG_PREHEAT_PLA " conf"
#endif
#ifndef MSG_PREHEAT_ABS
#define MSG_PREHEAT_ABS "Preheat ABS" #define MSG_PREHEAT_ABS "Preheat ABS"
#endif
#ifndef MSG_PREHEAT_ABS_N
#define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " " #define MSG_PREHEAT_ABS_N MSG_PREHEAT_ABS " "
#endif
#ifndef MSG_PREHEAT_ABS_ALL
#define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " All" #define MSG_PREHEAT_ABS_ALL MSG_PREHEAT_ABS " All"
#endif
#ifndef MSG_PREHEAT_ABS_BEDONLY
#define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed" #define MSG_PREHEAT_ABS_BEDONLY MSG_PREHEAT_ABS " Bed"
#endif
#ifndef MSG_PREHEAT_ABS_SETTINGS
#define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf" #define MSG_PREHEAT_ABS_SETTINGS MSG_PREHEAT_ABS " conf"
#endif
#ifndef MSG_H1
#define MSG_H1 "1"
#endif
#ifndef MSG_H2
#define MSG_H2 "2"
#endif
#ifndef MSG_H3
#define MSG_H3 "3"
#endif
#ifndef MSG_H4
#define MSG_H4 "4"
#endif
#ifndef MSG_COOLDOWN
#define MSG_COOLDOWN "Cooldown" #define MSG_COOLDOWN "Cooldown"
#endif
#ifndef MSG_SWITCH_PS_ON
#define MSG_SWITCH_PS_ON "Switch power on" #define MSG_SWITCH_PS_ON "Switch power on"
#endif
#ifndef MSG_SWITCH_PS_OFF
#define MSG_SWITCH_PS_OFF "Switch power off" #define MSG_SWITCH_PS_OFF "Switch power off"
#endif
#ifndef MSG_EXTRUDE
#define MSG_EXTRUDE "Extrude" #define MSG_EXTRUDE "Extrude"
#endif
#ifndef MSG_RETRACT
#define MSG_RETRACT "Retract" #define MSG_RETRACT "Retract"
#endif
#ifndef MSG_MOVE_AXIS
#define MSG_MOVE_AXIS "Move axis" #define MSG_MOVE_AXIS "Move axis"
#endif
#ifndef MSG_MOVE_X
#define MSG_MOVE_X "Move X" #define MSG_MOVE_X "Move X"
#endif
#ifndef MSG_MOVE_Y
#define MSG_MOVE_Y "Move Y" #define MSG_MOVE_Y "Move Y"
#endif
#ifndef MSG_MOVE_Z
#define MSG_MOVE_Z "Move Z" #define MSG_MOVE_Z "Move Z"
#endif
#ifndef MSG_MOVE_E
#define MSG_MOVE_E "Extruder" #define MSG_MOVE_E "Extruder"
#endif
#ifndef MSG_MOVE_01MM
#define MSG_MOVE_01MM "Move 0.1mm" #define MSG_MOVE_01MM "Move 0.1mm"
#endif
#ifndef MSG_MOVE_1MM
#define MSG_MOVE_1MM "Move 1mm" #define MSG_MOVE_1MM "Move 1mm"
#endif
#ifndef MSG_MOVE_10MM
#define MSG_MOVE_10MM "Move 10mm" #define MSG_MOVE_10MM "Move 10mm"
#endif
#ifndef MSG_SPEED
#define MSG_SPEED "Speed" #define MSG_SPEED "Speed"
#endif
#ifndef MSG_NOZZLE
#define MSG_NOZZLE "Nozzle" #define MSG_NOZZLE "Nozzle"
#endif
#ifndef MSG_N2
#define MSG_N2 " 2"
#endif
#ifndef MSG_N3
#define MSG_N3 " 3"
#endif
#ifndef MSG_N4
#define MSG_N4 " 4"
#endif
#ifndef MSG_BED
#define MSG_BED "Bed" #define MSG_BED "Bed"
#endif
#ifndef MSG_FAN_SPEED
#define MSG_FAN_SPEED "Fan speed" #define MSG_FAN_SPEED "Fan speed"
#endif
#ifndef MSG_FLOW
#define MSG_FLOW "Flow" #define MSG_FLOW "Flow"
#endif
#ifndef MSG_F0
#define MSG_F0 " 0"
#endif
#ifndef MSG_F1
#define MSG_F1 " 1"
#endif
#ifndef MSG_F2
#define MSG_F2 " 2"
#endif
#ifndef MSG_F3
#define MSG_F3 " 3"
#endif
#ifndef MSG_CONTROL
#define MSG_CONTROL "Control" #define MSG_CONTROL "Control"
#endif
#ifndef MSG_MIN
#define MSG_MIN " " STR_THERMOMETER " Min" #define MSG_MIN " " STR_THERMOMETER " Min"
#endif
#ifndef MSG_MAX
#define MSG_MAX " " STR_THERMOMETER " Max" #define MSG_MAX " " STR_THERMOMETER " Max"
#endif
#ifndef MSG_FACTOR
#define MSG_FACTOR " " STR_THERMOMETER " Fact" #define MSG_FACTOR " " STR_THERMOMETER " Fact"
#endif
#ifndef MSG_AUTOTEMP
#define MSG_AUTOTEMP "Autotemp" #define MSG_AUTOTEMP "Autotemp"
#endif
#ifndef MSG_ON
#define MSG_ON "On " #define MSG_ON "On "
#endif
#ifndef MSG_OFF
#define MSG_OFF "Off" #define MSG_OFF "Off"
#endif
#ifndef MSG_PID_P
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#endif
#ifndef MSG_PID_I
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#endif
#ifndef MSG_PID_D
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#endif
#ifndef MSG_PID_C
#define MSG_PID_C "PID-C" #define MSG_PID_C "PID-C"
#endif
#ifndef MSG_E2
#define MSG_E2 " E2"
#endif
#ifndef MSG_E3
#define MSG_E3 " E3"
#endif
#ifndef MSG_E4
#define MSG_E4 " E4"
#endif
#ifndef MSG_ACC
#define MSG_ACC "Accel" #define MSG_ACC "Accel"
#endif
#ifndef MSG_VXY_JERK
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#endif
#ifndef MSG_VZ_JERK
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
#endif
#ifndef MSG_VE_JERK
#define MSG_VE_JERK "Ve-jerk" #define MSG_VE_JERK "Ve-jerk"
#endif
#ifndef MSG_VMAX
#define MSG_VMAX "Vmax " #define MSG_VMAX "Vmax "
#endif
#ifndef MSG_X
#define MSG_X "x" #define MSG_X "x"
#endif
#ifndef MSG_Y
#define MSG_Y "y" #define MSG_Y "y"
#endif
#ifndef MSG_Z
#define MSG_Z "z" #define MSG_Z "z"
#endif
#ifndef MSG_E
#define MSG_E "e" #define MSG_E "e"
#endif
#ifndef MSG_VMIN
#define MSG_VMIN "Vmin" #define MSG_VMIN "Vmin"
#endif
#ifndef MSG_VTRAV_MIN
#define MSG_VTRAV_MIN "VTrav min" #define MSG_VTRAV_MIN "VTrav min"
#endif
#ifndef MSG_AMAX
#define MSG_AMAX "Amax " #define MSG_AMAX "Amax "
#endif
#ifndef MSG_A_RETRACT
#define MSG_A_RETRACT "A-retract" #define MSG_A_RETRACT "A-retract"
#endif
#ifndef MSG_XSTEPS
#define MSG_XSTEPS "Xsteps/mm" #define MSG_XSTEPS "Xsteps/mm"
#endif
#ifndef MSG_YSTEPS
#define MSG_YSTEPS "Ysteps/mm" #define MSG_YSTEPS "Ysteps/mm"
#endif
#ifndef MSG_ZSTEPS
#define MSG_ZSTEPS "Zsteps/mm" #define MSG_ZSTEPS "Zsteps/mm"
#endif
#ifndef MSG_ESTEPS
#define MSG_ESTEPS "Esteps/mm" #define MSG_ESTEPS "Esteps/mm"
#endif
#ifndef MSG_TEMPERATURE
#define MSG_TEMPERATURE "Temperature" #define MSG_TEMPERATURE "Temperature"
#endif
#ifndef MSG_MOTION
#define MSG_MOTION "Motion" #define MSG_MOTION "Motion"
#endif
#ifndef MSG_VOLUMETRIC
#define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC "Filament"
#endif
#ifndef MSG_VOLUMETRIC_ENABLED
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3 #define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3
#endif
#ifndef MSG_FILAMENT_SIZE_EXTRUDER_0
#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1"
#endif
#ifndef MSG_FILAMENT_SIZE_EXTRUDER_1
#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2"
#endif
#ifndef MSG_FILAMENT_SIZE_EXTRUDER_2
#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3"
#endif
#ifndef MSG_FILAMENT_SIZE_EXTRUDER_3
#define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4" #define MSG_FILAMENT_SIZE_EXTRUDER_3 "Fil. Dia. 4"
#endif
#ifndef MSG_CONTRAST
#define MSG_CONTRAST "LCD contrast" #define MSG_CONTRAST "LCD contrast"
#endif
#ifndef MSG_STORE_EPROM
#define MSG_STORE_EPROM "Store memory" #define MSG_STORE_EPROM "Store memory"
#endif
#ifndef MSG_LOAD_EPROM
#define MSG_LOAD_EPROM "Load memory" #define MSG_LOAD_EPROM "Load memory"
#endif
#ifndef MSG_RESTORE_FAILSAFE
#define MSG_RESTORE_FAILSAFE "Restore failsafe" #define MSG_RESTORE_FAILSAFE "Restore failsafe"
#endif
#ifndef MSG_REFRESH
#define MSG_REFRESH "Refresh" #define MSG_REFRESH "Refresh"
#endif
#ifndef MSG_WATCH
#define MSG_WATCH "Info screen" #define MSG_WATCH "Info screen"
#endif
#ifndef MSG_PREPARE
#define MSG_PREPARE "Prepare" #define MSG_PREPARE "Prepare"
#endif
#ifndef MSG_TUNE
#define MSG_TUNE "Tune" #define MSG_TUNE "Tune"
#endif
#ifndef MSG_PAUSE_PRINT
#define MSG_PAUSE_PRINT "Pause print" #define MSG_PAUSE_PRINT "Pause print"
#endif
#ifndef MSG_RESUME_PRINT
#define MSG_RESUME_PRINT "Resume print" #define MSG_RESUME_PRINT "Resume print"
#endif
#ifndef MSG_STOP_PRINT
#define MSG_STOP_PRINT "Stop print" #define MSG_STOP_PRINT "Stop print"
#endif
#ifndef MSG_CARD_MENU
#define MSG_CARD_MENU "Print from SD" #define MSG_CARD_MENU "Print from SD"
#endif
#ifndef MSG_NO_CARD
#define MSG_NO_CARD "No SD card" #define MSG_NO_CARD "No SD card"
#endif
#ifndef MSG_DWELL
#define MSG_DWELL "Sleep..." #define MSG_DWELL "Sleep..."
#endif
#ifndef MSG_USERWAIT
#define MSG_USERWAIT "Wait for user..." #define MSG_USERWAIT "Wait for user..."
#endif
#ifndef MSG_RESUMING
#define MSG_RESUMING "Resuming print" #define MSG_RESUMING "Resuming print"
#endif
#ifndef MSG_PRINT_ABORTED
#define MSG_PRINT_ABORTED "Print aborted" #define MSG_PRINT_ABORTED "Print aborted"
#endif
#ifndef MSG_NO_MOVE
#define MSG_NO_MOVE "No move." #define MSG_NO_MOVE "No move."
#endif
#ifndef MSG_KILLED
#define MSG_KILLED "KILLED. " #define MSG_KILLED "KILLED. "
#endif
#ifndef MSG_STOPPED
#define MSG_STOPPED "STOPPED. " #define MSG_STOPPED "STOPPED. "
#endif
#ifndef MSG_CONTROL_RETRACT
#define MSG_CONTROL_RETRACT "Retract mm" #define MSG_CONTROL_RETRACT "Retract mm"
#endif
#ifndef MSG_CONTROL_RETRACT_SWAP
#define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm" #define MSG_CONTROL_RETRACT_SWAP "Swap Re.mm"
#endif
#ifndef MSG_CONTROL_RETRACTF
#define MSG_CONTROL_RETRACTF "Retract V" #define MSG_CONTROL_RETRACTF "Retract V"
#endif
#ifndef MSG_CONTROL_RETRACT_ZLIFT
#define MSG_CONTROL_RETRACT_ZLIFT "Hop mm" #define MSG_CONTROL_RETRACT_ZLIFT "Hop mm"
#endif
#ifndef MSG_CONTROL_RETRACT_RECOVER
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#endif
#ifndef MSG_CONTROL_RETRACT_RECOVER_SWAP
#define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm" #define MSG_CONTROL_RETRACT_RECOVER_SWAP "S UnRet+mm"
#endif
#ifndef MSG_CONTROL_RETRACT_RECOVERF
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V"
#endif
#ifndef MSG_AUTORETRACT
#define MSG_AUTORETRACT "AutoRetr." #define MSG_AUTORETRACT "AutoRetr."
#endif
#ifndef MSG_FILAMENTCHANGE
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#endif
#ifndef MSG_INIT_SDCARD
#define MSG_INIT_SDCARD "Init. SD card" #define MSG_INIT_SDCARD "Init. SD card"
#endif
#ifndef MSG_CNG_SDCARD
#define MSG_CNG_SDCARD "Change SD card" #define MSG_CNG_SDCARD "Change SD card"
#endif
#ifndef MSG_ZPROBE_OUT
#define MSG_ZPROBE_OUT "Z probe out. bed" #define MSG_ZPROBE_OUT "Z probe out. bed"
#endif
#ifndef MSG_POSITION_UNKNOWN
#define MSG_POSITION_UNKNOWN "Home X/Y before Z" #define MSG_POSITION_UNKNOWN "Home X/Y before Z"
#endif
#ifndef MSG_ZPROBE_ZOFFSET
#define MSG_ZPROBE_ZOFFSET "Z Offset" #define MSG_ZPROBE_ZOFFSET "Z Offset"
#endif
#ifndef MSG_BABYSTEP_X
#define MSG_BABYSTEP_X "Babystep X" #define MSG_BABYSTEP_X "Babystep X"
#endif
#ifndef MSG_BABYSTEP_Y
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#endif
#ifndef MSG_BABYSTEP_Z
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#endif
#ifndef MSG_ENDSTOP_ABORT
#define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_ENDSTOP_ABORT "Endstop abort"
#endif
#ifndef MSG_HEATING_FAILED_LCD
#define MSG_HEATING_FAILED_LCD "Heating failed"
#endif
#ifndef MSG_ERR_REDUNDANT_TEMP
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#endif
#ifndef MSG_THERMAL_RUNAWAY
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
#endif
#ifndef MSG_ERR_MAXTEMP
#define MSG_ERR_MAXTEMP "Err: MAXTEMP"
#endif
#ifndef MSG_ERR_MINTEMP
#define MSG_ERR_MINTEMP "Err: MINTEMP"
#endif
#ifndef MSG_ERR_MAXTEMP_BED
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#endif
#ifdef DELTA_CALIBRATION_MENU #ifdef DELTA_CALIBRATION_MENU
#ifndef MSG_DELTA_CALIBRATE
#define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE "Delta Calibration"
#endif
#ifndef MSG_DELTA_CALIBRATE_X
#define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_X "Calibrate X"
#endif
#ifndef MSG_DELTA_CALIBRATE_Y
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y" #define MSG_DELTA_CALIBRATE_Y "Calibrate Y"
#endif
#ifndef MSG_DELTA_CALIBRATE_Z
#define MSG_DELTA_CALIBRATE_Z "Calibrate Z" #define MSG_DELTA_CALIBRATE_Z "Calibrate Z"
#endif
#ifndef MSG_DELTA_CALIBRATE_CENTER
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif
#endif // DELTA_CALIBRATION_MENU #endif // DELTA_CALIBRATION_MENU
#endif // LANGUAGE_EN_H #endif // LANGUAGE_EN_H

@ -17,38 +17,38 @@
#define MSG_AUTO_HOME "Aja referenssiin" #define MSG_AUTO_HOME "Aja referenssiin"
#define MSG_SET_HOME_OFFSETS "Set home offsets" #define MSG_SET_HOME_OFFSETS "Set home offsets"
#define MSG_SET_ORIGIN "Aseta origo" #define MSG_SET_ORIGIN "Aseta origo"
#define MSG_PREHEAT_PLA "Esilammita PLA" #define MSG_PREHEAT_PLA "Esil" STR_ae "mmit" STR_ae " PLA"
#define MSG_PREHEAT_PLA_N "Esilammita PLA " #define MSG_PREHEAT_PLA_N "Esil" STR_ae "mmit" STR_ae " PLA "
#define MSG_PREHEAT_PLA_ALL "Esila. PLA Kaikki" #define MSG_PREHEAT_PLA_ALL "Esil" STR_ae ". PLA Kaikki"
#define MSG_PREHEAT_PLA_BEDONLY "Esila. PLA Alusta" #define MSG_PREHEAT_PLA_BEDONLY "Esil" STR_ae ". PLA Alusta"
#define MSG_PREHEAT_PLA_SETTINGS "Esilamm. PLA konf" #define MSG_PREHEAT_PLA_SETTINGS "Esil" STR_ae "mm. PLA konf"
#define MSG_PREHEAT_ABS "Esilammita ABS" #define MSG_PREHEAT_ABS "Esil" STR_ae "mmit" STR_ae " ABS"
#define MSG_PREHEAT_ABS_N "Esilammita ABS " #define MSG_PREHEAT_ABS_N "Esil" STR_ae "mmit" STR_ae " ABS "
#define MSG_PREHEAT_ABS_ALL "Esila. ABS Kaikki" #define MSG_PREHEAT_ABS_ALL "Esil" STR_ae ". ABS Kaikki"
#define MSG_PREHEAT_ABS_BEDONLY "Esila. ABS Alusta" #define MSG_PREHEAT_ABS_BEDONLY "Esil" STR_ae ". ABS Alusta"
#define MSG_PREHEAT_ABS_SETTINGS "Esilamm. ABS konf" #define MSG_PREHEAT_ABS_SETTINGS "Esil" STR_ae "mm. ABS konf"
#define MSG_COOLDOWN "Jaahdyta" #define MSG_COOLDOWN "J" STR_ae "" STR_ae "hdyt" STR_ae ""
#define MSG_SWITCH_PS_ON "Virta paalle" #define MSG_SWITCH_PS_ON "Virta p" STR_ae "" STR_ae "lle"
#define MSG_SWITCH_PS_OFF "Virta pois" #define MSG_SWITCH_PS_OFF "Virta pois"
#define MSG_EXTRUDE "Pursota" #define MSG_EXTRUDE "Pursota"
#define MSG_RETRACT "Veda takaisin" #define MSG_RETRACT "Ved" STR_ae " takaisin"
#define MSG_MOVE_AXIS "Liikuta akseleita" #define MSG_MOVE_AXIS "Liikuta akseleita"
#define MSG_MOVE_X "Move X" #define MSG_MOVE_X "Liikuta X"
#define MSG_MOVE_Y "Move Y" #define MSG_MOVE_Y "Liikuta Y"
#define MSG_MOVE_Z "Move Z" #define MSG_MOVE_Z "Liikuta Z"
#define MSG_MOVE_E "Extruder" #define MSG_MOVE_E "Extruder"
#define MSG_MOVE_01MM "Move 0.1mm" #define MSG_MOVE_01MM "Liikuta 0.1mm"
#define MSG_MOVE_1MM "Move 1mm" #define MSG_MOVE_1MM "Liikuta 1mm"
#define MSG_MOVE_10MM "Move 10mm" #define MSG_MOVE_10MM "Liikuta 10mm"
#define MSG_SPEED "Nopeus" #define MSG_SPEED "Nopeus"
#define MSG_NOZZLE "Suutin" #define MSG_NOZZLE "Suutin"
#define MSG_BED "Alusta" #define MSG_BED "Alusta"
#define MSG_FAN_SPEED "Tuul. nopeus" #define MSG_FAN_SPEED "Tuul. nopeus"
#define MSG_FLOW "Virtaus" #define MSG_FLOW "Virtaus"
#define MSG_CONTROL "Kontrolli" #define MSG_CONTROL "Kontrolli"
#define MSG_MIN " \002 Min" #define MSG_MIN STR_THERMOMETER " Min"
#define MSG_MAX " \002 Max" #define MSG_MAX STR_THERMOMETER " Max"
#define MSG_FACTOR " \002 Kerr" #define MSG_FACTOR STR_THERMOMETER " Kerr"
#define MSG_AUTOTEMP "Autotemp" #define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "On " #define MSG_ON "On "
#define MSG_OFF "Off" #define MSG_OFF "Off"
@ -73,24 +73,24 @@
#define MSG_YSTEPS "Ysteps/mm" #define MSG_YSTEPS "Ysteps/mm"
#define MSG_ZSTEPS "Zsteps/mm" #define MSG_ZSTEPS "Zsteps/mm"
#define MSG_ESTEPS "Esteps/mm" #define MSG_ESTEPS "Esteps/mm"
#define MSG_TEMPERATURE "Lampotila" #define MSG_TEMPERATURE "L" STR_ae "mp" STR_oe "tila"
#define MSG_MOTION "Liike" #define MSG_MOTION "Liike"
#define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1"
#define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2" #define MSG_FILAMENT_SIZE_EXTRUDER_1 "Fil. Dia. 2"
#define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3" #define MSG_FILAMENT_SIZE_EXTRUDER_2 "Fil. Dia. 3"
#define MSG_CONTRAST "LCD contrast" #define MSG_CONTRAST "LCD kontrasti"
#define MSG_STORE_EPROM "Tallenna muistiin" #define MSG_STORE_EPROM "Tallenna muistiin"
#define MSG_LOAD_EPROM "Lataa muistista" #define MSG_LOAD_EPROM "Lataa muistista"
#define MSG_RESTORE_FAILSAFE "Palauta oletus" #define MSG_RESTORE_FAILSAFE "Palauta oletus"
#define MSG_REFRESH "Paivita" #define MSG_REFRESH "P" STR_ae "ivit" STR_ae ""
#define MSG_WATCH "Seuraa" #define MSG_WATCH "Seuraa"
#define MSG_PREPARE "Valmistele" #define MSG_PREPARE "Valmistele"
#define MSG_TUNE "Saada" #define MSG_TUNE "S" STR_ae "" STR_ae "d" STR_ae ""
#define MSG_PAUSE_PRINT "Keskeyta tulostus" #define MSG_PAUSE_PRINT "Keskeyt" STR_ae " tulostus"
#define MSG_RESUME_PRINT "Jatka tulostusta" #define MSG_RESUME_PRINT "Jatka tulostusta"
#define MSG_STOP_PRINT "Pysayta tulostus" #define MSG_STOP_PRINT "Pys" STR_ae "yt" STR_ae " tulostus"
#define MSG_CARD_MENU "Korttivalikko" #define MSG_CARD_MENU "Korttivalikko"
#define MSG_NO_CARD "Ei korttia" #define MSG_NO_CARD "Ei korttia"
#define MSG_DWELL "Nukkumassa..." #define MSG_DWELL "Nukkumassa..."
@ -100,9 +100,9 @@
#define MSG_NO_MOVE "Ei liiketta." #define MSG_NO_MOVE "Ei liiketta."
#define MSG_KILLED "KILLED. " #define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. " #define MSG_STOPPED "STOPPED. "
#define MSG_CONTROL_RETRACT "Veda mm" #define MSG_CONTROL_RETRACT "Ved" STR_ae " mm"
#define MSG_CONTROL_RETRACT_SWAP "Va. Veda mm" #define MSG_CONTROL_RETRACT_SWAP "Va. Ved" STR_ae " mm"
#define MSG_CONTROL_RETRACTF "Veda V" #define MSG_CONTROL_RETRACTF "Ved" STR_ae " V"
#define MSG_CONTROL_RETRACT_ZLIFT "Z mm" #define MSG_CONTROL_RETRACT_ZLIFT "Z mm"
#define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER "UnRet +mm"
#define MSG_CONTROL_RETRACT_RECOVER_SWAP "Va. UnRet +mm" #define MSG_CONTROL_RETRACT_RECOVER_SWAP "Va. UnRet +mm"
@ -120,11 +120,11 @@
#define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_ENDSTOP_ABORT "Endstop abort"
#ifdef DELTA_CALIBRATION_MENU #ifdef DELTA_CALIBRATION_MENU
#define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE "Delta Kalibrointi"
#define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_X "Kalibroi X"
#define MSG_DELTA_CALIBRATE_Y "Calibrate Y" #define MSG_DELTA_CALIBRATE_Y "Kalibroi Y"
#define MSG_DELTA_CALIBRATE_Z "Calibrate Z" #define MSG_DELTA_CALIBRATE_Z "Kalibroi Z"
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Kalibroi Center"
#endif // DELTA_CALIBRATION_MENU #endif // DELTA_CALIBRATION_MENU
#endif // LANGUAGE_FI_H #endif // LANGUAGE_FI_H

@ -13,7 +13,7 @@
#define WELCOME_MSG MACHINE_NAME " Готов." #define WELCOME_MSG MACHINE_NAME " Готов."
#define MSG_SD_INSERTED "Карта вставлена" #define MSG_SD_INSERTED "Карта вставлена"
#define MSG_SD_REMOVED "Карта извлечена" #define MSG_SD_REMOVED "Карта извлечена"
#define MSG_MAIN "Меню \003" #define MSG_MAIN "Меню"
#define MSG_AUTOSTART "Автостарт" #define MSG_AUTOSTART "Автостарт"
#define MSG_DISABLE_STEPPERS "Выкл. двигатели" #define MSG_DISABLE_STEPPERS "Выкл. двигатели"
#define MSG_AUTO_HOME "Парковка" #define MSG_AUTO_HOME "Парковка"
@ -43,14 +43,14 @@
#define MSG_MOVE_1MM "Move 1mm" #define MSG_MOVE_1MM "Move 1mm"
#define MSG_MOVE_10MM "Move 10mm" #define MSG_MOVE_10MM "Move 10mm"
#define MSG_SPEED "Скорость" #define MSG_SPEED "Скорость"
#define MSG_NOZZLE "\002 Фильера" #define MSG_NOZZLE LCD_STR_THERMOMETER " Фильера"
#define MSG_BED "\002 Кровать" #define MSG_BED LCD_STR_THERMOMETER " Кровать"
#define MSG_FAN_SPEED "Куллер" #define MSG_FAN_SPEED "Куллер"
#define MSG_FLOW "Поток" #define MSG_FLOW "Поток"
#define MSG_CONTROL "Настройки \003" #define MSG_CONTROL "Настройки"
#define MSG_MIN "\002 Минимум" #define MSG_MIN LCD_STR_THERMOMETER " Минимум"
#define MSG_MAX "\002 Максимум" #define MSG_MAX LCD_STR_THERMOMETER " Максимум"
#define MSG_FACTOR "\002 Фактор" #define MSG_FACTOR LCD_STR_THERMOMETER " Фактор"
#define MSG_AUTOTEMP "Autotemp" #define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "Вкл. " #define MSG_ON "Вкл. "
#define MSG_OFF "Выкл. " #define MSG_OFF "Выкл. "
@ -75,8 +75,8 @@
#define MSG_YSTEPS "Y шаг/mm" #define MSG_YSTEPS "Y шаг/mm"
#define MSG_ZSTEPS "Z шаг/mm" #define MSG_ZSTEPS "Z шаг/mm"
#define MSG_ESTEPS "E шаг/mm" #define MSG_ESTEPS "E шаг/mm"
#define MSG_TEMPERATURE "Температура \x7E" #define MSG_TEMPERATURE "Температура"
#define MSG_MOTION "Скорости \x7E" #define MSG_MOTION "Скорости"
#define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1" #define MSG_FILAMENT_SIZE_EXTRUDER_0 "Fil. Dia. 1"
@ -86,14 +86,14 @@
#define MSG_STORE_EPROM "Сохранить в EPROM" #define MSG_STORE_EPROM "Сохранить в EPROM"
#define MSG_LOAD_EPROM "Загруз. из EPROM" #define MSG_LOAD_EPROM "Загруз. из EPROM"
#define MSG_RESTORE_FAILSAFE "Сброс настроек" #define MSG_RESTORE_FAILSAFE "Сброс настроек"
#define MSG_REFRESH "\004Обновить" #define MSG_REFRESH LCD_STR_REFRESH "Обновить"
#define MSG_WATCH "Обзор \003" #define MSG_WATCH "Обзор"
#define MSG_PREPARE "Действия \x7E" #define MSG_PREPARE "Действия"
#define MSG_TUNE "Настройки \x7E" #define MSG_TUNE "Настройки"
#define MSG_PAUSE_PRINT "Продолжить печать" #define MSG_PAUSE_PRINT "Продолжить печать"
#define MSG_RESUME_PRINT "возобн. печать" #define MSG_RESUME_PRINT "возобн. печать"
#define MSG_STOP_PRINT "Остановить печать" #define MSG_STOP_PRINT "Остановить печать"
#define MSG_CARD_MENU "Меню карты \x7E" #define MSG_CARD_MENU "Меню карты"
#define MSG_NO_CARD "Нет карты" #define MSG_NO_CARD "Нет карты"
#define MSG_DWELL "Сон..." #define MSG_DWELL "Сон..."
#define MSG_USERWAIT "Ожиданиие" #define MSG_USERWAIT "Ожиданиие"

@ -36,7 +36,7 @@
#include "pins_SETHI.h" #include "pins_SETHI.h"
#elif MB(RAMPS_OLD) #elif MB(RAMPS_OLD)
#include "pins_RAMPS_OLD.h" #include "pins_RAMPS_OLD.h"
#elif IS_RAMPS #elif MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF)
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#elif MB(DUEMILANOVE_328P) #elif MB(DUEMILANOVE_328P)
#include "pins_DUEMILANOVE_328P.h" #include "pins_DUEMILANOVE_328P.h"
@ -110,6 +110,10 @@
#include "pins_WITBOX.h" #include "pins_WITBOX.h"
#elif MB(HEPHESTOS) #elif MB(HEPHESTOS)
#include "pins_HEPHESTOS.h" #include "pins_HEPHESTOS.h"
#elif MB(BAM_DICE)
#include "pins_RAMPS_13.h"
#elif MB(BAM_DICE_DUE)
#include "pins_BAM_DICE_DUE.h"
#elif MB(99) #elif MB(99)
#include "pins_99.h" #include "pins_99.h"
#else #else

@ -4,6 +4,8 @@
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#define Z_ENABLE_PIN 63
#define X_MAX_PIN 2 #define X_MAX_PIN 2
#define Y_MAX_PIN 15 #define Y_MAX_PIN 15
#define Z_MAX_PIN -1 #define Z_MAX_PIN -1

@ -3,3 +3,11 @@
*/ */
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#define FAN_PIN 9 // (Sprinter config)
#define HEATER_1_PIN -1
#ifdef TEMP_STAT_LEDS
#define STAT_LED_RED 6
#define STAT_LED_BLUE 11
#endif

@ -4,6 +4,9 @@
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#define FAN_PIN 9 // (Sprinter config)
#define BEEPER 33
#define E2_STEP_PIN 23 #define E2_STEP_PIN 23
#define E2_DIR_PIN 25 #define E2_DIR_PIN 25
#define E2_ENABLE_PIN 40 #define E2_ENABLE_PIN 40
@ -16,6 +19,7 @@
#define E4_DIR_PIN 37 #define E4_DIR_PIN 37
#define E4_ENABLE_PIN 42 #define E4_ENABLE_PIN 42
#define HEATER_1_PIN -1
#define HEATER_2_PIN 16 #define HEATER_2_PIN 16
#define HEATER_3_PIN 17 #define HEATER_3_PIN 17
#define HEATER_4_PIN 4 #define HEATER_4_PIN 4

@ -0,0 +1,11 @@
/**
* BAM&DICE Due (Arduino Mega) pin assignments
*/
#include "pins_RAMPS_13.h"
#define FAN_PIN 9 // (Sprinter config)
#define HEATER_1_PIN -1
#define TEMP_0_PIN 9 // ANALOG NUMBERING
#define TEMP_1_PIN 11 // ANALOG NUMBERING

@ -87,9 +87,3 @@
// 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

@ -74,12 +74,6 @@
#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

@ -3,3 +3,6 @@
*/ */
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#define FAN_PIN 9 // (Sprinter config)
#define HEATER_1_PIN -1

@ -83,10 +83,4 @@
#define SDCARDDETECT -1 // Ramps does not use this port #define SDCARDDETECT -1 // Ramps does not use this port
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // ULTRA_LCD && NEWPANEL #endif // ULTRA_LCD && NEWPANEL

@ -80,9 +80,3 @@
#define BLEN_A 0 #define BLEN_A 0
#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

@ -95,9 +95,3 @@
#define BLEN_A 0 #define BLEN_A 0
#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

@ -8,6 +8,20 @@
#define LARGE_FLASH true #define LARGE_FLASH true
// Servo support
#ifdef NUM_SERVOS
#define SERVO0_PIN 46 //AUX3-6
#if NUM_SERVOS > 1
#define SERVO1_PIN 47 //AUX3-5
#if NUM_SERVOS > 2
#define SERVO2_PIN 48 //AUX3-4
#if NUM_SERVOS > 3
#define SERVO2_PIN 49 //AUX3-3
#endif
#endif
#endif
#endif
#define X_STEP_PIN 58 #define X_STEP_PIN 58
#define X_DIR_PIN 57 #define X_DIR_PIN 57
#define X_ENABLE_PIN 59 #define X_ENABLE_PIN 59
@ -81,9 +95,3 @@
#define BLEN_A 0 #define BLEN_A 0
#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

@ -116,11 +116,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 //!NEWPANEL - old style panel with shift register #else //!NEWPANEL - 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
@ -138,12 +133,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

@ -7,10 +7,8 @@
* RAMPS_13_EEB (Extruder, Extruder, Bed) * RAMPS_13_EEB (Extruder, Extruder, Bed)
* RAMPS_13_EFF (Extruder, Fan, Fan) * RAMPS_13_EFF (Extruder, Fan, Fan)
* RAMPS_13_EEF (Extruder, Extruder, Fan) * RAMPS_13_EEF (Extruder, Extruder, Fan)
* 3DRAG *
* K8200 * Other pins_MYBOARD.h files may override these defaults
* AZTEEG_X3
* AZTEEG_X3_PRO
*/ */
#if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__) #if !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)
@ -63,7 +61,7 @@
#define FILWIDTH_PIN 5 #define FILWIDTH_PIN 5
#endif #endif
#if MB(RAMPS_13_EFB) || MB(RAMPS_13_EFF) || MB(AZTEEG_X3) || MB(AZTEEG_X3_PRO) || MB(WITBOX) || MB(HEPHESTOS) #if MB(RAMPS_13_EFB) || MB(RAMPS_13_EFF)
#define FAN_PIN 9 // (Sprinter config) #define FAN_PIN 9 // (Sprinter config)
#if MB(RAMPS_13_EFF) #if MB(RAMPS_13_EFF)
#define CONTROLLERFAN_PIN -1 // Pin used for the fan to cool controller #define CONTROLLERFAN_PIN -1 // Pin used for the fan to cool controller
@ -88,7 +86,7 @@
#define HEATER_0_PIN 10 // EXTRUDER 1 #define HEATER_0_PIN 10 // EXTRUDER 1
#endif #endif
#if MB(RAMPS_13_EFB) || MB(AZTEEG_X3) || MB(WITBOX) || MB(HEPHESTOS) #if MB(RAMPS_13_EFB)
#define HEATER_1_PIN -1 #define HEATER_1_PIN -1
#else #else
#define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter) #define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter)
@ -110,40 +108,36 @@
#ifdef NUM_SERVOS #ifdef NUM_SERVOS
#define SERVO0_PIN 11 #define SERVO0_PIN 11
#if NUM_SERVOS > 1 #if NUM_SERVOS > 1
#define SERVO1_PIN 6 #define SERVO1_PIN 6
#endif
#if NUM_SERVOS > 2 #if NUM_SERVOS > 2
#define SERVO2_PIN 5 #define SERVO2_PIN 5
#endif
#if NUM_SERVOS > 3 #if NUM_SERVOS > 3
#define SERVO3_PIN 4 #define SERVO3_PIN 4
#endif #endif
#endif #endif
#if MB(AZTEEG_X3_PRO)
#define BEEPER 33
#endif
#ifdef TEMP_STAT_LEDS
#if MB(AZTEEG_X3)
#define STAT_LED_RED 6
#define STAT_LED_BLUE 11
#endif #endif
#endif #endif
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
#ifdef NEWPANEL #ifdef NEWPANEL
#ifdef PANEL_ONE
#define LCD_PINS_RS 40
#define LCD_PINS_ENABLE 42
#define LCD_PINS_D4 65
#define LCD_PINS_D5 66
#define LCD_PINS_D6 44
#define LCD_PINS_D7 64
#else
#define LCD_PINS_RS 16 #define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17 #define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23 #define LCD_PINS_D4 23
#define LCD_PINS_D5 25 #define LCD_PINS_D5 25
#define LCD_PINS_D6 27 #define LCD_PINS_D6 27
#define LCD_PINS_D7 29 #define LCD_PINS_D7 29
#endif
#ifdef REPRAP_DISCOUNT_SMART_CONTROLLER #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
#define BEEPER 37 #define BEEPER 37
@ -178,6 +172,10 @@
#define SHIFT_OUT 40 // shift register #define SHIFT_OUT 40 // shift register
#define SHIFT_CLK 44 // shift register #define SHIFT_CLK 44 // shift register
#define SHIFT_LD 42 // shift register #define SHIFT_LD 42 // shift register
#elif defined(PANEL_ONE)
#define BTN_EN1 59 // AUX2 PIN 3
#define BTN_EN2 63 // AUX2 PIN 4
#define BTN_ENC 49 // AUX3 PIN 7
#else #else
#define BTN_EN1 37 #define BTN_EN1 37
#define BTN_EN2 35 #define BTN_EN2 35

@ -6,6 +6,10 @@
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu. #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif #endif
#if EXTRUDERS > 3
#error RUMBA supports up to 3 extruders. Comment this line to keep going.
#endif
#define X_STEP_PIN 17 #define X_STEP_PIN 17
#define X_DIR_PIN 16 #define X_DIR_PIN 16
#define X_ENABLE_PIN 48 #define X_ENABLE_PIN 48

@ -3,3 +3,6 @@
*/ */
#include "pins_RAMPS_13.h" #include "pins_RAMPS_13.h"
#define FAN_PIN 9 // (Sprinter config)
#define HEATER_1_PIN -1

@ -629,13 +629,21 @@ 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
if (target[X_AXIS] < position[X_AXIS])
{
block->direction_bits |= (1<<X_HEAD); //AlexBorro: Save the real Extruder (head) direction in X Axis
}
if (target[Y_AXIS] < position[Y_AXIS])
{
block->direction_bits |= (1<<Y_HEAD); //AlexBorro: Save the real Extruder (head) direction in Y Axis
}
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); //AlexBorro: Motor A direction (Incorrectly implemented as X_AXIS)
} }
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<<Y_AXIS); block->direction_bits |= (1<<Y_AXIS); //AlexBorro: Motor B direction (Incorrectly implemented as Y_AXIS)
} }
#endif #endif
if (target[Z_AXIS] < position[Z_AXIS]) if (target[Z_AXIS] < position[Z_AXIS])

@ -43,7 +43,7 @@ block_t *current_block; // A pointer to the block currently being traced
//=========================================================================== //===========================================================================
//=============================private variables ============================ //=============================private variables ============================
//=========================================================================== //===========================================================================
//static makes it inpossible to be called from outside of this file by extern.! //static makes it impossible to be called from outside of this file by extern.!
// Variables used by The Stepper Driver Interrupt // Variables used by The Stepper Driver Interrupt
static unsigned char out_bits; // The next stepping-bits to be output static unsigned char out_bits; // The next stepping-bits to be output
@ -187,7 +187,7 @@ void checkHitEndstops()
SERIAL_ECHOPAIR(" Z:",(float)endstops_trigsteps[Z_AXIS]/axis_steps_per_unit[Z_AXIS]); SERIAL_ECHOPAIR(" Z:",(float)endstops_trigsteps[Z_AXIS]/axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
} }
SERIAL_ECHOLN(""); SERIAL_EOL;
endstop_x_hit=false; endstop_x_hit=false;
endstop_y_hit=false; endstop_y_hit=false;
endstop_z_hit=false; endstop_z_hit=false;
@ -399,23 +399,24 @@ ISR(TIMER1_COMPA_vect)
count_direction[Y_AXIS]=1; count_direction[Y_AXIS]=1;
} }
// Set direction en check limit switches if(check_endstops) // check X and Y Endstops
{
#ifndef COREXY #ifndef COREXY
if ((out_bits & (1<<X_AXIS)) != 0) { // stepping along -X axis if ((out_bits & (1<<X_AXIS)) != 0) // stepping along -X axis (regular cartesians bot)
#else #else
if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) != 0)) { //-X occurs for -A and -B if (!((current_block->steps_x == current_block->steps_y) && ((out_bits & (1<<X_AXIS))>>X_AXIS != (out_bits & (1<<Y_AXIS))>>Y_AXIS))) // AlexBorro: If DeltaX == -DeltaY, the movement is only in Y axis
if ((out_bits & (1<<X_HEAD)) != 0) //AlexBorro: Head direction in -X axis for CoreXY bots.
#endif #endif
CHECK_ENDSTOPS { // -direction
{
#ifdef DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
|| (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
#endif #endif
{ {
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 #if defined(X_MIN_PIN) && X_MIN_PIN > -1
bool x_min_endstop=(READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING); bool x_min_endstop=(READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING);
if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) { if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0))
{
endstops_trigsteps[X_AXIS] = count_position[X_AXIS]; endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
endstop_x_hit=true; endstop_x_hit=true;
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
@ -424,19 +425,17 @@ ISR(TIMER1_COMPA_vect)
#endif #endif
} }
} }
} else
else { // +direction { // +direction
CHECK_ENDSTOPS
{
#ifdef DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
|| (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
#endif #endif
{ {
#if defined(X_MAX_PIN) && X_MAX_PIN > -1 #if defined(X_MAX_PIN) && X_MAX_PIN > -1
bool x_max_endstop=(READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING); bool x_max_endstop=(READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING);
if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){ if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0))
{
endstops_trigsteps[X_AXIS] = count_position[X_AXIS]; endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
endstop_x_hit=true; endstop_x_hit=true;
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
@ -445,18 +444,18 @@ ISR(TIMER1_COMPA_vect)
#endif #endif
} }
} }
}
#ifndef COREXY #ifndef COREXY
if ((out_bits & (1<<Y_AXIS)) != 0) { // -direction if ((out_bits & (1<<Y_AXIS)) != 0) // -direction
#else #else
if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) == 0)) { // -Y occurs for -A and +B if (!((current_block->steps_x == current_block->steps_y) && ((out_bits & (1<<X_AXIS))>>X_AXIS == (out_bits & (1<<Y_AXIS))>>Y_AXIS))) // AlexBorro: If DeltaX == DeltaY, the movement is only in X axis
if ((out_bits & (1<<Y_HEAD)) != 0) //AlexBorro: Head direction in -Y axis for CoreXY bots.
#endif #endif
CHECK_ENDSTOPS { // -direction
{
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
bool y_min_endstop=(READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING); bool y_min_endstop=(READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING);
if(y_min_endstop && old_y_min_endstop && (current_block->steps_y > 0)) { if(y_min_endstop && old_y_min_endstop && (current_block->steps_y > 0))
{
endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS]; endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
endstop_y_hit=true; endstop_y_hit=true;
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
@ -464,19 +463,19 @@ ISR(TIMER1_COMPA_vect)
old_y_min_endstop = y_min_endstop; old_y_min_endstop = y_min_endstop;
#endif #endif
} }
} else
else { // +direction { // +direction
CHECK_ENDSTOPS
{
#if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
bool y_max_endstop=(READ(Y_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING); bool y_max_endstop=(READ(Y_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING);
if(y_max_endstop && old_y_max_endstop && (current_block->steps_y > 0)){ if(y_max_endstop && old_y_max_endstop && (current_block->steps_y > 0))
{
endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS]; endstops_trigsteps[Y_AXIS] = count_position[Y_AXIS];
endstop_y_hit=true; endstop_y_hit=true;
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
} }
old_y_max_endstop = y_max_endstop; old_y_max_endstop = y_max_endstop;
#endif #endif
} }
} }
@ -960,51 +959,41 @@ void st_init()
//Initialize Step Pins //Initialize Step Pins
#if defined(X_STEP_PIN) && (X_STEP_PIN > -1) #if defined(X_STEP_PIN) && (X_STEP_PIN > -1)
SET_OUTPUT(X_STEP_PIN); OUT_WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
disable_x(); disable_x();
#endif #endif
#if defined(X2_STEP_PIN) && (X2_STEP_PIN > -1) #if defined(X2_STEP_PIN) && (X2_STEP_PIN > -1)
SET_OUTPUT(X2_STEP_PIN); OUT_WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
disable_x(); disable_x();
#endif #endif
#if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1)
SET_OUTPUT(Y_STEP_PIN); OUT_WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
#if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && (Y2_STEP_PIN > -1) #if defined(Y_DUAL_STEPPER_DRIVERS) && defined(Y2_STEP_PIN) && (Y2_STEP_PIN > -1)
SET_OUTPUT(Y2_STEP_PIN); OUT_WRITE(Y2_STEP_PIN,INVERT_Y_STEP_PIN);
WRITE(Y2_STEP_PIN,INVERT_Y_STEP_PIN);
#endif #endif
disable_y(); disable_y();
#endif #endif
#if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1)
SET_OUTPUT(Z_STEP_PIN); OUT_WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN);
WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN);
#if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_STEP_PIN) && (Z2_STEP_PIN > -1) #if defined(Z_DUAL_STEPPER_DRIVERS) && defined(Z2_STEP_PIN) && (Z2_STEP_PIN > -1)
SET_OUTPUT(Z2_STEP_PIN); OUT_WRITE(Z2_STEP_PIN,INVERT_Z_STEP_PIN);
WRITE(Z2_STEP_PIN,INVERT_Z_STEP_PIN);
#endif #endif
disable_z(); disable_z();
#endif #endif
#if defined(E0_STEP_PIN) && (E0_STEP_PIN > -1) #if defined(E0_STEP_PIN) && (E0_STEP_PIN > -1)
SET_OUTPUT(E0_STEP_PIN); OUT_WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN);
WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN);
disable_e0(); disable_e0();
#endif #endif
#if defined(E1_STEP_PIN) && (E1_STEP_PIN > -1) #if defined(E1_STEP_PIN) && (E1_STEP_PIN > -1)
SET_OUTPUT(E1_STEP_PIN); OUT_WRITE(E1_STEP_PIN,INVERT_E_STEP_PIN);
WRITE(E1_STEP_PIN,INVERT_E_STEP_PIN);
disable_e1(); disable_e1();
#endif #endif
#if defined(E2_STEP_PIN) && (E2_STEP_PIN > -1) #if defined(E2_STEP_PIN) && (E2_STEP_PIN > -1)
SET_OUTPUT(E2_STEP_PIN); OUT_WRITE(E2_STEP_PIN,INVERT_E_STEP_PIN);
WRITE(E2_STEP_PIN,INVERT_E_STEP_PIN);
disable_e2(); disable_e2();
#endif #endif
#if defined(E3_STEP_PIN) && (E3_STEP_PIN > -1) #if defined(E3_STEP_PIN) && (E3_STEP_PIN > -1)
SET_OUTPUT(E3_STEP_PIN); OUT_WRITE(E3_STEP_PIN,INVERT_E_STEP_PIN);
WRITE(E3_STEP_PIN,INVERT_E_STEP_PIN);
disable_e3(); disable_e3();
#endif #endif

File diff suppressed because it is too large Load Diff

@ -85,55 +85,25 @@ extern float current_temperature_bed;
//inline so that there is no performance decrease. //inline so that there is no performance decrease.
//deg=degreeCelsius //deg=degreeCelsius
FORCE_INLINE float degHotend(uint8_t extruder) { FORCE_INLINE float degHotend(uint8_t extruder) { return current_temperature[extruder]; }
return current_temperature[extruder]; FORCE_INLINE float degBed() { return current_temperature_bed; }
};
#ifdef SHOW_TEMP_ADC_VALUES #ifdef SHOW_TEMP_ADC_VALUES
FORCE_INLINE float rawHotendTemp(uint8_t extruder) { FORCE_INLINE float rawHotendTemp(uint8_t extruder) { return current_temperature_raw[extruder]; }
return current_temperature_raw[extruder]; FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; }
};
FORCE_INLINE float rawBedTemp() {
return current_temperature_bed_raw;
};
#endif #endif
FORCE_INLINE float degBed() { FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }
return current_temperature_bed; FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
};
FORCE_INLINE float degTargetHotend(uint8_t extruder) {
return target_temperature[extruder];
};
FORCE_INLINE float degTargetBed() {
return target_temperature_bed;
};
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
target_temperature[extruder] = celsius;
};
FORCE_INLINE void setTargetBed(const float &celsius) { FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) { target_temperature[extruder] = celsius; }
target_temperature_bed = celsius; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; }
};
FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ FORCE_INLINE bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; }
return target_temperature[extruder] > current_temperature[extruder]; FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }
};
FORCE_INLINE bool isHeatingBed() { FORCE_INLINE bool isCoolingHotend(uint8_t extruder) { return target_temperature[extruder] < current_temperature[extruder]; }
return target_temperature_bed > current_temperature_bed; FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; }
};
FORCE_INLINE bool isCoolingHotend(uint8_t extruder) {
return target_temperature[extruder] < current_temperature[extruder];
};
FORCE_INLINE bool isCoolingBed() {
return target_temperature_bed < current_temperature_bed;
};
#define degHotend0() degHotend(0) #define degHotend0() degHotend(0)
#define degTargetHotend0() degTargetHotend(0) #define degTargetHotend0() degTargetHotend(0)
@ -171,8 +141,6 @@ FORCE_INLINE bool isCoolingBed() {
#error Invalid number of extruders #error Invalid number of extruders
#endif #endif
int getHeaterPower(int heater); int getHeaterPower(int heater);
void disable_heater(); void disable_heater();
void setWatch(); void setWatch();
@ -191,8 +159,7 @@ static bool thermal_runaway = false;
FORCE_INLINE void autotempShutdown() { FORCE_INLINE void autotempShutdown() {
#ifdef AUTOTEMP #ifdef AUTOTEMP
if(autotemp_enabled) if (autotemp_enabled) {
{
autotemp_enabled = false; autotemp_enabled = false;
if (degTargetHotend(active_extruder) > autotemp_min) if (degTargetHotend(active_extruder) > autotemp_min)
setTargetHotend(0, active_extruder); setTargetHotend(0, active_extruder);

@ -1095,6 +1095,29 @@ 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
// Dummy Thermistor table.. It will ALWAYS read a fixed value.
#ifndef DUMMY_THERMISTOR_999_VALUE
#define DUMMY_THERMISTOR_999_VALUE 25
#endif
const short temptable_999[][2] PROGMEM = {
{1*OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE},
{1023*OVERSAMPLENR, DUMMY_THERMISTOR_999_VALUE}
};
#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
#define TT_NAME(_N) _TT_NAME(_N) #define TT_NAME(_N) _TT_NAME(_N)

@ -10,6 +10,9 @@
int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */ int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
bool encoderRateMultiplierEnabled;
int32_t lastEncoderMovementMillis;
/* Configuration settings */ /* Configuration settings */
int plaPreheatHotendTemp; int plaPreheatHotendTemp;
int plaPreheatHPBTemp; int plaPreheatHPBTemp;
@ -41,11 +44,6 @@ char lcd_status_message[LCD_WIDTH+1] = WELCOME_MSG;
#include "ultralcd_implementation_hitachi_HD44780.h" #include "ultralcd_implementation_hitachi_HD44780.h"
#endif #endif
/** forward declarations **/
void copy_and_scalePID_i();
void copy_and_scalePID_d();
/* Different menus */ /* Different menus */
static void lcd_status_screen(); static void lcd_status_screen();
#ifdef ULTIPANEL #ifdef ULTIPANEL
@ -119,6 +117,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
/* Helper macros for menus */ /* Helper macros for menus */
#define START_MENU() do { \ #define START_MENU() do { \
encoderRateMultiplierEnabled = false; \
if (encoderPosition > 0x8000) encoderPosition = 0; \ if (encoderPosition > 0x8000) encoderPosition = 0; \
if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM < currentMenuViewOffset) currentMenuViewOffset = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\ if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM < currentMenuViewOffset) currentMenuViewOffset = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\
uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
@ -143,9 +142,39 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
}\ }\
_menuItemNr++;\ _menuItemNr++;\
} while(0) } while(0)
#ifdef ENCODER_RATE_MULTIPLIER
#define MENU_MULTIPLIER_ITEM(type, label, args...) do { \
if (_menuItemNr == _lineNr) { \
if (lcdDrawUpdate) { \
const char* _label_pstr = PSTR(label); \
if ((encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
lcd_implementation_drawmenu_ ## type ## _selected (_drawLineNr, _label_pstr , ## args ); \
} \
else { \
lcd_implementation_drawmenu_ ## type (_drawLineNr, _label_pstr , ## args ); \
} \
} \
if (wasClicked && (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) == _menuItemNr) { \
lcd_quick_feedback(); \
encoderRateMultiplierEnabled = true; \
lastEncoderMovementMillis = 0; \
menu_action_ ## type ( args ); \
return; \
} \
} \
_menuItemNr++; \
} while(0)
#endif //ENCODER_RATE_MULTIPLIER
#define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0) #define MENU_ITEM_DUMMY() do { _menuItemNr++; } while(0)
#define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args ) #define MENU_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )
#define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args ) #define MENU_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args )
#ifdef ENCODER_RATE_MULTIPLIER
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args )
#else //!ENCODER_RATE_MULTIPLIER
#define MENU_MULTIPLIER_ITEM_EDIT(type, label, args...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label) , ## args )
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label) , ## args )
#endif //!ENCODER_RATE_MULTIPLIER
#define END_MENU() \ #define END_MENU() \
if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM >= _menuItemNr) encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; \ if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM >= _menuItemNr) encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; \
if ((uint8_t)(encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ if ((uint8_t)(encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
@ -185,9 +214,8 @@ void* editValue;
int32_t minEditValue, maxEditValue; int32_t minEditValue, maxEditValue;
menuFunc_t callbackFunc; menuFunc_t callbackFunc;
// place-holders for Ki and Kd edits, and the extruder # being edited // place-holders for Ki and Kd edits
float raw_Ki, raw_Kd; float raw_Ki, raw_Kd;
int pid_current_extruder;
static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool feedback=true) { static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool feedback=true) {
if (currentMenu != menu) { if (currentMenu != menu) {
@ -205,6 +233,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool
/* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */ /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
static void lcd_status_screen() static void lcd_status_screen()
{ {
encoderRateMultiplierEnabled = false;
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD) #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) && !defined(DOGLCD)
uint16_t mil = millis(); uint16_t mil = millis();
#ifndef PROGRESS_MSG_ONCE #ifndef PROGRESS_MSG_ONCE
@ -317,14 +346,12 @@ static void lcd_sdcard_pause() { card.pauseSDPrint(); }
static void lcd_sdcard_resume() { card.startFileprint(); } static void lcd_sdcard_resume() { card.startFileprint(); }
static void lcd_sdcard_stop() static void lcd_sdcard_stop() {
{
card.sdprinting = false; card.sdprinting = false;
card.closefile(); card.closefile();
quickStop(); quickStop();
if(SD_FINISHED_STEPPERRELEASE) if (SD_FINISHED_STEPPERRELEASE) {
{ enquecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
} }
autotempShutdown(); autotempShutdown();
@ -334,57 +361,56 @@ static void lcd_sdcard_stop()
} }
/* Menu implementation */ /* Menu implementation */
static void lcd_main_menu() static void lcd_main_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_WATCH, lcd_status_screen); MENU_ITEM(back, MSG_WATCH, lcd_status_screen);
if (movesplanned() || IS_SD_PRINTING) if (movesplanned() || IS_SD_PRINTING) {
{
MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
}else{ }
else {
MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
#ifdef DELTA_CALIBRATION_MENU #ifdef DELTA_CALIBRATION_MENU
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu);
#endif // DELTA_CALIBRATION_MENU #endif
} }
MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu); MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
#ifdef SDSUPPORT #ifdef SDSUPPORT
if (card.cardOK) if (card.cardOK) {
{ if (card.isFileOpen()) {
if (card.isFileOpen())
{
if (card.sdprinting) if (card.sdprinting)
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
else else
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop);
}else{ }
else {
MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu);
#if SDCARDDETECT < 1 #if SDCARDDETECT < 1
MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user
#endif #endif
} }
}else{ }
else {
MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu); MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu);
#if SDCARDDETECT < 1 #if SDCARDDETECT < 1
MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
#endif #endif
} }
#endif #endif //SDSUPPORT
END_MENU(); END_MENU();
} }
#ifdef SDSUPPORT #ifdef SDSUPPORT
static void lcd_autostart_sd() static void lcd_autostart_sd() {
{
card.autostart_index = 0; card.autostart_index = 0;
card.setroot(); card.setroot();
card.checkautostart(true); card.checkautostart(true);
} }
#endif #endif
void lcd_set_home_offsets() void lcd_set_home_offsets() {
{
for(int8_t i=0; i < NUM_AXIS; i++) { for(int8_t i=0; i < NUM_AXIS; i++) {
if (i != E_AXIS) { if (i != E_AXIS) {
add_homing[i] -= current_position[i]; add_homing[i] -= current_position[i];
@ -394,8 +420,7 @@ void lcd_set_home_offsets()
plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]); plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
// Audio feedback // Audio feedback
enquecommand_P(PSTR("M300 S659 P200")); enquecommands_P(PSTR("M300 S659 P200\nM300 S698 P200"));
enquecommand_P(PSTR("M300 S698 P200"));
lcd_return_to_status(); lcd_return_to_status();
} }
@ -417,42 +442,38 @@ void lcd_set_home_offsets()
#endif //BABYSTEPPING #endif //BABYSTEPPING
static void lcd_tune_menu() static void lcd_tune_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999); MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
#if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_0 != 0
MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_1 != 0 #if TEMP_SENSOR_1 != 0
MENU_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N2, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_2 != 0 #if TEMP_SENSOR_2 != 0
MENU_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N3, &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_3 != 0 #if TEMP_SENSOR_3 != 0
MENU_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N4, &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_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
MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
MENU_ITEM_EDIT(int3, MSG_FLOW " 0", &extruder_multiply[0], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F0, &extruder_multiply[0], 10, 999);
#if TEMP_SENSOR_1 != 0 #if TEMP_SENSOR_1 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW " 1", &extruder_multiply[1], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F1, &extruder_multiply[1], 10, 999);
#endif #endif
#if TEMP_SENSOR_2 != 0 #if TEMP_SENSOR_2 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW " 2", &extruder_multiply[2], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F2, &extruder_multiply[2], 10, 999);
#endif #endif
#if TEMP_SENSOR_3 != 0 #if TEMP_SENSOR_3 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW " 3", &extruder_multiply[3], 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW MSG_F3, &extruder_multiply[3], 10, 999);
#endif #endif
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
#ifdef BABYSTEP_XY #ifdef BABYSTEP_XY
MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x);
@ -466,140 +487,61 @@ static void lcd_tune_menu()
END_MENU(); END_MENU();
} }
void lcd_preheat_pla0() void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) {
{ if (temph > 0) setTargetHotend(temph, endnum);
setTargetHotend0(plaPreheatHotendTemp); setTargetBed(tempb);
setTargetBed(plaPreheatHPBTemp); fanSpeed = fan;
fanSpeed = plaPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
void lcd_preheat_abs0()
{
setTargetHotend0(absPreheatHotendTemp);
setTargetBed(absPreheatHPBTemp);
fanSpeed = absPreheatFanSpeed;
lcd_return_to_status(); lcd_return_to_status();
setWatch(); // heater sanity check timer setWatch(); // heater sanity check timer
} }
void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
#if TEMP_SENSOR_1 != 0 //2nd extruder preheat #if TEMP_SENSOR_1 != 0 //2nd extruder preheat
void lcd_preheat_pla1() void lcd_preheat_pla1() { _lcd_preheat(1, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
{ void lcd_preheat_abs1() { _lcd_preheat(1, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
setTargetHotend1(plaPreheatHotendTemp);
setTargetBed(plaPreheatHPBTemp);
fanSpeed = plaPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
void lcd_preheat_abs1()
{
setTargetHotend1(absPreheatHotendTemp);
setTargetBed(absPreheatHPBTemp);
fanSpeed = absPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
#endif //2nd extruder preheat #endif //2nd extruder preheat
#if TEMP_SENSOR_2 != 0 //3 extruder preheat #if TEMP_SENSOR_2 != 0 //3 extruder preheat
void lcd_preheat_pla2() void lcd_preheat_pla2() { _lcd_preheat(2, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
{ void lcd_preheat_abs2() { _lcd_preheat(2, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
setTargetHotend2(plaPreheatHotendTemp);
setTargetBed(plaPreheatHPBTemp);
fanSpeed = plaPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
void lcd_preheat_abs2()
{
setTargetHotend2(absPreheatHotendTemp);
setTargetBed(absPreheatHPBTemp);
fanSpeed = absPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
#endif //3 extruder preheat #endif //3 extruder preheat
#if TEMP_SENSOR_3 != 0 //4 extruder preheat #if TEMP_SENSOR_3 != 0 //4 extruder preheat
void lcd_preheat_pla3() void lcd_preheat_pla3() { _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
{ void lcd_preheat_abs3() { _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
setTargetHotend3(plaPreheatHotendTemp);
setTargetBed(plaPreheatHPBTemp);
fanSpeed = plaPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
void lcd_preheat_abs3()
{
setTargetHotend3(absPreheatHotendTemp);
setTargetBed(absPreheatHPBTemp);
fanSpeed = absPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
#endif //4 extruder preheat #endif //4 extruder preheat
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //more than one extruder present #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //more than one extruder present
void lcd_preheat_pla0123() void lcd_preheat_pla0123() {
{
setTargetHotend0(plaPreheatHotendTemp); setTargetHotend0(plaPreheatHotendTemp);
setTargetHotend1(plaPreheatHotendTemp); setTargetHotend1(plaPreheatHotendTemp);
setTargetHotend2(plaPreheatHotendTemp); setTargetHotend2(plaPreheatHotendTemp);
setTargetHotend3(plaPreheatHotendTemp); _lcd_preheat(3, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed);
setTargetBed(plaPreheatHPBTemp);
fanSpeed = plaPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
} }
void lcd_preheat_abs0123() {
void lcd_preheat_abs0123()
{
setTargetHotend0(absPreheatHotendTemp); setTargetHotend0(absPreheatHotendTemp);
setTargetHotend1(absPreheatHotendTemp); setTargetHotend1(absPreheatHotendTemp);
setTargetHotend2(absPreheatHotendTemp); setTargetHotend2(absPreheatHotendTemp);
setTargetHotend3(absPreheatHotendTemp); _lcd_preheat(3, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed);
setTargetBed(absPreheatHPBTemp);
fanSpeed = absPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
} }
#endif //more than one extruder present #endif //more than one extruder present
void lcd_preheat_pla_bedonly() void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, plaPreheatHPBTemp, plaPreheatFanSpeed); }
{ void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, absPreheatHPBTemp, absPreheatFanSpeed); }
setTargetBed(plaPreheatHPBTemp);
fanSpeed = plaPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
void lcd_preheat_abs_bedonly()
{
setTargetBed(absPreheatHPBTemp);
fanSpeed = absPreheatFanSpeed;
lcd_return_to_status();
setWatch(); // heater sanity check timer
}
static void lcd_preheat_pla_menu() static void lcd_preheat_pla_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu);
MENU_ITEM(function, MSG_PREHEAT_PLA_N "1", lcd_preheat_pla0); MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H1, lcd_preheat_pla0);
#if TEMP_SENSOR_1 != 0 //2 extruder preheat #if TEMP_SENSOR_1 != 0 //2 extruder preheat
MENU_ITEM(function, MSG_PREHEAT_PLA_N "2", lcd_preheat_pla1); MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H2, lcd_preheat_pla1);
#endif //2 extruder preheat #endif //2 extruder preheat
#if TEMP_SENSOR_2 != 0 //3 extruder preheat #if TEMP_SENSOR_2 != 0 //3 extruder preheat
MENU_ITEM(function, MSG_PREHEAT_PLA_N "3", lcd_preheat_pla2); MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H3, lcd_preheat_pla2);
#endif //3 extruder preheat #endif //3 extruder preheat
#if TEMP_SENSOR_3 != 0 //4 extruder preheat #if TEMP_SENSOR_3 != 0 //4 extruder preheat
MENU_ITEM(function, MSG_PREHEAT_PLA_N "4", lcd_preheat_pla3); MENU_ITEM(function, MSG_PREHEAT_PLA_N MSG_H4, lcd_preheat_pla3);
#endif //4 extruder preheat #endif //4 extruder preheat
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //all extruder preheat #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //all extruder preheat
MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123); MENU_ITEM(function, MSG_PREHEAT_PLA_ALL, lcd_preheat_pla0123);
@ -610,32 +552,29 @@ static void lcd_preheat_pla_menu()
END_MENU(); END_MENU();
} }
static void lcd_preheat_abs_menu() static void lcd_preheat_abs_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu);
MENU_ITEM(function, MSG_PREHEAT_ABS_N "1", lcd_preheat_abs0); MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H1, lcd_preheat_abs0);
#if TEMP_SENSOR_1 != 0 //2 extruder preheat #if TEMP_SENSOR_1 != 0 //2 extruder preheat
MENU_ITEM(function, MSG_PREHEAT_ABS_N "2", lcd_preheat_abs1); MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H2, lcd_preheat_abs1);
#endif //2 extruder preheat #endif //2 extruder preheat
#if TEMP_SENSOR_2 != 0 //3 extruder preheat #if TEMP_SENSOR_2 != 0 //3 extruder preheat
MENU_ITEM(function, MSG_PREHEAT_ABS_N "3", lcd_preheat_abs2); MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H3, lcd_preheat_abs2);
#endif //3 extruder preheat #endif //3 extruder preheat
#if TEMP_SENSOR_3 != 0 //4 extruder preheat #if TEMP_SENSOR_3 != 0 //4 extruder preheat
MENU_ITEM(function, MSG_PREHEAT_ABS_N "4", lcd_preheat_abs3); MENU_ITEM(function, MSG_PREHEAT_ABS_N MSG_H4, lcd_preheat_abs3);
#endif //4 extruder preheat #endif //4 extruder preheat
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //all extruder preheat #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 //all extruder preheat
MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123); MENU_ITEM(function, MSG_PREHEAT_ABS_ALL, lcd_preheat_abs0123);
#endif //all extruder preheat #endif //all extruder preheat
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly); MENU_ITEM(function, MSG_PREHEAT_ABS_BEDONLY, lcd_preheat_abs_bedonly);
#endif #endif
END_MENU(); END_MENU();
} }
void lcd_cooldown() void lcd_cooldown() {
{
setTargetHotend0(0); setTargetHotend0(0);
setTargetHotend1(0); setTargetHotend1(0);
setTargetHotend2(0); setTargetHotend2(0);
@ -645,8 +584,7 @@ void lcd_cooldown()
lcd_return_to_status(); lcd_return_to_status();
} }
static void lcd_prepare_menu() static void lcd_prepare_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
#ifdef SDSUPPORT #ifdef SDSUPPORT
@ -668,15 +606,16 @@ static void lcd_prepare_menu()
#endif #endif
#endif #endif
MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
#if PS_ON_PIN > -1 #if defined(POWER_SUPPLY) && POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN > -1
if (powersupply) if (powersupply) {
{
MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
}else{ }
else {
MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
} }
#endif #endif
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
END_MENU(); END_MENU();
} }
@ -719,10 +658,8 @@ static void lcd_move_x() { _lcd_move(PSTR("X"), X_AXIS, X_MIN_POS, X_MAX_POS); }
static void lcd_move_y() { _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); } static void lcd_move_y() { _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }
static void lcd_move_z() { _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); } static void lcd_move_z() { _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); }
static void lcd_move_e() static void lcd_move_e() {
{ if (encoderPosition != 0) {
if (encoderPosition != 0)
{
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
encoderPosition = 0; encoderPosition = 0;
#ifdef DELTA #ifdef DELTA
@ -733,45 +670,36 @@ static void lcd_move_e()
#endif #endif
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
{
lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
}
if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis);
} }
static void lcd_move_menu_axis() static void lcd_move_menu_axis() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu); MENU_ITEM(back, MSG_MOVE_AXIS, lcd_move_menu);
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x); MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y); MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y);
if (move_menu_scale < 10.0) if (move_menu_scale < 10.0) {
{
MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z); MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e); MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
} }
END_MENU(); END_MENU();
} }
static void lcd_move_menu_10mm() static void lcd_move_menu_10mm() {
{
move_menu_scale = 10.0; move_menu_scale = 10.0;
lcd_move_menu_axis(); lcd_move_menu_axis();
} }
static void lcd_move_menu_1mm() static void lcd_move_menu_1mm() {
{
move_menu_scale = 1.0; move_menu_scale = 1.0;
lcd_move_menu_axis(); lcd_move_menu_axis();
} }
static void lcd_move_menu_01mm() static void lcd_move_menu_01mm() {
{
move_menu_scale = 0.1; move_menu_scale = 0.1;
lcd_move_menu_axis(); lcd_move_menu_axis();
} }
static void lcd_move_menu() static void lcd_move_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu);
MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
@ -781,8 +709,7 @@ static void lcd_move_menu()
END_MENU(); END_MENU();
} }
static void lcd_control_menu() static void lcd_control_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
@ -804,27 +731,63 @@ static void lcd_control_menu()
END_MENU(); END_MENU();
} }
static void lcd_control_temperature_menu() #ifdef PIDTEMP
{
// Helpers for editing PID Ki & Kd values
// grab the PID value out of the temp variable; scale it; then update the PID driver
void copy_and_scalePID_i(int e) {
PID_PARAM(Ki, e) = scalePID_i(raw_Ki);
updatePID();
}
void copy_and_scalePID_d(int e) {
PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
updatePID();
}
void copy_and_scalePID_i_E1() { copy_and_scalePID_i(0); }
void copy_and_scalePID_d_E1() { copy_and_scalePID_d(0); }
#ifdef PID_PARAMS_PER_EXTRUDER
#if EXTRUDERS > 1
void copy_and_scalePID_i_E2() { copy_and_scalePID_i(1); }
void copy_and_scalePID_d_E2() { copy_and_scalePID_d(1); }
#if EXTRUDERS > 2
void copy_and_scalePID_i_E3() { copy_and_scalePID_i(2); }
void copy_and_scalePID_d_E3() { copy_and_scalePID_d(2); }
#if EXTRUDERS > 3
void copy_and_scalePID_i_E4() { copy_and_scalePID_i(3); }
void copy_and_scalePID_d_E4() { copy_and_scalePID_d(3); }
#endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1
#endif //PID_PARAMS_PER_EXTRUDER
#endif //PIDTEMP
static void lcd_control_temperature_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
#if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_0 != 0
MENU_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_1 != 0 && EXTRUDERS > 1 #if EXTRUDERS > 1
MENU_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15); #if TEMP_SENSOR_1 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N2, &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_2 != 0 && EXTRUDERS > 2 #if EXTRUDERS > 2
MENU_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15); #if TEMP_SENSOR_2 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N3, &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
#endif #endif
#if TEMP_SENSOR_3 != 0 && EXTRUDERS > 3 #if EXTRUDERS > 3
MENU_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15); #if TEMP_SENSOR_3 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE MSG_N4, &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
#endif #endif
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_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
MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0) #if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled); MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15); MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15); MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
@ -832,43 +795,54 @@ static void lcd_control_temperature_menu()
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
// set up temp variables - undo the default scaling // set up temp variables - undo the default scaling
pid_current_extruder = 0;
raw_Ki = unscalePID_i(PID_PARAM(Ki,0)); raw_Ki = unscalePID_i(PID_PARAM(Ki,0));
raw_Kd = unscalePID_d(PID_PARAM(Kd,0)); raw_Kd = unscalePID_d(PID_PARAM(Kd,0));
MENU_ITEM_EDIT(float52, MSG_PID_P, &PID_PARAM(Kp,0), 1, 9990); MENU_ITEM_EDIT(float52, MSG_PID_P, &PID_PARAM(Kp,0), 1, 9990);
// i is typically a small value so allows values below 1 // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E1);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d_E1);
#ifdef PID_ADD_EXTRUSION_RATE #ifdef PID_ADD_EXTRUSION_RATE
MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990); MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990);
#endif//PID_ADD_EXTRUSION_RATE #endif//PID_ADD_EXTRUSION_RATE
#ifdef PID_PARAMS_PER_EXTRUDER #ifdef PID_PARAMS_PER_EXTRUDER
#if EXTRUDERS > 1 #if EXTRUDERS > 1
// set up temp variables - undo the default scaling // set up temp variables - undo the default scaling
pid_current_extruder = 0;
raw_Ki = unscalePID_i(PID_PARAM(Ki,1)); raw_Ki = unscalePID_i(PID_PARAM(Ki,1));
raw_Kd = unscalePID_d(PID_PARAM(Kd,1)); raw_Kd = unscalePID_d(PID_PARAM(Kd,1));
MENU_ITEM_EDIT(float52, MSG_PID_P " E2", &PID_PARAM(Kp,1), 1, 9990); MENU_ITEM_EDIT(float52, MSG_PID_P MSG_E2, &PID_PARAM(Kp,1), 1, 9990);
// i is typically a small value so allows values below 1 // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E2", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E2, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E2);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E2", &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E2, &raw_Kd, 1, 9990, copy_and_scalePID_d_E2);
#ifdef PID_ADD_EXTRUSION_RATE #ifdef PID_ADD_EXTRUSION_RATE
MENU_ITEM_EDIT(float3, MSG_PID_C " E2", &PID_PARAM(Kc,1), 1, 9990); MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E2, &PID_PARAM(Kc,1), 1, 9990);
#endif//PID_ADD_EXTRUSION_RATE #endif//PID_ADD_EXTRUSION_RATE
#endif//EXTRUDERS > 1
#if EXTRUDERS > 2 #if EXTRUDERS > 2
// set up temp variables - undo the default scaling // set up temp variables - undo the default scaling
pid_current_extruder = 0;
raw_Ki = unscalePID_i(PID_PARAM(Ki,2)); raw_Ki = unscalePID_i(PID_PARAM(Ki,2));
raw_Kd = unscalePID_d(PID_PARAM(Kd,2)); raw_Kd = unscalePID_d(PID_PARAM(Kd,2));
MENU_ITEM_EDIT(float52, MSG_PID_P " E3", &PID_PARAM(Kp,2), 1, 9990); MENU_ITEM_EDIT(float52, MSG_PID_P MSG_E3, &PID_PARAM(Kp,2), 1, 9990);
// i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E3, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E3);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E3, &raw_Kd, 1, 9990, copy_and_scalePID_d_E3);
#ifdef PID_ADD_EXTRUSION_RATE
MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E3, &PID_PARAM(Kc,2), 1, 9990);
#endif//PID_ADD_EXTRUSION_RATE
#if EXTRUDERS > 3
// set up temp variables - undo the default scaling
raw_Ki = unscalePID_i(PID_PARAM(Ki,3));
raw_Kd = unscalePID_d(PID_PARAM(Kd,3));
MENU_ITEM_EDIT(float52, MSG_PID_P MSG_E4, &PID_PARAM(Kp,3), 1, 9990);
// i is typically a small value so allows values below 1 // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E3", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I MSG_E4, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E4);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E3", &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D MSG_E4, &raw_Kd, 1, 9990, copy_and_scalePID_d_E4);
#ifdef PID_ADD_EXTRUSION_RATE #ifdef PID_ADD_EXTRUSION_RATE
MENU_ITEM_EDIT(float3, MSG_PID_C " E3", &PID_PARAM(Kc,2), 1, 9990); MENU_ITEM_EDIT(float3, MSG_PID_C MSG_E4, &PID_PARAM(Kc,3), 1, 9990);
#endif//PID_ADD_EXTRUSION_RATE #endif//PID_ADD_EXTRUSION_RATE
#endif//EXTRUDERS > 3
#endif//EXTRUDERS > 2 #endif//EXTRUDERS > 2
#endif//EXTRUDERS > 1
#endif //PID_PARAMS_PER_EXTRUDER #endif //PID_PARAMS_PER_EXTRUDER
#endif//PIDTEMP #endif//PIDTEMP
MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
@ -876,8 +850,7 @@ static void lcd_control_temperature_menu()
END_MENU(); END_MENU();
} }
static void lcd_control_temperature_preheat_pla_settings_menu() static void lcd_control_temperature_preheat_pla_settings_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu); MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255); MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &plaPreheatFanSpeed, 0, 255);
@ -893,8 +866,7 @@ static void lcd_control_temperature_preheat_pla_settings_menu()
END_MENU(); END_MENU();
} }
static void lcd_control_temperature_preheat_abs_settings_menu() static void lcd_control_temperature_preheat_abs_settings_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu); MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255); MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &absPreheatFanSpeed, 0, 255);
@ -910,8 +882,7 @@ static void lcd_control_temperature_preheat_abs_settings_menu()
END_MENU(); END_MENU();
} }
static void lcd_control_motion_menu() static void lcd_control_motion_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
@ -946,21 +917,20 @@ static void lcd_control_motion_menu()
END_MENU(); END_MENU();
} }
static void lcd_control_volumetric_menu() static void lcd_control_volumetric_menu() {
{
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers); MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
if (volumetric_enabled) { if (volumetric_enabled) {
MENU_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_0, &filament_size[0], DEFAULT_NOMINAL_FILAMENT_DIA - .5, DEFAULT_NOMINAL_FILAMENT_DIA + .5, calculate_volumetric_multipliers); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_0, &filament_size[0], 1.5, 3.25, calculate_volumetric_multipliers);
#if EXTRUDERS > 1 #if EXTRUDERS > 1
MENU_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_1, &filament_size[1], DEFAULT_NOMINAL_FILAMENT_DIA - .5, DEFAULT_NOMINAL_FILAMENT_DIA + .5, calculate_volumetric_multipliers); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_1, &filament_size[1], 1.5, 3.25, calculate_volumetric_multipliers);
#if EXTRUDERS > 2 #if EXTRUDERS > 2
MENU_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_2, &filament_size[2], DEFAULT_NOMINAL_FILAMENT_DIA - .5, DEFAULT_NOMINAL_FILAMENT_DIA + .5, calculate_volumetric_multipliers); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_2, &filament_size[2], 1.5, 3.25, calculate_volumetric_multipliers);
#if EXTRUDERS > 3 #if EXTRUDERS > 3
MENU_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_3, &filament_size[3], DEFAULT_NOMINAL_FILAMENT_DIA - .5, DEFAULT_NOMINAL_FILAMENT_DIA + .5, calculate_volumetric_multipliers); MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_SIZE_EXTRUDER_3, &filament_size[3], 1.5, 3.25, calculate_volumetric_multipliers);
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
@ -968,11 +938,11 @@ static void lcd_control_volumetric_menu()
END_MENU(); END_MENU();
} }
#ifdef DOGLCD #ifdef DOGLCD
static void lcd_set_contrast()
{ static void lcd_set_contrast() {
if (encoderPosition != 0) if (encoderPosition != 0) {
{
lcd_contrast -= encoderPosition; lcd_contrast -= encoderPosition;
if (lcd_contrast < 0) lcd_contrast = 0; if (lcd_contrast < 0) lcd_contrast = 0;
else if (lcd_contrast > 63) lcd_contrast = 63; else if (lcd_contrast > 63) lcd_contrast = 63;
@ -980,17 +950,15 @@ static void lcd_set_contrast()
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
} }
if (lcdDrawUpdate) if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
{
lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
}
if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu); if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
} }
#endif
#endif //DOGLCD
#ifdef FWRETRACT #ifdef FWRETRACT
static void lcd_control_retract_menu()
{ static void lcd_control_retract_menu() {
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled); MENU_ITEM_EDIT(bool, MSG_AUTORETRACT, &autoretract_enabled);
@ -1007,54 +975,49 @@ static void lcd_control_retract_menu()
MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999); MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &retract_recover_feedrate, 1, 999);
END_MENU(); END_MENU();
} }
#endif //FWRETRACT #endif //FWRETRACT
#if SDCARDDETECT == -1 #if SDCARDDETECT == -1
static void lcd_sd_refresh() static void lcd_sd_refresh() {
{
card.initsd(); card.initsd();
currentMenuViewOffset = 0; currentMenuViewOffset = 0;
} }
#endif #endif
static void lcd_sd_updir()
{ static void lcd_sd_updir() {
card.updir(); card.updir();
currentMenuViewOffset = 0; currentMenuViewOffset = 0;
} }
void lcd_sdcard_menu() 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(); uint16_t fileCnt = card.getnrfilenames();
START_MENU(); START_MENU();
MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
card.getWorkDirName(); card.getWorkDirName();
if(card.filename[0]=='/') if (card.filename[0] == '/') {
{
#if SDCARDDETECT == -1 #if SDCARDDETECT == -1
MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
#endif #endif
}else{ }
else {
MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
} }
for(uint16_t i=0;i<fileCnt;i++) for(uint16_t i = 0; i < fileCnt; i++) {
{ if (_menuItemNr == _lineNr) {
if (_menuItemNr == _lineNr)
{
#ifndef SDCARD_RATHERRECENTFIRST #ifndef SDCARD_RATHERRECENTFIRST
card.getfilename(i); card.getfilename(i);
#else #else
card.getfilename(fileCnt-1-i); card.getfilename(fileCnt-1-i);
#endif #endif
if (card.filenameIsDir) if (card.filenameIsDir)
{
MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
}else{ else
MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename); MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
} }
}else{ else {
MENU_ITEM_DUMMY(); MENU_ITEM_DUMMY();
} }
} }
@ -1062,24 +1025,21 @@ void lcd_sdcard_menu()
} }
#define menu_edit_type(_type, _name, _strFunc, scale) \ #define menu_edit_type(_type, _name, _strFunc, scale) \
void menu_edit_ ## _name () \ bool _menu_edit_ ## _name () { \
{ \ bool isClicked = LCD_CLICKED; \
if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
if (lcdDrawUpdate) \ if (lcdDrawUpdate) \
lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \ lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
if (LCD_CLICKED) \ if (isClicked) { \
{ \
*((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \ *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
lcd_goto_menu(prevMenu, prevEncoderPosition); \ lcd_goto_menu(prevMenu, prevEncoderPosition); \
} \ } \
return isClicked; \
} \ } \
void menu_edit_callback_ ## _name () { \ void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \
menu_edit_ ## _name (); \ void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \
if (LCD_CLICKED) (*callbackFunc)(); \ static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
} \
static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) \
{ \
prevMenu = currentMenu; \ prevMenu = currentMenu; \
prevEncoderPosition = encoderPosition; \ prevEncoderPosition = encoderPosition; \
\ \
@ -1092,19 +1052,13 @@ void lcd_sdcard_menu()
maxEditValue = maxValue * scale - minEditValue; \ maxEditValue = maxValue * scale - minEditValue; \
encoderPosition = (*ptr) * scale - minEditValue; \ encoderPosition = (*ptr) * scale - minEditValue; \
} \ } \
static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, menuFunc_t callback) \ static void menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
{ \ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
prevMenu = currentMenu; \ currentMenu = menu_edit_ ## _name; \
prevEncoderPosition = encoderPosition; \ }\
\ static void menu_action_setting_edit_callback_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue, menuFunc_t callback) { \
lcdDrawUpdate = 2; \ _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
currentMenu = menu_edit_callback_ ## _name; \ currentMenu = menu_edit_callback_ ## _name; \
\
editLabel = pstr; \
editValue = ptr; \
minEditValue = minValue * scale; \
maxEditValue = maxValue * scale - minEditValue; \
encoderPosition = (*ptr) * scale - minEditValue; \
callbackFunc = callback; \ callbackFunc = callback; \
} }
menu_edit_type(int, int3, itostr3, 1) menu_edit_type(int, int3, itostr3, 1)
@ -1148,14 +1102,13 @@ menu_edit_type(unsigned long, long5, ftostr5, 0.01)
lcd_move_y(); lcd_move_y();
} }
static void reprapworld_keypad_move_home() { static void reprapworld_keypad_move_home() {
enquecommand_P((PSTR("G28"))); // move all axis home enquecommands_P((PSTR("G28"))); // move all axis home
} }
#endif #endif //REPRAPWORLD_KEYPAD
/** End of menus **/ /** End of menus **/
static void lcd_quick_feedback() static void lcd_quick_feedback() {
{
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
blocking_enc = millis() + 500; blocking_enc = millis() + 500;
lcd_implementation_quick_feedback(); lcd_implementation_quick_feedback();
@ -1164,41 +1117,35 @@ static void lcd_quick_feedback()
/** Menu action functions **/ /** Menu action functions **/
static void menu_action_back(menuFunc_t data) { lcd_goto_menu(data); } static void menu_action_back(menuFunc_t data) { lcd_goto_menu(data); }
static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); } static void menu_action_submenu(menuFunc_t data) { lcd_goto_menu(data); }
static void menu_action_gcode(const char* pgcode) { enquecommand_P(pgcode); } static void menu_action_gcode(const char* pgcode) { enquecommands_P(pgcode); }
static void menu_action_function(menuFunc_t data) { (*data)(); } static void menu_action_function(menuFunc_t data) { (*data)(); }
static void menu_action_sdfile(const char* filename, char* longFilename) static void menu_action_sdfile(const char* filename, char* longFilename) {
{
char cmd[30]; char cmd[30];
char* c; char* c;
sprintf_P(cmd, PSTR("M23 %s"), filename); sprintf_P(cmd, PSTR("M23 %s"), filename);
for(c = &cmd[4]; *c; c++) for(c = &cmd[4]; *c; c++) *c = tolower(*c);
*c = tolower(*c);
enquecommand(cmd); enquecommand(cmd);
enquecommand_P(PSTR("M24")); enquecommands_P(PSTR("M24"));
lcd_return_to_status(); lcd_return_to_status();
} }
static void menu_action_sddirectory(const char* filename, char* longFilename) static void menu_action_sddirectory(const char* filename, char* longFilename) {
{
card.chdir(filename); card.chdir(filename);
encoderPosition = 0; encoderPosition = 0;
} }
static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) static void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { *ptr = !(*ptr); }
{ static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback) {
*ptr = !(*ptr);
}
static void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, menuFunc_t callback)
{
menu_action_setting_edit_bool(pstr, ptr); menu_action_setting_edit_bool(pstr, ptr);
(*callback)(); (*callback)();
} }
#endif //ULTIPANEL #endif //ULTIPANEL
/** LCD API **/ /** LCD API **/
void lcd_init() void lcd_init() {
{
lcd_implementation_init(); lcd_implementation_init();
#ifdef NEWPANEL #ifdef NEWPANEL
SET_INPUT(BTN_EN1); SET_INPUT(BTN_EN1);
SET_INPUT(BTN_EN2); SET_INPUT(BTN_EN2);
WRITE(BTN_EN1,HIGH); WRITE(BTN_EN1,HIGH);
@ -1238,17 +1185,37 @@ void lcd_init()
WRITE(SDCARDDETECT, HIGH); WRITE(SDCARDDETECT, HIGH);
lcd_oldcardstatus = IS_SD_INSERTED; lcd_oldcardstatus = IS_SD_INSERTED;
#endif //(SDCARDDETECT > 0) #endif //(SDCARDDETECT > 0)
#ifdef LCD_HAS_SLOW_BUTTONS #ifdef LCD_HAS_SLOW_BUTTONS
slow_buttons = 0; slow_buttons = 0;
#endif #endif
lcd_buttons_update(); lcd_buttons_update();
#ifdef ULTIPANEL #ifdef ULTIPANEL
encoderDiff = 0; encoderDiff = 0;
#endif #endif
} }
void lcd_update() int lcd_strlen(char *s) {
{ int i = 0, j = 0;
while (s[i]) {
if ((s[i] & 0xc0) != 0x80) j++;
i++;
}
return j;
}
int lcd_strlen_P(const char *s) {
int j = 0;
while (pgm_read_byte(s)) {
if ((pgm_read_byte(s) & 0xc0) != 0x80) j++;
s++;
}
return j;
}
void lcd_update() {
static unsigned long timeoutToStatus = 0; static unsigned long timeoutToStatus = 0;
#ifdef LCD_HAS_SLOW_BUTTONS #ifdef LCD_HAS_SLOW_BUTTONS
@ -1258,8 +1225,7 @@ void lcd_update()
lcd_buttons_update(); lcd_buttons_update();
#if (SDCARDDETECT > 0) #if (SDCARDDETECT > 0)
if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected())) if (IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()) {
{
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
lcd_oldcardstatus = IS_SD_INSERTED; lcd_oldcardstatus = IS_SD_INSERTED;
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
@ -1268,61 +1234,80 @@ void lcd_update()
#endif #endif
); );
if(lcd_oldcardstatus) if (lcd_oldcardstatus) {
{
card.initsd(); card.initsd();
LCD_MESSAGEPGM(MSG_SD_INSERTED); LCD_MESSAGEPGM(MSG_SD_INSERTED);
} }
else else {
{
card.release(); card.release();
LCD_MESSAGEPGM(MSG_SD_REMOVED); LCD_MESSAGEPGM(MSG_SD_REMOVED);
} }
} }
#endif//CARDINSERTED #endif//CARDINSERTED
if (lcd_next_update_millis < millis()) long ms = millis();
{ if (ms > lcd_next_update_millis) {
#ifdef ULTIPANEL #ifdef ULTIPANEL
#ifdef REPRAPWORLD_KEYPAD #ifdef REPRAPWORLD_KEYPAD
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) { if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
reprapworld_keypad_move_z_up(); if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down();
} if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left();
if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) { if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right();
reprapworld_keypad_move_z_down(); if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down();
} if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up();
if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) { if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home();
reprapworld_keypad_move_x_left(); #endif
}
if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) { bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
reprapworld_keypad_move_x_right(); if (encoderPastThreshold || LCD_CLICKED) {
} if (encoderPastThreshold) {
if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) { int32_t encoderMultiplier = 1;
reprapworld_keypad_move_y_down();
} #ifdef ENCODER_RATE_MULTIPLIER
if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
reprapworld_keypad_move_y_up(); if (encoderRateMultiplierEnabled) {
int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
if (lastEncoderMovementMillis != 0) {
// Note that the rate is always calculated between to passes through the
// loop and that the abs of the encoderDiff value is tracked.
float encoderStepRate = (float)(encoderMovementSteps) / ((float)(ms - lastEncoderMovementMillis)) * 1000.0;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
#ifdef ENCODER_RATE_MULTIPLIER_DEBUG
SERIAL_ECHO_START;
SERIAL_ECHO("Enc Step Rate: ");
SERIAL_ECHO(encoderStepRate);
SERIAL_ECHO(" Multiplier: ");
SERIAL_ECHO(encoderMultiplier);
SERIAL_ECHO(" ENCODER_10X_STEPS_PER_SEC: ");
SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC);
SERIAL_ECHO(" ENCODER_100X_STEPS_PER_SEC: ");
SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC);
#endif //ENCODER_RATE_MULTIPLIER_DEBUG
} }
if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
reprapworld_keypad_move_home(); lastEncoderMovementMillis = ms;
} }
#endif #endif //ENCODER_RATE_MULTIPLIER
if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP)
{
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP; encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
encoderDiff = 0; encoderDiff = 0;
timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
} }
if (LCD_CLICKED) timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; }
#endif //ULTIPANEL #endif //ULTIPANEL
#ifdef DOGLCD // Changes due to different driver architecture of the DOGM display #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display
blink++; // Variable for fan animation and alive dot blink++; // Variable for fan animation and alive dot
u8g.firstPage(); u8g.firstPage();
do do {
{
u8g.setFont(FONT_MENU); u8g.setFont(FONT_MENU);
u8g.setPrintPos(125, 0); u8g.setPrintPos(125, 0);
if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
@ -1340,26 +1325,25 @@ void lcd_update()
#endif #endif
#ifdef ULTIPANEL #ifdef ULTIPANEL
if(timeoutToStatus < millis() && currentMenu != lcd_status_screen) if (currentMenu != lcd_status_screen && millis() > timeoutToStatus) {
{
lcd_return_to_status(); lcd_return_to_status();
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
} }
#endif //ULTIPANEL #endif //ULTIPANEL
if (lcdDrawUpdate == 2) lcd_implementation_clear(); if (lcdDrawUpdate == 2) lcd_implementation_clear();
if (lcdDrawUpdate) lcdDrawUpdate--; if (lcdDrawUpdate) lcdDrawUpdate--;
lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL; lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL;
} }
} }
void lcd_ignore_click(bool b) void lcd_ignore_click(bool b) {
{
ignore_click = b; ignore_click = b;
wait_for_unclick = false; wait_for_unclick = false;
} }
void lcd_finishstatus() { void lcd_finishstatus() {
int len = strlen(lcd_status_message); int len = lcd_strlen(lcd_status_message);
if (len > 0) { if (len > 0) {
while (len < LCD_WIDTH) { while (len < LCD_WIDTH) {
lcd_status_message[len++] = ' '; lcd_status_message[len++] = ' ';
@ -1378,52 +1362,57 @@ void lcd_finishstatus() {
message_millis = millis(); //get status message to show up for a while message_millis = millis(); //get status message to show up for a while
#endif #endif
} }
void lcd_setstatus(const char* message)
{ void lcd_setstatus(const char* message) {
if (lcd_status_message_level > 0) if (lcd_status_message_level > 0) return;
return;
strncpy(lcd_status_message, message, LCD_WIDTH); strncpy(lcd_status_message, message, LCD_WIDTH);
lcd_finishstatus(); lcd_finishstatus();
} }
void lcd_setstatuspgm(const char* message)
{ void lcd_setstatuspgm(const char* message) {
if (lcd_status_message_level > 0) if (lcd_status_message_level > 0) return;
return;
strncpy_P(lcd_status_message, message, LCD_WIDTH); strncpy_P(lcd_status_message, message, LCD_WIDTH);
lcd_finishstatus(); lcd_finishstatus();
} }
void lcd_setalertstatuspgm(const char* message)
{ void lcd_setalertstatuspgm(const char* message) {
lcd_setstatuspgm(message); lcd_setstatuspgm(message);
lcd_status_message_level = 1; lcd_status_message_level = 1;
#ifdef ULTIPANEL #ifdef ULTIPANEL
lcd_return_to_status(); lcd_return_to_status();
#endif//ULTIPANEL #endif
}
void lcd_reset_alert_level()
{
lcd_status_message_level = 0;
} }
void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#ifdef DOGLCD #ifdef DOGLCD
void lcd_setcontrast(uint8_t value) void lcd_setcontrast(uint8_t value) {
{
lcd_contrast = value & 63; lcd_contrast = value & 63;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
} }
#endif #endif
#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
uint8_t newbutton = 0; uint8_t newbutton = 0;
if (READ(BTN_EN1) == 0) newbutton |= EN_A; if (READ(BTN_EN1) == 0) newbutton |= EN_A;
if (READ(BTN_EN2) == 0) newbutton |= EN_B; if (READ(BTN_EN2) == 0) newbutton |= EN_B;
#if BTN_ENC > 0 #if BTN_ENC > 0
if((blocking_enc<millis()) && (READ(BTN_ENC)==0)) if (millis() > blocking_enc && READ(BTN_ENC) == 0) newbutton |= EN_C;
newbutton |= EN_C;
#endif #endif
buttons = newbutton; buttons = newbutton;
#ifdef LCD_HAS_SLOW_BUTTONS #ifdef LCD_HAS_SLOW_BUTTONS
@ -1435,9 +1424,8 @@ void lcd_buttons_update()
WRITE(SHIFT_LD, LOW); WRITE(SHIFT_LD, LOW);
WRITE(SHIFT_LD, HIGH); WRITE(SHIFT_LD, HIGH);
for(int8_t i = 0; i < 8; i++) { for(int8_t i = 0; i < 8; i++) {
newbutton_reprapworld_keypad = newbutton_reprapworld_keypad>>1; newbutton_reprapworld_keypad >>= 1;
if(READ(SHIFT_OUT)) if (READ(SHIFT_OUT)) newbutton_reprapworld_keypad |= (1 << 7);
newbutton_reprapworld_keypad|=(1<<7);
WRITE(SHIFT_CLK, HIGH); WRITE(SHIFT_CLK, HIGH);
WRITE(SHIFT_CLK, LOW); WRITE(SHIFT_CLK, LOW);
} }
@ -1448,11 +1436,9 @@ void lcd_buttons_update()
WRITE(SHIFT_LD, LOW); WRITE(SHIFT_LD, LOW);
WRITE(SHIFT_LD, HIGH); WRITE(SHIFT_LD, HIGH);
unsigned char tmp_buttons = 0; unsigned char tmp_buttons = 0;
for(int8_t i=0;i<8;i++) for(int8_t i=0; i<8; i++) {
{ newbutton >>= 1;
newbutton = newbutton>>1; if (READ(SHIFT_OUT)) newbutton |= (1 << 7);
if(READ(SHIFT_OUT))
newbutton|=(1<<7);
WRITE(SHIFT_CLK, HIGH); WRITE(SHIFT_CLK, HIGH);
WRITE(SHIFT_CLK, LOW); WRITE(SHIFT_CLK, LOW);
} }
@ -1463,41 +1449,30 @@ void lcd_buttons_update()
uint8_t enc=0; uint8_t enc=0;
if (buttons & EN_A) enc |= B01; if (buttons & EN_A) enc |= B01;
if (buttons & EN_B) enc |= B10; if (buttons & EN_B) enc |= B10;
if(enc != lastEncoderBits) if (enc != lastEncoderBits) {
{ switch(enc) {
switch(enc)
{
case encrot0: case encrot0:
if(lastEncoderBits==encrot3) if (lastEncoderBits==encrot3) encoderDiff++;
encoderDiff++; else if (lastEncoderBits==encrot1) encoderDiff--;
else if(lastEncoderBits==encrot1)
encoderDiff--;
break; break;
case encrot1: case encrot1:
if(lastEncoderBits==encrot0) if (lastEncoderBits==encrot0) encoderDiff++;
encoderDiff++; else if (lastEncoderBits==encrot2) encoderDiff--;
else if(lastEncoderBits==encrot2)
encoderDiff--;
break; break;
case encrot2: case encrot2:
if(lastEncoderBits==encrot1) if (lastEncoderBits==encrot1) encoderDiff++;
encoderDiff++; else if (lastEncoderBits==encrot3) encoderDiff--;
else if(lastEncoderBits==encrot3)
encoderDiff--;
break; break;
case encrot3: case encrot3:
if(lastEncoderBits==encrot2) if (lastEncoderBits==encrot2) encoderDiff++;
encoderDiff++; else if (lastEncoderBits==encrot0) encoderDiff--;
else if(lastEncoderBits==encrot0)
encoderDiff--;
break; break;
} }
} }
lastEncoderBits = enc; lastEncoderBits = enc;
} }
bool lcd_detected(void) bool lcd_detected(void) {
{
#if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE) #if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE)
return lcd.LcdDetected() == 1; return lcd.LcdDetected() == 1;
#else #else
@ -1505,17 +1480,14 @@ bool lcd_detected(void)
#endif #endif
} }
void lcd_buzz(long duration, uint16_t freq) void lcd_buzz(long duration, uint16_t freq) {
{
#ifdef LCD_USE_I2C_BUZZER #ifdef LCD_USE_I2C_BUZZER
lcd.buzz(duration,freq); lcd.buzz(duration,freq);
#endif #endif
} }
bool lcd_clicked() bool lcd_clicked() { return LCD_CLICKED; }
{
return LCD_CLICKED;
}
#endif //ULTIPANEL #endif //ULTIPANEL
/********************************/ /********************************/
@ -1772,24 +1744,4 @@ char *ftostr52(const float &x)
return conv; return conv;
} }
// Callback for after editing PID i value
// grab the PID i value out of the temp variable; scale it; then update the PID driver
void copy_and_scalePID_i()
{
#ifdef PIDTEMP
PID_PARAM(Ki, pid_current_extruder) = scalePID_i(raw_Ki);
updatePID();
#endif
}
// Callback for after editing PID d value
// grab the PID d value out of the temp variable; scale it; then update the PID driver
void copy_and_scalePID_d()
{
#ifdef PIDTEMP
PID_PARAM(Kd, pid_current_extruder) = scalePID_d(raw_Kd);
updatePID();
#endif
}
#endif //ULTRA_LCD #endif //ULTRA_LCD

@ -4,7 +4,8 @@
#include "Marlin.h" #include "Marlin.h"
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
int lcd_strlen(char *s);
int lcd_strlen_P(const char *s);
void lcd_update(); void lcd_update();
void lcd_init(); void lcd_init();
void lcd_setstatus(const char* message); void lcd_setstatus(const char* message);

@ -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
//////////////////////////////////// ////////////////////////////////////
@ -636,7 +625,7 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
{ {
lcd.print(c); lcd.print(c);
pstr++; pstr++;
n--; if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
} }
while(n--) while(n--)
lcd.print(' '); lcd.print(' ');
@ -648,9 +637,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const
char c; char c;
//Use all characters in narrow LCDs //Use all characters in narrow LCDs
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
uint8_t n = LCD_WIDTH - 1 - 1 - strlen(data); uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen(data);
#else #else
uint8_t n = LCD_WIDTH - 1 - 2 - strlen(data); uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen(data);
#endif #endif
lcd.setCursor(0, row); lcd.setCursor(0, row);
lcd.print(pre_char); lcd.print(pre_char);
@ -658,7 +647,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic(uint8_t row, const
{ {
lcd.print(c); lcd.print(c);
pstr++; pstr++;
n--; if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
} }
lcd.print(':'); lcd.print(':');
while(n--) while(n--)
@ -670,9 +659,9 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons
char c; char c;
//Use all characters in narrow LCDs //Use all characters in narrow LCDs
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
uint8_t n = LCD_WIDTH - 1 - 1 - strlen_P(data); uint8_t n = LCD_WIDTH - 1 - 1 - lcd_strlen_P(data);
#else #else
uint8_t n = LCD_WIDTH - 1 - 2 - strlen_P(data); uint8_t n = LCD_WIDTH - 1 - 2 - lcd_strlen_P(data);
#endif #endif
lcd.setCursor(0, row); lcd.setCursor(0, row);
lcd.print(pre_char); lcd.print(pre_char);
@ -680,7 +669,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(uint8_t row, cons
{ {
lcd.print(c); lcd.print(c);
pstr++; pstr++;
n--; if ((pgm_read_byte(pstr) & 0xc0) != 0x80) n--;
} }
lcd.print(':'); lcd.print(':');
while(n--) while(n--)
@ -733,9 +722,9 @@ void lcd_implementation_drawedit(const char* pstr, char* value)
lcd_printPGM(pstr); lcd_printPGM(pstr);
lcd.print(':'); lcd.print(':');
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
lcd.setCursor(LCD_WIDTH - strlen(value), 1); lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
#else #else
lcd.setCursor(LCD_WIDTH -1 - strlen(value), 1); lcd.setCursor(LCD_WIDTH -1 - lcd_strlen(value), 1);
#endif #endif
lcd.print(value); lcd.print(value);
} }
@ -833,31 +822,27 @@ static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* pst
static void lcd_implementation_quick_feedback() static void lcd_implementation_quick_feedback()
{ {
#ifdef LCD_USE_I2C_BUZZER #ifdef LCD_USE_I2C_BUZZER
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) #if defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) && defined(LCD_FEEDBACK_FREQUENCY_HZ)
lcd_buzz(1000/6,100);
#else
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#else
lcd_buzz(1000/6, 100);
#endif #endif
#elif defined(BEEPER) && BEEPER > -1 #elif defined(BEEPER) && BEEPER > -1
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS) #if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
for(int8_t i=0;i<10;i++) const unsigned int delay = 100;
{ uint8_t i = 10;
WRITE(BEEPER,HIGH);
delayMicroseconds(100);
WRITE(BEEPER,LOW);
delayMicroseconds(100);
}
#else #else
for(int8_t i=0;i<(LCD_FEEDBACK_FREQUENCY_DURATION_MS / (1000 / LCD_FEEDBACK_FREQUENCY_HZ));i++) const unsigned int delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2;
{ int8_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000;
#endif
while (i--) {
WRITE(BEEPER,HIGH); WRITE(BEEPER,HIGH);
delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2); delayMicroseconds(delay);
WRITE(BEEPER,LOW); WRITE(BEEPER,LOW);
delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2); delayMicroseconds(delay);
} }
#endif #endif
#endif
} }
#ifdef LCD_HAS_STATUS_INDICATORS #ifdef LCD_HAS_STATUS_INDICATORS

@ -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

Loading…
Cancel
Save