Commit 2359a28b authored by MagoKimbra's avatar MagoKimbra

Same fix

parent aedb4d4e
......@@ -145,13 +145,13 @@ void Config_PrintSettings()
SERIAL_ECHOPAIR(" M92 X",axis_steps_per_unit[X_AXIS]);
SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[Y_AXIS]);
SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[Z_AXIS]);
SERIAL_ECHOPAIR(" E0 ",axis_steps_per_unit[E_AXIS + 0]);
SERIAL_ECHOPAIR(" E0 S",axis_steps_per_unit[E_AXIS + 0]);
#if EXTRUDERS > 1
SERIAL_ECHOPAIR(" E1 ",axis_steps_per_unit[E_AXIS + 1]);
SERIAL_ECHOPAIR(" E1 S",axis_steps_per_unit[E_AXIS + 1]);
#if EXTRUDERS > 2
SERIAL_ECHOPAIR(" E2 ",axis_steps_per_unit[E_AXIS + 2]);
SERIAL_ECHOPAIR(" E2 S",axis_steps_per_unit[E_AXIS + 2]);
#if EXTRUDERS > 3
SERIAL_ECHOPAIR(" E3 ",axis_steps_per_unit[E_AXIS + 3]);
SERIAL_ECHOPAIR(" E3 S",axis_steps_per_unit[E_AXIS + 3]);
#endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1
......
......@@ -32,8 +32,7 @@
ring_buffer rx_buffer = { { 0 }, 0, 0 };
#endif
FORCE_INLINE void store_char(unsigned char c)
{
FORCE_INLINE void store_char(unsigned char c) {
int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE;
// if we should be storing the received character into the location
......@@ -51,8 +50,7 @@ FORCE_INLINE void store_char(unsigned char c)
#if defined(M_USARTx_RX_vect)
// fixed by Mark Sproul this is on the 644/644p
//SIGNAL(SIG_USART_RECV)
SIGNAL(M_USARTx_RX_vect)
{
SIGNAL(M_USARTx_RX_vect) {
unsigned char c = M_UDRx;
store_char(c);
}
......@@ -60,26 +58,22 @@ FORCE_INLINE void store_char(unsigned char c)
// Constructors ////////////////////////////////////////////////////////////////
MarlinSerial::MarlinSerial()
{
}
MarlinSerial::MarlinSerial() { }
// Public Methods //////////////////////////////////////////////////////////////
void MarlinSerial::begin(long baud)
{
void MarlinSerial::begin(long baud) {
uint16_t baud_setting;
bool useU2X = true;
#if F_CPU == 16000000UL && SERIAL_PORT == 0
// hard-coded exception for compatibility with the bootloader shipped
// with the Duemilanove and previous boards and the firmware on the 8U2
// on the Uno and Mega 2560.
if (baud == 57600) {
useU2X = false;
}
#endif
#if F_CPU == 16000000UL && SERIAL_PORT == 0
// hard-coded exception for compatibility with the bootloader shipped
// with the Duemilanove and previous boards and the firmware on the 8U2
// on the Uno and Mega 2560.
if (baud == 57600) {
useU2X = false;
}
#endif
if (useU2X) {
M_UCSRxA = 1 << M_U2Xx;
......@@ -98,17 +92,14 @@ void MarlinSerial::begin(long baud)
sbi(M_UCSRxB, M_RXCIEx);
}
void MarlinSerial::end()
{
void MarlinSerial::end() {
cbi(M_UCSRxB, M_RXENx);
cbi(M_UCSRxB, M_TXENx);
cbi(M_UCSRxB, M_RXCIEx);
}
int MarlinSerial::peek(void)
{
int MarlinSerial::peek(void) {
if (rx_buffer.head == rx_buffer.tail) {
return -1;
} else {
......@@ -116,20 +107,19 @@ int MarlinSerial::peek(void)
}
}
int MarlinSerial::read(void)
{
int MarlinSerial::read(void) {
// if the head isn't ahead of the tail, we don't have any characters
if (rx_buffer.head == rx_buffer.tail) {
return -1;
} else {
}
else {
unsigned char c = rx_buffer.buffer[rx_buffer.tail];
rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE;
return c;
}
}
void MarlinSerial::flush()
{
void MarlinSerial::flush() {
// don't reverse this or there may be problems if the RX interrupt
// occurs after reading the value of rx_buffer_head but before writing
// the value to rx_buffer_tail; the previous value of rx_buffer_head
......@@ -143,38 +133,30 @@ void MarlinSerial::flush()
}
/// imports from print.h
void MarlinSerial::print(char c, int base)
{
void MarlinSerial::print(char c, int base) {
print((long) c, base);
}
void MarlinSerial::print(unsigned char b, int base)
{
void MarlinSerial::print(unsigned char b, int base) {
print((unsigned long) b, base);
}
void MarlinSerial::print(int n, int base)
{
void MarlinSerial::print(int n, int base) {
print((long) n, base);
}
void MarlinSerial::print(unsigned int n, int base)
{
void MarlinSerial::print(unsigned int n, int base) {
print((unsigned long) n, base);
}
void MarlinSerial::print(long n, int base)
{
void MarlinSerial::print(long n, int base) {
if (base == 0) {
write(n);
} else if (base == 10) {
}
else if (base == 10) {
if (n < 0) {
print('-');
n = -n;
......@@ -185,81 +167,68 @@ void MarlinSerial::print(long n, int base)
}
}
void MarlinSerial::print(unsigned long n, int base)
{
void MarlinSerial::print(unsigned long n, int base) {
if (base == 0) write(n);
else printNumber(n, base);
}
void MarlinSerial::print(double n, int digits)
{
void MarlinSerial::print(double n, int digits) {
printFloat(n, digits);
}
void MarlinSerial::println(void)
{
void MarlinSerial::println(void) {
print('\r');
print('\n');
}
void MarlinSerial::println(const String &s)
{
void MarlinSerial::println(const String &s) {
print(s);
println();
}
void MarlinSerial::println(const char c[])
{
void MarlinSerial::println(const char c[]) {
print(c);
println();
}
void MarlinSerial::println(char c, int base)
{
void MarlinSerial::println(char c, int base) {
print(c, base);
println();
}
void MarlinSerial::println(unsigned char b, int base)
{
void MarlinSerial::println(unsigned char b, int base) {
print(b, base);
println();
}
void MarlinSerial::println(int n, int base)
{
void MarlinSerial::println(int n, int base) {
print(n, base);
println();
}
void MarlinSerial::println(unsigned int n, int base)
{
void MarlinSerial::println(unsigned int n, int base) {
print(n, base);
println();
}
void MarlinSerial::println(long n, int base)
{
void MarlinSerial::println(long n, int base) {
print(n, base);
println();
}
void MarlinSerial::println(unsigned long n, int base)
{
void MarlinSerial::println(unsigned long n, int base) {
print(n, base);
println();
}
void MarlinSerial::println(double n, int digits)
{
void MarlinSerial::println(double n, int digits) {
print(n, digits);
println();
}
// Private Methods /////////////////////////////////////////////////////////////
void MarlinSerial::printNumber(unsigned long n, uint8_t base)
{
void MarlinSerial::printNumber(unsigned long n, uint8_t base) {
unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars.
unsigned long i = 0;
......@@ -279,18 +248,16 @@ void MarlinSerial::printNumber(unsigned long n, uint8_t base)
'A' + buf[i - 1] - 10));
}
void MarlinSerial::printFloat(double number, uint8_t digits)
{
void MarlinSerial::printFloat(double number, uint8_t digits) {
// Handle negative numbers
if (number < 0.0)
{
if (number < 0.0) {
print('-');
number = -number;
}
// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
for (uint8_t i=0; i<digits; ++i)
for (uint8_t i = 0; i < digits; ++i)
rounding /= 10.0;
number += rounding;
......@@ -305,8 +272,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits)
print(".");
// Extract digits from the remainder one at a time
while (digits-- > 0)
{
while (digits-- > 0) {
remainder *= 10.0;
int toPrint = int(remainder);
print(toPrint);
......
......@@ -23,8 +23,8 @@
#define MarlinSerial_h
#include "Marlin.h"
#if !defined(SERIAL_PORT)
#define SERIAL_PORT 0
#ifndef SERIAL_PORT
#define SERIAL_PORT 0
#endif
// The presence of the UBRRH register is used to detect a UART.
......@@ -36,9 +36,9 @@
// requires two levels of indirection to expand macro values properly)
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
#if SERIAL_PORT == 0 && (!defined(UBRR0H) || !defined(UDR0)) // use un-numbered registers if necessary
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##suffix
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##suffix
#else
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
#endif
// Registers used by MarlinSerial class (these are expanded
......@@ -57,7 +57,6 @@
#define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,)
#define DEC 10
#define HEX 16
#define OCT 8
......@@ -73,8 +72,7 @@
#define RX_BUFFER_SIZE 128
struct ring_buffer
{
struct ring_buffer {
unsigned char buffer[RX_BUFFER_SIZE];
int head;
int tail;
......@@ -84,8 +82,7 @@ struct ring_buffer
extern ring_buffer rx_buffer;
#endif
class MarlinSerial //: public Stream
{
class MarlinSerial { //: public Stream
public:
MarlinSerial();
......@@ -94,24 +91,20 @@ class MarlinSerial //: public Stream
int peek(void);
int read(void);
void flush(void);
FORCE_INLINE int available(void)
{
FORCE_INLINE int available(void) {
return (unsigned int)(RX_BUFFER_SIZE + rx_buffer.head - rx_buffer.tail) % RX_BUFFER_SIZE;
}
FORCE_INLINE void write(uint8_t c)
{
FORCE_INLINE void write(uint8_t c) {
while (!((M_UCSRxA) & (1 << M_UDREx)))
;
M_UDRx = c;
}
FORCE_INLINE void checkRx(void)
{
if((M_UCSRxA & (1<<M_RXCx)) != 0) {
FORCE_INLINE void checkRx(void) {
if ((M_UCSRxA & (1<<M_RXCx)) != 0) {
unsigned char c = M_UDRx;
int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE;
......@@ -125,39 +118,17 @@ class MarlinSerial //: public Stream
}
}
}
private:
private:
void printNumber(unsigned long, uint8_t);
void printFloat(double, uint8_t);
public:
FORCE_INLINE void write(const char *str)
{
while (*str)
write(*str++);
}
public:
FORCE_INLINE void write(const char *str) { while (*str) write(*str++); }
FORCE_INLINE void write(const uint8_t *buffer, size_t size) { while (size--) write(*buffer++); }
FORCE_INLINE void print(const String &s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
FORCE_INLINE void print(const char *str) { write(str); }
FORCE_INLINE void write(const uint8_t *buffer, size_t size)
{
while (size--)
write(*buffer++);
}
FORCE_INLINE void print(const String &s)
{
for (int i = 0; i < (int)s.length(); i++) {
write(s[i]);
}
}
FORCE_INLINE void print(const char *str)
{
write(str);
}
void print(char, int = BYTE);
void print(unsigned char, int = BYTE);
void print(int, int = DEC);
......
......@@ -3907,17 +3907,16 @@ Sigma_Exit:
case 92: // M92
for(int8_t i=0; i < NUM_AXIS; i++)
{
int e = 0;
if(code_seen(axis_codes[i]))
{
if(i == 3) { // E
float value = code_value();
if(value < 20.0) {
float factor = axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
max_e_jerk *= factor;
max_feedrate[i] *= factor;
axis_steps_per_sqr_second[i] *= factor;
if (i == 3)
{
e = (int)code_value();
if(code_seen('S'))
{
if (e < EXTRUDERS) axis_steps_per_unit[e+3] = code_value();
}
axis_steps_per_unit[i] = value;
}
else {
axis_steps_per_unit[i] = code_value();
......
......@@ -7,16 +7,24 @@
#define BOARD_GEN7_12 11 // Gen7 v1.1, v1.2
#define BOARD_GEN7_13 12 // Gen7 v1.3
#define BOARD_GEN7_14 13 // Gen7 v1.4
#define BOARD_CHEAPTRONIC 2 // Cheaptronic v1.0
#define BOARD_SETHI 20 // Sethi 3D_1
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics
#define BOARD_RAMPS_OLD 3 // MEGA/RAMPS up to 1.2
#define BOARD_RAMPS_13_EFB 33 // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
#define BOARD_RAMBO 301 // Rambo
#define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignment
#define BOARD_GEN6 5 // Gen6
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
#define BOARD_MELZI 63 // Melzi
......@@ -25,27 +33,28 @@
#define BOARD_MELZI_1284 66 // Melzi with ATmega1284 (MaKr3d version)
#define BOARD_AZTEEG_X3 67 // Azteeg X3
#define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro
#define BOARD_ULTIMAKER 7 // Ultimaker
#define BOARD_MEGATRONICS 70 // Megatronics
#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0
#define BOARD_MEGATRONICS_1 702 // Minitronics v1.0
#define BOARD_MEGATRONICS_3 703 // Megatronics v3.0
#define BOARD_ULTIMAKER_OLD 71 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
#define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
#define BOARD_3DRAG 77 // 3Drag Controller
#define BOARD_K8200 78 // Vellemann K8200 Controller (derived from 3Drag Controller)
#define BOARD_TEENSYLU 8 // Teensylu
#define BOARD_RUMBA 80 // Rumba
#define BOARD_PRINTRBOARD 81 // Printrboard (AT90USB1286)
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
#define BOARD_GEN3_PLUS 9 // Gen3+
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics
#define BOARD_MEGATRONICS 70 // Megatronics
#define BOARD_MEGATRONICS_2 701 // Megatronics v2.0
#define BOARD_MEGATRONICS_1 702 // Minitronics v1.0
#define BOARD_OMCA_A 90 // Alpha OMCA board
#define BOARD_OMCA 91 // Final OMCA board
#define BOARD_RAMBO 301 // Rambo
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
#define BOARD_LEAPFROG 999 // Leapfrog
#define BOARD_99 99 // This is in pins.h but...?
......
......@@ -17,202 +17,354 @@
#define DIGIPOTSS_PIN -1
#endif
/******************************************************************************
* 10 Gen7 Alfons3 pin assignment
*
******************************************************************************/
/* These Pins are assigned for the modified GEN7 Board from Alfons3 Please review the pins and adjust it for your needs*/
#if MB(GEN7_CUSTOM)
#define KNOWN_BOARD
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#endif
//x axis pins
#define ORIG_X_STEP_PIN 21 // different from standard GEN7
#define ORIG_X_DIR_PIN 20 // different from standard GEN7
#define ORIG_X_ENABLE_PIN 24
#define X_STOP_PIN 0
//y axis pins
#define ORIG_Y_STEP_PIN 23
#define ORIG_Y_DIR_PIN 22
#define ORIG_Y_ENABLE_PIN 24
#define Y_STOP_PIN 1
//z axis pins
#define ORIG_Z_STEP_PIN 26
#define ORIG_Z_DIR_PIN 25
#define ORIG_Z_ENABLE_PIN 24
#define Z_STOP_PIN 2
//extruder pins
#define ORIG_E0_STEP_PIN 28
#define ORIG_E0_DIR_PIN 27
#define ORIG_E0_ENABLE_PIN 24
#define ORIG_TEMP_0_PIN 2
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
#define ORIG_HEATER_0_PIN 4
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 3 // (bed)
#define SDPOWER -1
#define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support
#define LED_PIN -1
#define ORIG_FAN_PIN -1
#define PS_ON_PIN 19
//our pin for debugging.
#define DEBUG_PIN -1
//our RS485 pins
//#define TX_ENABLE_PIN 12
//#define RX_ENABLE_PIN 13
#define BEEPER -1
#define SDCARDDETECT -1
#define SUICIDE_PIN -1 //has to be defined; otherwise Power_off doesn't work
#define KILL_PIN -1
//Pins for 4bit LCD Support
#define LCD_PINS_RS 18
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 16
#define LCD_PINS_D5 15
#define LCD_PINS_D6 13
#define LCD_PINS_D7 14
//buttons are directly attached
#define BTN_EN1 11
#define BTN_EN2 10
#define BTN_ENC 12 //the click
#endif // GEN7_CUSTOM
/****************************************************************************************/
/****************************************************************************************
* 5DPrint D8 Driver board
* https://bitbucket.org/makible/5dprint-d8-controller-board
* 12 - 13 Gen7 v1.1, v1.2, v1.3 pin assignment
*
****************************************************************************************/
#if MB(5DPRINT)
#if MB(GEN7_13)
#define MOTHERBOARD BOARD_GEN7_12
#define GEN7_VERSION 13 // v1.3
#endif
#define KNOWN_BOARD 1
#define AT90USB 1286 // Disable MarlinSerial etc.
#if MB(GEN7_12)
#define KNOWN_BOARD
#ifndef __AVR_AT90USB1286__
#error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
#endif
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#define LARGE_FLASH true
#endif
#define ORIG_X_STEP_PIN 0
#define ORIG_X_DIR_PIN 1
#define ORIG_X_ENABLE_PIN 23
#define X_STOP_PIN 37
#ifndef GEN7_VERSION
#define GEN7_VERSION 12 // v1.x
#endif
#define ORIG_Y_STEP_PIN 2
#define ORIG_Y_DIR_PIN 3
#define ORIG_Y_ENABLE_PIN 19
#define Y_STOP_PIN 36
//x axis pins
#define ORIG_X_STEP_PIN 19
#define ORIG_X_DIR_PIN 18
#define ORIG_X_ENABLE_PIN 24
#define X_STOP_PIN 7
#define ORIG_Z_STEP_PIN 4
#define ORIG_Z_DIR_PIN 5
#define ORIG_Z_ENABLE_PIN 18
#define Z_STOP_PIN 39
//y axis pins
#define ORIG_Y_STEP_PIN 23
#define ORIG_Y_DIR_PIN 22
#define ORIG_Y_ENABLE_PIN 24
#define Y_STOP_PIN 5
#define ORIG_E0_STEP_PIN 6
#define ORIG_E0_DIR_PIN 7
#define ORIG_E0_ENABLE_PIN 17
//z axis pins
#define ORIG_Z_STEP_PIN 26
#define ORIG_Z_DIR_PIN 25
#define ORIG_Z_ENABLE_PIN 24
#define ORIG_Z_MIN_PIN 1
#define ORIG_Z_MAX_PIN 0
#define ORIG_HEATER_0_PIN 21 // Extruder
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 20 // Bed
// You may need to change ORIG_FAN_PIN to 16 because Marlin isn't using fastio.h
// for the fan and Teensyduino uses a different pin mapping.
#define ORIG_FAN_PIN 16 // Fan
//extruder pins
#define ORIG_E0_STEP_PIN 28
#define ORIG_E0_DIR_PIN 27
#define ORIG_E0_ENABLE_PIN 24
#define ORIG_TEMP_0_PIN 1 // Extruder / Analog pin numbering
#define ORIG_TEMP_BED_PIN 0 // Bed / Analog pin numbering
#define ORIG_TEMP_0_PIN 1
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 2
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_HEATER_0_PIN 4
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 3
#define SDPOWER -1
#define LED_PIN -1
#define PS_ON_PIN -1
#define KILL_PIN -1
#define ALARM_PIN -1
#define KILL_PIN -1
// The SDSS pin uses a different pin mapping from file Sd2PinMap.h
#define SDSS 20
#define SDPOWER -1
#define SDSS -1 // SCL pin of I2C header
#define LED_PIN -1
#ifndef SDSUPPORT
// these pins are defined in the SD library if building with SD support
#define SCK_PIN 9
#define MISO_PIN 11
#define MOSI_PIN 10
#if (GEN7_VERSION >= 13)
// Gen7 v1.3 removed the fan pin
#define ORIG_FAN_PIN -1
#else
#define ORIG_FAN_PIN 31
#endif
#define PS_ON_PIN 15
// Microstepping pins
// Note that the pin mapping is not from fastio.h
// See Sd2PinMap.h for the pin configurations
#define X_MS1_PIN 25
#define X_MS2_PIN 26
#define Y_MS1_PIN 9
#define Y_MS2_PIN 8
#define Z_MS1_PIN 7
#define Z_MS2_PIN 6
#define E0_MS1_PIN 5
#define E0_MS2_PIN 4
//All these generations of Gen7 supply thermistor power
//via PS_ON, so ignore bad thermistor readings
#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
//our pin for debugging.
#define DEBUG_PIN 0
//our RS485 pins
#define TX_ENABLE_PIN 12
#define RX_ENABLE_PIN 13
#endif
/****************************************************************************************/
#endif // 5DPRINT
/****************************************************************************************
* Leapfrog Driver board
*
* 14 Gen7 v1.4 pin assignment
*
****************************************************************************************/
#if MB(LEAPFROG) // Leapfrog board
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega1280__
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#if MB(GEN7_14)
#define GEN7_VERSION 14 // v1.4
#endif
#define ORIG_X_STEP_PIN 28
#define ORIG_X_DIR_PIN 63
#define ORIG_X_ENABLE_PIN 29
#define ORIG_X_MIN_PIN 47
#define ORIG_X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
#if MB(GEN7_14)
#define KNOWN_BOARD
#define ORIG_Y_STEP_PIN 14 // A6
#define ORIG_Y_DIR_PIN 15 // A0
#define ORIG_Y_ENABLE_PIN 39
#define ORIG_Y_MIN_PIN 48
#define ORIG_Y_MAX_PIN -1 //15
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#define ORIG_Z_STEP_PIN 31 // A2
#define ORIG_Z_DIR_PIN 32 // A6
#define ORIG_Z_ENABLE_PIN 30 // A1
#define ORIG_Z_MIN_PIN 49
#define ORIG_Z_MAX_PIN -1
#endif
#define ORIG_E0_STEP_PIN 34 //34
#define ORIG_E0_DIR_PIN 35 //35
#define ORIG_E0_ENABLE_PIN 33 //33
#ifndef GEN7_VERSION
#define GEN7_VERSION 14 // v1.x
#endif
#define ORIG_E1_STEP_PIN 37 //37
#define ORIG_E1_DIR_PIN 40 //40
#define ORIG_E1_ENABLE_PIN 36 //36
//x axis pins
#define ORIG_X_STEP_PIN 29
#define ORIG_X_DIR_PIN 28
#define ORIG_X_ENABLE_PIN 25
#define X_STOP_PIN 0
#define Y2_STEP_PIN 37
#define Y2_DIR_PIN 40
#define Y2_ENABLE_PIN 36
//y axis pins
#define ORIG_Y_STEP_PIN 27
#define ORIG_Y_DIR_PIN 26
#define ORIG_Y_ENABLE_PIN 25
#define Y_STOP_PIN 1
#define Z2_STEP_PIN 37
#define Z2_DIR_PIN 40
#define Z2_ENABLE_PIN 36
//z axis pins
#define ORIG_Z_STEP_PIN 23
#define ORIG_Z_DIR_PIN 22
#define ORIG_Z_ENABLE_PIN 25
#define Z_STOP_PIN 2
#define SDPOWER -1
#define SDSS 11
#define SDCARDDETECT -1 // 10 optional also used as mode pin
#define LED_PIN 13
#define ORIG_FAN_PIN 7
#define PS_ON_PIN -1
#define KILL_PIN -1
#define SOL1_PIN 16
#define SOL2_PIN 17
//extruder pins
#define ORIG_E0_STEP_PIN 19
#define ORIG_E0_DIR_PIN 18
#define ORIG_E0_ENABLE_PIN 25
#define ORIG_HEATER_0_PIN 9
#define ORIG_HEATER_1_PIN 8 // 12
#define ORIG_HEATER_2_PIN 11 //-1 // 13
#define ORIG_TEMP_0_PIN 13 //D27 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_1_PIN 15 // 1
#define ORIG_TEMP_2_PIN -1 // 2
#define ORIG_HEATER_BED_PIN 10 // 14/15
#define ORIG_TEMP_BED_PIN 14 // 1,2 or I2C
/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */
#define ORIG_TEMP_0_PIN 1
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 0
#define ORIG_HEATER_0_PIN 4
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 3
#define KILL_PIN -1
#define SDPOWER -1
#define SDSS -1 // SCL pin of I2C header
#define LED_PIN -1
#define ORIG_FAN_PIN -1
#define PS_ON_PIN 15
//our pin for debugging.
#define DEBUG_PIN 0
//our RS485 pins
#define TX_ENABLE_PIN 12
#define RX_ENABLE_PIN 13
#endif // GEN7
/****************************************************************************************/
#endif // LEAPFROG
/****************************************************************************************
*
* 2 Cheaptronic v1.0
*
****************************************************************************************/
#if MB(CHEAPTRONIC)
#define KNOWN_BOARD 1
#if MB(99)
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#define ORIG_X_STEP_PIN 2
#define ORIG_X_DIR_PIN 3
#define ORIG_X_ENABLE_PIN -1
#define X_STOP_PIN 16
#define LARGE_FLASH true
#define ORIG_Y_STEP_PIN 5
#define ORIG_Y_DIR_PIN 6
#define ORIG_Y_ENABLE_PIN -1
#define Y_STOP_PIN 67
//X motor stepper
#define ORIG_X_STEP_PIN 14
#define ORIG_X_DIR_PIN 15
#define ORIG_X_ENABLE_PIN 24
#define ORIG_Z_STEP_PIN 62
#define ORIG_Z_DIR_PIN 63
#define ORIG_Z_ENABLE_PIN -1
#define Z_STOP_PIN 59
//X endstop
#define ORIG_X_MIN_PIN 3
#define ORIG_X_MAX_PIN -1
#define ORIG_E0_STEP_PIN 65
#define ORIG_E0_DIR_PIN 66
#define ORIG_E0_ENABLE_PIN -1
//Y motor stepper
#define ORIG_Y_STEP_PIN 35
#define ORIG_Y_DIR_PIN 36
#define ORIG_Y_ENABLE_PIN 31
#define SDPOWER -1
#define SDSS 53
#define LED_PIN -1
#define ORIG_FAN_PIN -1
#define PS_ON_PIN 9
#define KILL_PIN -1
//Y endstop
#define ORIG_Y_MIN_PIN 2
#define ORIG_Y_MAX_PIN -1
#define ORIG_HEATER_0_PIN 13
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_TEMP_0_PIN 6 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_1_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_2_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_HEATER_BED_PIN 4
#define ORIG_TEMP_BED_PIN 10
//Z motor stepper
#define ORIG_Z_STEP_PIN 40
#define ORIG_Z_DIR_PIN 41
#define ORIG_Z_ENABLE_PIN 37
//Z endstop
#define ORIG_Z_MIN_PIN 5
#define ORIG_Z_MAX_PIN -1
//Extruder 0 stepper
#define ORIG_E0_STEP_PIN 26
#define ORIG_E0_DIR_PIN 28
#define ORIG_E0_ENABLE_PIN 25
//Extruder 1 stepper
#define ORIG_E1_STEP_PIN 33
#define ORIG_E1_DIR_PIN 34
#define ORIG_E1_ENABLE_PIN 30
#define SDPOWER -1
#define SDSS -1
#define LED_PIN -1
//FAN
#define ORIG_FAN_PIN -1
#define PS_ON_PIN -1
#define KILL_PIN -1
#define ORIG_HEATER_0_PIN 19 // EXTRUDER 1
#define ORIG_HEATER_1_PIN 23 // EXTRUDER 2
//HeatedBad
#define ORIG_HEATER_BED_PIN 22
//Cheaptronic v1.0 hasent EXTRUDER 3
#define ORIG_HEATER_2_PIN -1
//Temperature sensors
#define ORIG_TEMP_0_PIN 15
#define ORIG_TEMP_1_PIN 14
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 13
//Cheaptronic v1.0 dont support LCD
#define LCD_PINS_RS -1
#define LCD_PINS_ENABLE -1
#define LCD_PINS_D4 -1
#define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1
#define LCD_PINS_D7 -1
//Cheaptronic v1.0 dont support keypad
#define BTN_EN1 -1
#define BTN_EN2 -1
#define BTN_ENC -1
#define BLEN_C 2
#define BLEN_B 1
#define BLEN_A 0
//Cheaptronic v1.0 does not use this port
#define SDCARDDETECT -1
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // CHEAPTRONIC
/****************************************************************************************/
#endif // 99
/****************************************************************************************
* Sethi 3D_1 pin assignment - www.sethi3d.com.br
* 20 Sethi 3D_1 pin assignment - www.sethi3d.com.br
*
****************************************************************************************/
......@@ -288,249 +440,213 @@
#define RORIG_X_ENABLE_PIN 13
#endif // SETHI
/****************************************************************************************/
/****************************************************************************************
* Gen7 v1.1, v1.2, v1.3 pin assignment
* 21 Elefu RA Board Pin Assignments
*
****************************************************************************************/
#if MB(ELEFU_3)
#define KNOWN_BOARD 1
#if MB(GEN7_13)
#define MOTHERBOARD BOARD_GEN7_12
#define GEN7_VERSION 13 // v1.3
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#if MB(GEN7_12)
#define KNOWN_BOARD
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#endif
#define ORIG_X_STEP_PIN 49
#define ORIG_X_DIR_PIN 13
#define ORIG_X_ENABLE_PIN 48
#define ORIG_X_MIN_PIN 35
#define ORIG_X_MAX_PIN -1 //34
#ifndef GEN7_VERSION
#define GEN7_VERSION 12 // v1.x
#endif
#define ORIG_Y_STEP_PIN 11
#define ORIG_Y_DIR_PIN 9
#define ORIG_Y_ENABLE_PIN 12
#define ORIG_Y_MIN_PIN 33
#define ORIG_Y_MAX_PIN -1 //32
//x axis pins
#define ORIG_X_STEP_PIN 19
#define ORIG_X_DIR_PIN 18
#define ORIG_X_ENABLE_PIN 24
#define X_STOP_PIN 7
#define ORIG_Z_STEP_PIN 7
#define ORIG_Z_DIR_PIN 6
#define ORIG_Z_ENABLE_PIN 8
#define ORIG_Z_MIN_PIN 31
#define ORIG_Z_MAX_PIN -1 //30
//y axis pins
#define ORIG_Y_STEP_PIN 23
#define ORIG_Y_DIR_PIN 22
#define ORIG_Y_ENABLE_PIN 24
#define Y_STOP_PIN 5
#define ORIG_E2_STEP_PIN 43
#define ORIG_E2_DIR_PIN 47
#define ORIG_E2_ENABLE_PIN 42
//z axis pins
#define ORIG_Z_STEP_PIN 26
#define ORIG_Z_DIR_PIN 25
#define ORIG_Z_ENABLE_PIN 24
#define ORIG_Z_MIN_PIN 1
#define ORIG_Z_MAX_PIN 0
#define ORIG_E1_STEP_PIN 18
#define ORIG_E1_DIR_PIN 19
#define ORIG_E1_ENABLE_PIN 38
//extruder pins
#define ORIG_E0_STEP_PIN 28
#define ORIG_E0_DIR_PIN 27
#define ORIG_E0_ENABLE_PIN 24
#define ORIG_E0_STEP_PIN 40
#define ORIG_E0_DIR_PIN 41
#define ORIG_E0_ENABLE_PIN 37
#define ORIG_TEMP_0_PIN 1
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 2
#define SDPOWER -1
#define LED_PIN -1 //Use +12V Aux port for LED Ring
#define ORIG_HEATER_0_PIN 4
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 3
#define ORIG_FAN_PIN 16 //5V PWM
#define KILL_PIN -1
#define PS_ON_PIN 10 //Set to -1 if using a manual switch on the PWRSW Connector
#define SLEEP_WAKE_PIN 26 //This feature still needs work
#define SDPOWER -1
#define SDSS -1 // SCL pin of I2C header
#define LED_PIN -1
#define ORIG_HEATER_0_PIN 45 //12V PWM1
#define ORIG_HEATER_1_PIN 46 //12V PWM2
#define ORIG_HEATER_2_PIN 17 //12V PWM3
#define ORIG_HEATER_BED_PIN 44 //DOUBLE 12V PWM
#define ORIG_TEMP_0_PIN 3 //ANALOG NUMBERING
#define ORIG_TEMP_1_PIN 2 //ANALOG NUMBERING
#define ORIG_TEMP_2_PIN 1 //ANALOG NUMBERING
#define ORIG_TEMP_BED_PIN 0 //ANALOG NUMBERING
#if (GEN7_VERSION >= 13)
// Gen7 v1.3 removed the fan pin
#define ORIG_FAN_PIN -1
#else
#define ORIG_FAN_PIN 31
#endif
#define PS_ON_PIN 15
#define BEEPER 36
//All these generations of Gen7 supply thermistor power
//via PS_ON, so ignore bad thermistor readings
#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
#define KILL_PIN -1
//our pin for debugging.
#define DEBUG_PIN 0
// M240 Triggers a camera by emulating a Canon RC-1 Remote
// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
#define PHOTOGRAPH_PIN 29
//our RS485 pins
#define TX_ENABLE_PIN 12
#define RX_ENABLE_PIN 13
#ifdef RA_CONTROL_PANEL
#endif
#define SDSS 53
#define SDCARDDETECT 28
/****************************************************************************************
* Gen7 v1.4 pin assignment
*
****************************************************************************************/
#define BTN_EN1 14
#define BTN_EN2 39
#define BTN_ENC 15 //the click
#if MB(GEN7_14)
#define GEN7_VERSION 14 // v1.4
#endif
#define BLEN_C 2
#define BLEN_B 1
#define BLEN_A 0
#if MB(GEN7_14)
#define KNOWN_BOARD
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#endif //RA_CONTROL_PANEL
#endif
#ifdef RA_DISCO
//variables for which pins the TLC5947 is using
#define TLC_CLOCK_PIN 25
#define TLC_BLANK_PIN 23
#define TLC_XLAT_PIN 22
#define TLC_DATA_PIN 24
#ifndef GEN7_VERSION
#define GEN7_VERSION 14 // v1.x
#endif
//We also need to define pin to port number mapping for the 2560 to match the pins listed above. If you change the TLC pins, update this as well per the 2560 datasheet!
//This currently only works with the RA Board.
#define TLC_CLOCK_BIT 3 //bit 3 on port A
#define TLC_CLOCK_PORT &PORTA //bit 3 on port A
//x axis pins
#define ORIG_X_STEP_PIN 29
#define ORIG_X_DIR_PIN 28
#define ORIG_X_ENABLE_PIN 25
#define X_STOP_PIN 0
#define TLC_BLANK_BIT 1 //bit 1 on port A
#define TLC_BLANK_PORT &PORTA //bit 1 on port A
//y axis pins
#define ORIG_Y_STEP_PIN 27
#define ORIG_Y_DIR_PIN 26
#define ORIG_Y_ENABLE_PIN 25
#define Y_STOP_PIN 1
#define TLC_DATA_BIT 2 //bit 2 on port A
#define TLC_DATA_PORT &PORTA //bit 2 on port A
//z axis pins
#define ORIG_Z_STEP_PIN 23
#define ORIG_Z_DIR_PIN 22
#define ORIG_Z_ENABLE_PIN 25
#define Z_STOP_PIN 2
#define TLC_XLAT_BIT 0 //bit 0 on port A
#define TLC_XLAT_PORT &PORTA //bit 0 on port A
//extruder pins
#define ORIG_E0_STEP_PIN 19
#define ORIG_E0_DIR_PIN 18
#define ORIG_E0_ENABLE_PIN 25
//change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful
//Leave it at at least 1 if you have enabled RA_LIGHTING
//The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module.
#define NUM_TLCS 2
#define ORIG_TEMP_0_PIN 1
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 0
//These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions.
//Modify them according to your specific situation.
//NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
#define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
//#define TRANS_ARRAY {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15} //backwards
#endif //RA_LIGHTING
#define ORIG_HEATER_0_PIN 4
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 3
#define KILL_PIN -1
#endif // ELEFU_3
/****************************************************************************************/
#define SDPOWER -1
#define SDSS -1 // SCL pin of I2C header
#define LED_PIN -1
#define ORIG_FAN_PIN -1
/****************************************************************************************
* 22 Gen3 Monolithic Electronics
*
****************************************************************************************/
#if MB(GEN3_MONOLITHIC)
#define KNOWN_BOARD 1
#define PS_ON_PIN 15
#ifndef __AVR_ATmega644P__
#error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
#endif
//our pin for debugging.
#define DEBUG_PIN 0
//our RS485 pins
#define TX_ENABLE_PIN 12
#define RX_ENABLE_PIN 13
#endif // GEN7
/******************************************************************************
* Gen7 Alfons3 pin assignment
*
******************************************************************************/
/* These Pins are assigned for the modified GEN7 Board from Alfons3 Please review the pins and adjust it for your needs*/
// x axis
#define ORIG_X_STEP_PIN 15
#define ORIG_X_DIR_PIN 18
#define ORIG_X_MIN_PIN 20
//Alex Checar #define X_STOP_PIN 20
#define ORIG_X_ENABLE_PIN 24 //actually uses Y_enable_pin
#define ORIG_X_MAX_PIN -1
#if MB(GEN7_CUSTOM)
#define KNOWN_BOARD
// y axes
#define ORIG_Y_STEP_PIN 23
#define ORIG_Y_DIR_PIN 22
#define ORIG_Y_MIN_PIN 25
//Alex Checar #define Y_STOP_PIN 25
#define ORIG_Y_ENABLE_PIN 24 //shared with X_enable_pin
#define ORIG_Y_MAX_PIN -1
#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
#error Oops! Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#endif
// z axes
#define ORIG_Z_STEP_PIN 27
#define ORIG_Z_DIR_PIN 28
#define ORIG_Z_MIN_PIN 30
//Alex Checar #define Z_STOP_PIN 30
#define ORIG_Z_ENABLE_PIN 29
#define ORIG_Z_MAX_PIN -1
//x axis pins
#define ORIG_X_STEP_PIN 21 // different from standard GEN7
#define ORIG_X_DIR_PIN 20 // different from standard GEN7
#define ORIG_X_ENABLE_PIN 24
#define X_STOP_PIN 0
//extruder pins
#define ORIG_E0_STEP_PIN 12
#define ORIG_E0_DIR_PIN 17
#define ORIG_E0_ENABLE_PIN 3
//y axis pins
#define ORIG_Y_STEP_PIN 23
#define ORIG_Y_DIR_PIN 22
#define ORIG_Y_ENABLE_PIN 24
#define Y_STOP_PIN 1
#define ORIG_HEATER_0_PIN 16
#define ORIG_TEMP_0_PIN 0
//z axis pins
#define ORIG_Z_STEP_PIN 26
#define ORIG_Z_DIR_PIN 25
#define ORIG_Z_ENABLE_PIN 24
#define Z_STOP_PIN 2
#define ORIG_FAN_PIN -1
//extruder pins
#define ORIG_E0_STEP_PIN 28
#define ORIG_E0_DIR_PIN 27
#define ORIG_E0_ENABLE_PIN 24
#define ORIG_TEMP_0_PIN 2
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
#define ORIG_HEATER_0_PIN 4
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 3 // (bed)
#define SDPOWER -1
#define SDSS 31 // SCL pin of I2C header || CS Pin for SD Card support
#define LED_PIN -1
#define ORIG_FAN_PIN -1
#define PS_ON_PIN 19
//our pin for debugging.
//bed pins
#define ORIG_HEATER_BED_PIN -1
#define ORIG_TEMP_BED_PIN -1
#define DEBUG_PIN -1
//our RS485 pins
//#define TX_ENABLE_PIN 12
//#define RX_ENABLE_PIN 13
#define SDSS -1
#define SDPOWER -1
#define LED_PIN -1
#define BEEPER -1
#define SDCARDDETECT -1
#define SUICIDE_PIN -1 //has to be defined; otherwise Power_off doesn't work
//pin for controlling the PSU.
#define PS_ON_PIN 14 //Alex, Do this work on the card?
#define KILL_PIN -1
//Pins for 4bit LCD Support
#define LCD_PINS_RS 18
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 16
#define LCD_PINS_D5 15
#define LCD_PINS_D6 13
#define LCD_PINS_D7 14
//Alex extras from Gen3+
#define KILL_PIN -1
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_HEATER_2_PIN -1
//buttons are directly attached
#define BTN_EN1 11
#define BTN_EN2 10
#define BTN_ENC 12 //the click
#endif // GEN3_MONOLITHIC
/****************************************************************************************/
#endif // GEN7_CUSTOM
/****************************************************************************************
* 3 - 33 - 34 - 35 - 36 (RAMPS OLD - RAMPS 1.3/1.4)
* 67 - 68 (AZTEEG X3 AZTEEG X3 PRO)
* 77 - 78 (3DRAG - K8200)
* Arduino Mega pin assignment
*
****************************************************************************************/
#if IS_RAMPS || MB(3DRAG) || MB(AZTEEG_X3) || MB(AZTEEG_X3_PRO)
#if IS_RAMPS || MB(AZTEEG_X3) || MB(AZTEEG_X3_PRO) || MB(3DRAG) || MB(K8200)
#define KNOWN_BOARD 1
//////////////////FIX THIS//////////////
......@@ -904,184 +1020,260 @@
#define SCK_PIN 52
#define MISO_PIN 50
#define MOSI_PIN 51
#define MAX6675_SS 66// Do not use pin 53 if there is even the remote possibility of using Dsplay/SD card
#define MAX6675_SS 66// Do not use pin 53 if there is even the remote possibility of using Display/SD card
#else
#define MAX6675_SS 66// Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
#endif
#endif // RAMPS_OLD || RAMPS_13_EFB || RAMPS_13_EEB || RAMPS_13_EFF || 3DRAG || K8200
/****************************************************************************************/
/****************************************************************************************
* Duemilanove w/ ATMega328P pin assignment
*
* 5DPrint D8 Driver board
* https://bitbucket.org/makible/5dprint-d8-controller-board
****************************************************************************************/
#if MB(DUEMILANOVE_328P)
#if MB(5DPRINT)
#define KNOWN_BOARD 1
#define AT90USB 1286 // Disable MarlinSerial etc.
#ifndef __AVR_ATmega328P__
#error Oops! Make sure you have 'Arduino Duemilanove w/ ATMega328' selected from the 'Tools -> Boards' menu.
#ifndef __AVR_AT90USB1286__
#error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
#endif
#define ORIG_X_STEP_PIN 19
#define ORIG_X_DIR_PIN 18
#define ORIG_X_ENABLE_PIN -1
#define X_STOP_PIN 17
#define LARGE_FLASH true
#define ORIG_Y_STEP_PIN 10
#define ORIG_Y_DIR_PIN 7
#define ORIG_Y_ENABLE_PIN -1
#define Y_STOP_PIN 8
#define ORIG_X_STEP_PIN 0
#define ORIG_X_DIR_PIN 1
#define ORIG_X_ENABLE_PIN 23
#define X_STOP_PIN 37
#define ORIG_Z_STEP_PIN 13
#define ORIG_Z_DIR_PIN 3
#define ORIG_Z_ENABLE_PIN 2
#define Z_STOP_PIN 4
#define ORIG_Y_STEP_PIN 2
#define ORIG_Y_DIR_PIN 3
#define ORIG_Y_ENABLE_PIN 19
#define Y_STOP_PIN 36
#define ORIG_E0_STEP_PIN 11
#define ORIG_E0_DIR_PIN 12
#define ORIG_E0_ENABLE_PIN -1
#define ORIG_Z_STEP_PIN 4
#define ORIG_Z_DIR_PIN 5
#define ORIG_Z_ENABLE_PIN 18
#define Z_STOP_PIN 39
#define SDPOWER -1
#define SDSS -1
#define LED_PIN -1
#define ORIG_FAN_PIN 5
#define PS_ON_PIN -1
#define KILL_PIN -1
#define ORIG_E0_STEP_PIN 6
#define ORIG_E0_DIR_PIN 7
#define ORIG_E0_ENABLE_PIN 17
#define ORIG_HEATER_0_PIN 6
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_TEMP_0_PIN 0 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_HEATER_BED_PIN -1
#define ORIG_TEMP_BED_PIN -1
#define ORIG_HEATER_0_PIN 21 // Extruder
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_HEATER_BED_PIN 20 // Bed
// You may need to change ORIG_FAN_PIN to 16 because Marlin isn't using fastio.h
// for the fan and Teensyduino uses a different pin mapping.
#define ORIG_FAN_PIN 16 // Fan
#define ORIG_TEMP_0_PIN 1 // Extruder / Analog pin numbering
#define ORIG_TEMP_BED_PIN 0 // Bed / Analog pin numbering
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define SDPOWER -1
#define LED_PIN -1
#define PS_ON_PIN -1
#define KILL_PIN -1
#define ALARM_PIN -1
// The SDSS pin uses a different pin mapping from file Sd2PinMap.h
#define SDSS 20
#ifndef SDSUPPORT
// these pins are defined in the SD library if building with SD support
#define SCK_PIN 9
#define MISO_PIN 11
#define MOSI_PIN 10
#endif
// Microstepping pins
// Note that the pin mapping is not from fastio.h
// See Sd2PinMap.h for the pin configurations
#define X_MS1_PIN 25
#define X_MS2_PIN 26
#define Y_MS1_PIN 9
#define Y_MS2_PIN 8
#define Z_MS1_PIN 7
#define Z_MS2_PIN 6
#define E0_MS1_PIN 5
#define E0_MS2_PIN 4
#endif // 5DPRINT
/****************************************************************************************
* Elefu RA Board Pin Assignments
*
* Leapfrog Driver board
*
****************************************************************************************/
#if MB(ELEFU_3)
#if MB(LEAPFROG) // Leapfrog board
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega2560__
#ifndef __AVR_ATmega1280__
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#endif
#define ORIG_X_STEP_PIN 28
#define ORIG_X_DIR_PIN 63
#define ORIG_X_ENABLE_PIN 29
#define ORIG_X_MIN_PIN 47
#define ORIG_X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
#define ORIG_X_STEP_PIN 49
#define ORIG_X_DIR_PIN 13
#define ORIG_X_ENABLE_PIN 48
#define ORIG_X_MIN_PIN 35
#define ORIG_X_MAX_PIN -1 //34
#define ORIG_Y_STEP_PIN 14 // A6
#define ORIG_Y_DIR_PIN 15 // A0
#define ORIG_Y_ENABLE_PIN 39
#define ORIG_Y_MIN_PIN 48
#define ORIG_Y_MAX_PIN -1 //15
#define ORIG_Y_STEP_PIN 11
#define ORIG_Y_DIR_PIN 9
#define ORIG_Y_ENABLE_PIN 12
#define ORIG_Y_MIN_PIN 33
#define ORIG_Y_MAX_PIN -1 //32
#define ORIG_Z_STEP_PIN 31 // A2
#define ORIG_Z_DIR_PIN 32 // A6
#define ORIG_Z_ENABLE_PIN 30 // A1
#define ORIG_Z_MIN_PIN 49
#define ORIG_Z_MAX_PIN -1
#define ORIG_Z_STEP_PIN 7
#define ORIG_Z_DIR_PIN 6
#define ORIG_Z_ENABLE_PIN 8
#define ORIG_Z_MIN_PIN 31
#define ORIG_Z_MAX_PIN -1 //30
#define ORIG_E0_STEP_PIN 34 //34
#define ORIG_E0_DIR_PIN 35 //35
#define ORIG_E0_ENABLE_PIN 33 //33
#define ORIG_E2_STEP_PIN 43
#define ORIG_E2_DIR_PIN 47
#define ORIG_E2_ENABLE_PIN 42
#define ORIG_E1_STEP_PIN 37 //37
#define ORIG_E1_DIR_PIN 40 //40
#define ORIG_E1_ENABLE_PIN 36 //36
#define ORIG_E1_STEP_PIN 18
#define ORIG_E1_DIR_PIN 19
#define ORIG_E1_ENABLE_PIN 38
#define Y2_STEP_PIN 37
#define Y2_DIR_PIN 40
#define Y2_ENABLE_PIN 36
#define ORIG_E0_STEP_PIN 40
#define ORIG_E0_DIR_PIN 41
#define ORIG_E0_ENABLE_PIN 37
#define Z2_STEP_PIN 37
#define Z2_DIR_PIN 40
#define Z2_ENABLE_PIN 36
#define SDPOWER -1
#define LED_PIN -1 //Use +12V Aux port for LED Ring
#define SDPOWER -1
#define SDSS 11
#define SDCARDDETECT -1 // 10 optional also used as mode pin
#define LED_PIN 13
#define ORIG_FAN_PIN 7
#define PS_ON_PIN -1
#define KILL_PIN -1
#define SOL1_PIN 16
#define SOL2_PIN 17
#define ORIG_FAN_PIN 16 //5V PWM
#define ORIG_HEATER_0_PIN 9
#define ORIG_HEATER_1_PIN 8 // 12
#define ORIG_HEATER_2_PIN 11 //-1 // 13
#define ORIG_TEMP_0_PIN 13 //D27 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_1_PIN 15 // 1
#define ORIG_TEMP_2_PIN -1 // 2
#define ORIG_HEATER_BED_PIN 10 // 14/15
#define ORIG_TEMP_BED_PIN 14 // 1,2 or I2C
/* Unused (1) (2) (3) 4 5 6 7 8 9 10 11 12 13 (14) (15) (16) 17 (18) (19) (20) (21) (22) (23) 24 (25) (26) (27) 28 (29) (30) (31) */
#define PS_ON_PIN 10 //Set to -1 if using a manual switch on the PWRSW Connector
#define SLEEP_WAKE_PIN 26 //This feature still needs work
#define ORIG_HEATER_0_PIN 45 //12V PWM1
#define ORIG_HEATER_1_PIN 46 //12V PWM2
#define ORIG_HEATER_2_PIN 17 //12V PWM3
#define ORIG_HEATER_BED_PIN 44 //DOUBLE 12V PWM
#define ORIG_TEMP_0_PIN 3 //ANALOG NUMBERING
#define ORIG_TEMP_1_PIN 2 //ANALOG NUMBERING
#define ORIG_TEMP_2_PIN 1 //ANALOG NUMBERING
#define ORIG_TEMP_BED_PIN 0 //ANALOG NUMBERING
#endif // LEAPFROG
#define BEEPER 36
/****************************************************************************************
*
*
****************************************************************************************/
#define KILL_PIN -1
#if MB(99)
#define KNOWN_BOARD 1
// M240 Triggers a camera by emulating a Canon RC-1 Remote
// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
#define PHOTOGRAPH_PIN 29
#define ORIG_X_STEP_PIN 2
#define ORIG_X_DIR_PIN 3
#define ORIG_X_ENABLE_PIN -1
#define X_STOP_PIN 16
#ifdef RA_CONTROL_PANEL
#define ORIG_Y_STEP_PIN 5
#define ORIG_Y_DIR_PIN 6
#define ORIG_Y_ENABLE_PIN -1
#define Y_STOP_PIN 67
#define ORIG_Z_STEP_PIN 62
#define ORIG_Z_DIR_PIN 63
#define ORIG_Z_ENABLE_PIN -1
#define Z_STOP_PIN 59
#define ORIG_E0_STEP_PIN 65
#define ORIG_E0_DIR_PIN 66
#define ORIG_E0_ENABLE_PIN -1
#define SDPOWER -1
#define SDSS 53
#define LED_PIN -1
#define ORIG_FAN_PIN -1
#define PS_ON_PIN 9
#define KILL_PIN -1
#define SDSS 53
#define SDCARDDETECT 28
#define ORIG_HEATER_0_PIN 13
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_TEMP_0_PIN 6 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_1_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_2_PIN -1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_HEATER_BED_PIN 4
#define ORIG_TEMP_BED_PIN 10
#define BTN_EN1 14
#define BTN_EN2 39
#define BTN_ENC 15 //the click
#endif // 99
#define BLEN_C 2
#define BLEN_B 1
#define BLEN_A 0
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif //RA_CONTROL_PANEL
/****************************************************************************************
* Duemilanove w/ ATMega328P pin assignment
*
****************************************************************************************/
#if MB(DUEMILANOVE_328P)
#define KNOWN_BOARD 1
#ifdef RA_DISCO
//variables for which pins the TLC5947 is using
#define TLC_CLOCK_PIN 25
#define TLC_BLANK_PIN 23
#define TLC_XLAT_PIN 22
#define TLC_DATA_PIN 24
#ifndef __AVR_ATmega328P__
#error Oops! Make sure you have 'Arduino Duemilanove w/ ATMega328' selected from the 'Tools -> Boards' menu.
#endif
//We also need to define pin to port number mapping for the 2560 to match the pins listed above. If you change the TLC pins, update this as well per the 2560 datasheet!
//This currently only works with the RA Board.
#define TLC_CLOCK_BIT 3 //bit 3 on port A
#define TLC_CLOCK_PORT &PORTA //bit 3 on port A
#define ORIG_X_STEP_PIN 19
#define ORIG_X_DIR_PIN 18
#define ORIG_X_ENABLE_PIN -1
#define X_STOP_PIN 17
#define TLC_BLANK_BIT 1 //bit 1 on port A
#define TLC_BLANK_PORT &PORTA //bit 1 on port A
#define ORIG_Y_STEP_PIN 10
#define ORIG_Y_DIR_PIN 7
#define ORIG_Y_ENABLE_PIN -1
#define Y_STOP_PIN 8
#define TLC_DATA_BIT 2 //bit 2 on port A
#define TLC_DATA_PORT &PORTA //bit 2 on port A
#define ORIG_Z_STEP_PIN 13
#define ORIG_Z_DIR_PIN 3
#define ORIG_Z_ENABLE_PIN 2
#define Z_STOP_PIN 4
#define TLC_XLAT_BIT 0 //bit 0 on port A
#define TLC_XLAT_PORT &PORTA //bit 0 on port A
#define ORIG_E0_STEP_PIN 11
#define ORIG_E0_DIR_PIN 12
#define ORIG_E0_ENABLE_PIN -1
//change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful
//Leave it at at least 1 if you have enabled RA_LIGHTING
//The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module.
#define NUM_TLCS 2
#define SDPOWER -1
#define SDSS -1
#define LED_PIN -1
#define ORIG_FAN_PIN 5
#define PS_ON_PIN -1
#define KILL_PIN -1
//These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions.
//Modify them according to your specific situation.
//NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
#define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
//#define TRANS_ARRAY {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15} //backwards
#endif //RA_LIGHTING
#define ORIG_HEATER_0_PIN 6
#define ORIG_HEATER_1_PIN -1
#define ORIG_HEATER_2_PIN -1
#define ORIG_TEMP_0_PIN 0 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_HEATER_BED_PIN -1
#define ORIG_TEMP_BED_PIN -1
#endif
#endif // ELEFU_3
/****************************************************************************************
......@@ -1150,6 +1342,8 @@
#endif // GEN6 || GEN6_DELUXE
/****************************************************************************************
* Sanguinololu pin assignment
*
......@@ -1347,6 +1541,7 @@
#endif // SANGUINOLOLU_11
/*****************************************************************
* Ultimaker pin assignment
******************************************************************/
......@@ -2136,72 +2331,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif // GEN3_PLUS
/****************************************************************************************
* Gen3 Monolithic Electronics
*
****************************************************************************************/
#if MB(GEN3_MONOLITHIC)
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega644P__
#error Oops! Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
#endif
#define DEBUG_PIN 0
// x axis
#define ORIG_X_STEP_PIN 15
#define ORIG_X_DIR_PIN 18
#define ORIG_X_MIN_PIN 20
//Alex Checar #define X_STOP_PIN 20
#define ORIG_X_ENABLE_PIN 24 //actually uses Y_enable_pin
#define ORIG_X_MAX_PIN -1
// y axes
#define ORIG_Y_STEP_PIN 23
#define ORIG_Y_DIR_PIN 22
#define ORIG_Y_MIN_PIN 25
//Alex Checar #define Y_STOP_PIN 25
#define ORIG_Y_ENABLE_PIN 24 //shared with X_enable_pin
#define ORIG_Y_MAX_PIN -1
// z axes
#define ORIG_Z_STEP_PIN 27
#define ORIG_Z_DIR_PIN 28
#define ORIG_Z_MIN_PIN 30
//Alex Checar #define Z_STOP_PIN 30
#define ORIG_Z_ENABLE_PIN 29
#define ORIG_Z_MAX_PIN -1
//extruder pins
#define ORIG_E0_STEP_PIN 12
#define ORIG_E0_DIR_PIN 17
#define ORIG_E0_ENABLE_PIN 3
#define ORIG_HEATER_0_PIN 16
#define ORIG_TEMP_0_PIN 0
#define ORIG_FAN_PIN -1
//bed pins
#define ORIG_HEATER_BED_PIN -1
#define ORIG_TEMP_BED_PIN -1
#define SDSS -1
#define SDPOWER -1
#define LED_PIN -1
//pin for controlling the PSU.
#define PS_ON_PIN 14 //Alex, Do this work on the card?
//Alex extras from Gen3+
#define KILL_PIN -1
#define ORIG_TEMP_1_PIN -1
#define ORIG_TEMP_2_PIN -1
#define ORIG_HEATER_2_PIN -1
#endif // GEN3_MONOLITHIC
/****************************************************************************************
* Open Motion controller with enable based extruders
......@@ -2941,106 +3071,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif // MEGATRONICS_1
/****************************************************************************************
* Cheaptronic v1.0
*
****************************************************************************************/
#if MB(CHEAPTRONIC)
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega2560__
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
#endif
#define LARGE_FLASH true
//X motor stepper
#define ORIG_X_STEP_PIN 14
#define ORIG_X_DIR_PIN 15
#define ORIG_X_ENABLE_PIN 24
//X endstop
#define ORIG_X_MIN_PIN 3
#define ORIG_X_MAX_PIN -1
//Y motor stepper
#define ORIG_Y_STEP_PIN 35
#define ORIG_Y_DIR_PIN 36
#define ORIG_Y_ENABLE_PIN 31
//Y endstop
#define ORIG_Y_MIN_PIN 2
#define ORIG_Y_MAX_PIN -1
//Z motor stepper
#define ORIG_Z_STEP_PIN 40
#define ORIG_Z_DIR_PIN 41
#define ORIG_Z_ENABLE_PIN 37
//Z endstop
#define ORIG_Z_MIN_PIN 5
#define ORIG_Z_MAX_PIN -1
//Extruder 0 stepper
#define ORIG_E0_STEP_PIN 26
#define ORIG_E0_DIR_PIN 28
#define ORIG_E0_ENABLE_PIN 25
//Extruder 1 stepper
#define ORIG_E1_STEP_PIN 33
#define ORIG_E1_DIR_PIN 34
#define ORIG_E1_ENABLE_PIN 30
#define SDPOWER -1
#define SDSS -1
#define LED_PIN -1
//FAN
#define ORIG_FAN_PIN -1
#define PS_ON_PIN -1
#define KILL_PIN -1
#define ORIG_HEATER_0_PIN 19 // EXTRUDER 1
#define ORIG_HEATER_1_PIN 23 // EXTRUDER 2
//HeatedBad
#define ORIG_HEATER_BED_PIN 22
//Cheaptronic v1.0 hasent EXTRUDER 3
#define ORIG_HEATER_2_PIN -1
//Temperature sensors
#define ORIG_TEMP_0_PIN 15
#define ORIG_TEMP_1_PIN 14
#define ORIG_TEMP_2_PIN -1
#define ORIG_TEMP_BED_PIN 13
//Cheaptronic v1.0 dont support LCD
#define LCD_PINS_RS -1
#define LCD_PINS_ENABLE -1
#define LCD_PINS_D4 -1
#define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1
#define LCD_PINS_D7 -1
//Cheaptronic v1.0 dont support keypad
#define BTN_EN1 -1
#define BTN_EN2 -1
#define BTN_ENC -1
#define BLEN_C 2
#define BLEN_B 1
#define BLEN_A 0
//Cheaptronic v1.0 does not use this port
#define SDCARDDETECT -1
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#endif // CHEAPTRONIC
#ifndef ORIG_HEATER_3_PIN
......
......@@ -209,6 +209,11 @@ static void updateTemperaturesFromRawValues();
#ifdef FILAMENT_SENSOR
static int meas_shift_index; //used to point to a delayed sample in buffer for filament width sensor
#endif
#ifdef HEATER_0_USES_MAX6675
static int read_max6675();
#endif
//===========================================================================
//============================= functions ============================
//===========================================================================
......@@ -512,6 +517,16 @@ void manage_heater()
return;
updateTemperaturesFromRawValues();
#ifdef HEATER_0_USES_MAX6675
if (current_temperature[0] > 1023 || current_temperature[0] > HEATER_0_MAXTEMP) {
max_temp_error(0);
}
if (current_temperature[0] == 0 || current_temperature[0] < HEATER_0_MINTEMP) {
min_temp_error(0);
}
#endif //HEATER_0_USES_MAX6675
#ifndef SINGLENOZZLE
for(int e = 0; e < EXTRUDERS; e++)
{
......@@ -641,7 +656,7 @@ void manage_heater()
#if TEMP_SENSOR_BED != 0
#ifdef THERMAL_RUNAWAY_PROTECTION_PERIOD && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
#if defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0
thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, 9, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS);
#endif
......@@ -826,11 +841,15 @@ static float analog2tempBed(int raw) {
and this function is called from normal context as it is too slow to run in interrupts and will block the stepper routine otherwise */
static void updateTemperaturesFromRawValues()
{
#ifdef HEATER_0_USES_MAX6675
current_temperature_raw[0] = read_max6675();
#endif
#ifndef SINGLENOZZLE
for(uint8_t e=0;e<EXTRUDERS;e++)
{
#else
for(uint8_t e=0;e<1;e++)
uint8_t e=0;
{
#endif // !SINGLENOZZLE
current_temperature[e] = analog2temp(current_temperature_raw[e], e);
......@@ -890,10 +909,10 @@ void tp_init()
// Finish init of mult extruder arrays
#ifndef SINGLENOZZLE
for (int e = 0; e < EXTRUDERS; e++)
for (uint8_t e = 0; e < EXTRUDERS; e++)
{
#else
for (int e = 0; e < 1; e++)
uint8_t e = 0;
{
#endif // !SINGLENOZZLE
// populate with the first value
......@@ -937,6 +956,7 @@ void tp_init()
#endif
#ifdef HEATER_0_USES_MAX6675
#ifndef SDSUPPORT
SET_OUTPUT(SCK_PIN);
WRITE(SCK_PIN,0);
......@@ -946,15 +966,15 @@ void tp_init()
SET_INPUT(MISO_PIN);
WRITE(MISO_PIN,1);
#else
pinMode(SS_PIN, OUTPUT);
digitalWrite(SS_PIN, HIGH);
#endif
/* Using pinMode and digitalWrite, as that was the only way I could get it to compile */
//Have to toggle SD card CS pin to low first, to enable firmware to talk with SD card
pinMode(SS_PIN, OUTPUT);
digitalWrite(SS_PIN,0);
pinMode(MAX6675_SS, OUTPUT);
digitalWrite(MAX6675_SS,1);
#endif
SET_OUTPUT(MAX6675_SS);
WRITE(MAX6675_SS,1);
#endif //HEATER_0_USES_MAX6675
// Set analog inputs
ADCSRA = 1<<ADEN | 1<<ADSC | 1<<ADIF | 0x07;
......@@ -1131,10 +1151,10 @@ void setWatch()
{
#ifdef WATCH_TEMP_PERIOD
#ifndef SINGLENOZZLE
for (int e = 0; e < EXTRUDERS; e++)
for (uint8_t e = 0; e < EXTRUDERS; e++)
{
#else
for (int e = 0; e < 1; e++)
uint8_t e = 0;
{
#endif // !SINGLENOZZLE
if(degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2))
......@@ -1211,9 +1231,9 @@ void thermal_runaway_protection(int *state, unsigned long *timer, float temperat
void disable_heater()
{
#ifndef SINGLENOZZLE
for(int i=0;i<EXTRUDERS;i++)
for(uint8_t i=0;i<EXTRUDERS;i++)
#else
for(int i=0;i<1;i++)
uint8_t i=0;
#endif // !SINGLENOZZLE
setTargetHotend(0,i);
setTargetBed(0);
......@@ -1305,7 +1325,7 @@ void bed_max_temp_error(void) {
long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
int max6675_temp = 2000;
int read_max6675()
static int read_max6675()
{
if (millis() - max6675_previous_millis < MAX6675_HEAT_INTERVAL)
return max6675_temp;
......@@ -1313,9 +1333,9 @@ int read_max6675()
max6675_previous_millis = millis();
max6675_temp = 0;
#ifdef PRR
#ifdef PRR
PRR &= ~(1<<PRSPI);
#elif defined PRR0
#elif defined(PRR0)
PRR0 &= ~(1<<PRSPI);
#endif
......@@ -1342,10 +1362,10 @@ int read_max6675()
// disable TT_MAX6675
WRITE(MAX6675_SS, 1);
if (max6675_temp & 4)
if (max6675_temp & 4)
{
// thermocouple open
max6675_temp = 2000;
max6675_temp = 4000;
}
else
{
......@@ -1354,7 +1374,8 @@ int read_max6675()
return max6675_temp;
}
#endif
#endif //HEATER_0_USES_MAX6675
// Timer 0 is shared with millies
......@@ -1760,9 +1781,6 @@ ISR(TIMER0_COMPB_vect)
#if defined(TEMP_0_PIN) && (TEMP_0_PIN > -1)
raw_temp_0_value += ADC;
#endif
#ifdef HEATER_0_USES_MAX6675 // TODO remove the blocking
raw_temp_0_value = read_max6675();
#endif
temp_state = 2;
break;
case 2: // Prepare TEMP_BED
......@@ -1883,7 +1901,9 @@ ISR(TIMER0_COMPB_vect)
{
if (!temp_meas_ready) //Only update the raw values if they have been read. Else we could be updating them during reading.
{
#ifndef HEATER_0_USES_MAX6675
current_temperature_raw[0] = raw_temp_0_value;
#endif
#ifndef SINGLENOZZLE
#if EXTRUDERS > 1
current_temperature_raw[1] = raw_temp_1_value;
......@@ -1920,14 +1940,18 @@ ISR(TIMER0_COMPB_vect)
#else
if(current_temperature_raw[0] >= maxttemp_raw[0]) {
#endif
#ifndef HEATER_0_USES_MAX6675
max_temp_error(0);
#endif
}
#if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
if(current_temperature_raw[0] >= minttemp_raw[0]) {
#else
if(current_temperature_raw[0] <= minttemp_raw[0]) {
#endif
#ifndef HEATER_0_USES_MAX6675
min_temp_error(0);
#endif
}
#ifndef SINGLENOZZLE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment