Commit 9e22582c authored by Simone Primarosa's avatar Simone Primarosa

Update 4.2.X inital test

parent 701efac2
#ifndef CONFIGURATION_VERSION_H
#define CONFIGURATION_VERSION_H
/*
* This file is a placeholder for a file which could be distributed in an archive
* It takes the place of an automatically created "_version.h" which is generated during the build process
* It takes the place of an automatically created "_Version.h" which is generated during the build process
*/
// #error "You must specify the following parameters related to your distribution"
......@@ -10,4 +12,5 @@
#define STRING_DISTRIBUTION_DATE __DATE__ " " __TIME__ // build date and time
// It might also be appropriate to define a location where additional information can be found
#define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#endif
#endif
\ No newline at end of file
......@@ -30,9 +30,11 @@
/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */
/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */
#include "Configuration_Basic.h"
#include "pins.h"
#include "elements.h"
#if ENABLED(DIGIPOT_I2C) || ENABLED(BLINKM)
#include <Wire.h>
#endif
#if ENABLED(ULTRA_LCD)
#if ENABLED(LCD_I2C_TYPE_PCF8575)
#include <Wire.h>
......@@ -46,11 +48,6 @@
#include <LiquidCrystal.h> // library for character LCD
#endif
#endif
#if ENABLED(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
#include <SPI.h>
#endif
#if ENABLED(DIGIPOT_I2C)
#include <Wire.h>
#if HAS(DIGIPOTSS)
#include <SPI.h>
#endif
......@@ -20,7 +20,8 @@
Modified 28 September 2010 by Mark Sproul
*/
#include "Marlin.h"
#include "elements.h"
#include "MarlinSerial.h"
#ifndef USBCON
......@@ -280,7 +281,6 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
}
// Preinstantiate Objects //////////////////////////////////////////////////////
MarlinSerial customizedSerial;
#endif // whole file
......
......@@ -19,9 +19,15 @@
Modified 28 September 2010 by Mark Sproul
*/
#ifndef MarlinSerial_h
#define MarlinSerial_h
#include "Marlin.h"
#ifndef MARLINSERIAL_H
#define MARLINSERIAL_H
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
// The presence of the UBRRH register is used to detect a UART.
#define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \
......
......@@ -27,27 +27,36 @@
* - http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
*/
#include "Marlin.h"
#include "elements.h"
#include "Marlin_main.h"
#include "ultralcd.h"
#include "elements.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
#include "qr_solve.h"
#endif
#endif // AUTO_BED_LEVELING_FEATURE
#include "ultralcd.h"
#include "planner.h"
#include "stepper_indirection.h"
#if MB(ALLIGATOR)
#include "external_dac.h"
#endif
#include "stepper.h"
#include "temperature.h"
#include "cardreader.h"
#include "watchdog.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#endif
#include "configuration_store.h"
#include "language.h"
#include "pins_arduino.h"
#include "math.h"
#include "buzzer.h"
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
#endif
#if HAS(BUZZER)
#include "buzzer.h"
#endif
#if ENABLED(BLINKM)
#include "blinkm.h"
......@@ -59,9 +68,10 @@
#endif
#if HAS(DIGIPOTSS)
#include <SPI.h>
#include "SPI.h"
#endif
#if ENABLED(FIRMWARE_TEST)
#include "firmware_test.h"
#endif
......@@ -755,7 +765,9 @@ void setup() {
tp_init(); // Initialize temperature loop
plan_init(); // Initialize planner;
watchdog_init();
#if ENABLED(USE_WATCHDOG)
watchdog_init();
#endif
st_init(); // Initialize stepper, this enables interrupts!
setup_photpin();
setup_laserbeampin(); // Initialize Laserbeam pin
......@@ -6125,7 +6137,9 @@ inline void gcode_M503() {
LCD_ALERTMESSAGEPGM("Zzzz Zzzz Zzzz");
}
if (beep) {
for(int8_t i = 0; i < 3; i++) buzz(100, 1000);
#if HAS(BUZZER)
for(int8_t i = 0; i < 3; i++) buzz(100, 1000);
#endif
last_set = millis();
beep = false;
++cnt;
......@@ -6153,7 +6167,7 @@ inline void gcode_M503() {
//return to normal
if (code_seen('L')) destination[E_AXIS] -= code_value();
#if ENABLED(FILAMENTCHANGE_FINALRETRACT)
#if EXIST(FILAMENTCHANGE_FINALRETRACT)
else destination[E_AXIS] -= FILAMENTCHANGE_FINALRETRACT;
#endif
......
......@@ -4,38 +4,8 @@
#ifndef MARLIN_H
#define MARLIN_H
#define FORCE_INLINE __attribute__((always_inline)) inline
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#ifdef __SAM3X8E__
#include "HAL.h"
#else
#include <util/delay.h>
#include <avr/eeprom.h>
#include "fastio.h"
#endif
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "Configuration_Basic.h"
#include "pins.h"
#include "Arduino.h"
typedef unsigned long millis_t;
// Arduino < 1.0.0 does not define this, so we need to do it ourselves
#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p) + 0xA0)
#endif
#include "comunication.h"
void get_command();
void idle(bool ignore_stepper_queue = false);
......@@ -113,11 +83,6 @@ void manage_inactivity(bool ignore_stepper_queue=false);
#define disable_e() {disable_e0(); disable_e1(); disable_e2(); disable_e3();}
/**
* The axis order in all axis related arrays is X, Y, Z, E
*/
#define NUM_AXIS 4
/**
* Axis indices as enumerated constants
*
......@@ -203,11 +168,6 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
void setPwmFrequency(uint8_t pin, int val);
#endif
#ifndef CRITICAL_SECTION_START
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
#define CRITICAL_SECTION_END SREG = _sreg;
#endif
extern float homing_feedrate[];
extern bool axis_relative_modes[];
extern int feedrate_multiplier;
......@@ -221,11 +181,6 @@ extern float home_offset[3];
// Hotend offset
#if HOTENDS > 1
#if DISABLED(DUAL_X_CARRIAGE)
#define NUM_HOTEND_OFFSETS 2 // only in XY plane
#else
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
#endif
extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
#endif // HOTENDS > 1
......
......@@ -17,7 +17,7 @@
* along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#include "elements.h"
#if ENABLED(SDSUPPORT)
#include "Sd2Card.h"
......
......@@ -18,11 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef Sd2Card_h
#define Sd2Card_h
#include "elements.h"
#if ENABLED(SDSUPPORT)
/**
* \file
* \brief Sd2Card class for V2 SD/SDHC cards
......
......@@ -18,10 +18,6 @@
* <http://www.gnu.org/licenses/>.
*/
// Warning this file was generated by a program.
#include "Marlin.h"
#include "macros.h"
#if ENABLED(SDSUPPORT)
#ifndef Sd2PinMap_h
#define Sd2PinMap_h
......@@ -434,5 +430,3 @@ static inline __attribute__((always_inline))
}
#endif // Sd2PinMap_h
#endif
......@@ -18,9 +18,10 @@
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#include "elements.h"
#if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include <stdint.h>
#include "SdBaseFile.h"
//------------------------------------------------------------------------------
// pointer to cwd directory
......
......@@ -17,16 +17,12 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdBaseFile_h
#define SdBaseFile_h
/**
* \file
* \brief SdBaseFile class
*/
#include "Marlin.h"
#include "SdFatConfig.h"
#include "SdVolume.h"
//------------------------------------------------------------------------------
......@@ -479,5 +475,4 @@ class SdBaseFile {
#endif // ALLOW_DEPRECATED_FUNCTIONS
};
#endif // SdBaseFile_h
#endif
......@@ -21,9 +21,6 @@
* \file
* \brief configuration definitions
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdFatConfig_h
#define SdFatConfig_h
#include <stdint.h>
......@@ -120,6 +117,3 @@ uint8_t const SOFT_SPI_SCK_PIN = 13;
/** Total size of the buffer used to store the long filenames */
#define LONG_FILENAME_LENGTH (FILENAME_LENGTH*MAX_VFAT_ENTRIES+1)
#endif // SdFatConfig_h
#endif
......@@ -17,9 +17,6 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdFatStructs_h
#define SdFatStructs_h
......@@ -641,6 +638,3 @@ static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) {
return (dir->attributes & DIR_ATT_VOLUME_ID) == 0;
}
#endif // SdFatStructs_h
#endif
......@@ -17,9 +17,6 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#include "SdFatUtil.h"
//------------------------------------------------------------------------------
......@@ -78,5 +75,4 @@ void SdFatUtil::SerialPrint_P(PGM_P str) {
*/
void SdFatUtil::SerialPrintln_P(PGM_P str) {
println_P( str);
}
#endif
}
\ No newline at end of file
......@@ -17,8 +17,6 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdFatUtil_h
#define SdFatUtil_h
......@@ -26,7 +24,7 @@
* \file
* \brief Useful utility functions.
*/
#include "Marlin.h"
#include "elements.h"
#include "MarlinSerial.h"
/** Store and print a string in flash memory.*/
#define PgmPrint(x) SerialPrint_P(PSTR(x))
......@@ -43,6 +41,3 @@ namespace SdFatUtil {
using namespace SdFatUtil; // NOLINT
#endif // #define SdFatUtil_h
#endif
\ No newline at end of file
......@@ -17,9 +17,9 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#include "elements.h"
#if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include "SdFile.h"
/** Create a file object and open it in the current working directory.
*
......@@ -90,6 +90,4 @@ void SdFile::writeln_P(PGM_P str) {
write_P(str);
write_P(PSTR("\r\n"));
}
#endif
#endif
\ No newline at end of file
......@@ -21,9 +21,6 @@
* \file
* \brief SdFile class
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#include "SdBaseFile.h"
#include <Print.h>
#ifndef SdFile_h
......@@ -49,6 +46,3 @@ class SdFile : public SdBaseFile, public Print {
void writeln_P(PGM_P str);
};
#endif // SdFile_h
#endif
\ No newline at end of file
......@@ -17,9 +17,6 @@
* along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdInfo_h
#define SdInfo_h
#include <stdint.h>
......@@ -275,6 +272,4 @@ union csd_t {
csd1_t v1;
csd2_t v2;
};
#endif // SdInfo_h
#endif
\ No newline at end of file
#endif // SdInfo_h
\ No newline at end of file
......@@ -17,7 +17,8 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#include "elements.h"
#include "Marlin_main.h"
#if ENABLED(SDSUPPORT)
#include "SdVolume.h"
......
......@@ -17,8 +17,6 @@
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdVolume_h
#define SdVolume_h
/**
......@@ -210,5 +208,4 @@ class SdVolume {
}
#endif // ALLOW_DEPRECATED_FUNCTIONS
};
#endif // SdVolume
#endif
\ No newline at end of file
#endif // SdVolume
\ No newline at end of file
......@@ -2,10 +2,10 @@
blinkm.cpp - Library for controlling a BlinkM over i2c
Created by Tim Koster, August 21 2013.
*/
#include "Marlin.h"
#if ENABLED(BLINKM)
#include "elements.h"
#if ENABLED(BLINKM)
#include "blinkm.h"
void SendColors(byte red, byte grn, byte blu) {
......@@ -19,5 +19,4 @@ void SendColors(byte red, byte grn, byte blu) {
Wire.endTransmission();
}
#endif //BLINKM
#endif
\ No newline at end of file
......@@ -3,7 +3,9 @@
Library header file for BlinkM library
*/
#include "Arduino.h"
#include "Wire.h"
#ifndef BLINKM_H
#define BLINKM_H
void SendColors(byte red, byte grn, byte blu);
#endif
\ No newline at end of file
#ifndef BOARD_H
#define BOARD_H
// Macros for board type
#define BOARD_UNKNOWN -1
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
#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: Hotend, Fan, Bed)
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Bed)
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Hotend, Fan, Fan)
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_13_EEE 37 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Hotend2)
#define BOARD_RAMBO 301 // Rambo
#define BOARD_MINIRAMBO 302 // Mini-Rambo
#define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments
#define BOARD_RADDS 402 // RADDS
#define BOARD_RAMPS_FDV1 403 // RAMPS-FD V1
#define BOARD_RAMPS_FDV2 404 // RAMPS-FD V2
#define BOARD_RAMPS4DUE 433 // RAMPS4DUE with AndrewBCN's RAMPS mods (http://forums.reprap.org/read.php?219,479626,page=1)
#define BOARD_GEN6 5 // Gen6
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
#define BOARD_ALLIGATOR 502 // ALLIGATOR R2 ARM 32
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
#define BOARD_MELZI 63 // Melzi
#define BOARD_STB_11 64 // STB V1.1
#define BOARD_AZTEEG_X1 65 // Azteeg X1
#define BOARD_MELZI_MAKR3D 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_MINITRONICS 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)
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
#define BOARD_GEN3_PLUS 9 // Gen3+
#define BOARD_OMCA_A 90 // Alpha OMCA board
#define BOARD_OMCA 91 // Final OMCA board
#define BOARD_LEAPFROG 999 // Leapfrog
#define BOARD_99 99 // This is in pins.h but...?
#define MB(board) (MOTHERBOARD==BOARD_##board)
#endif
\ No newline at end of file
#include "Marlin.h"
#include "elements.h"
#if HAS(BUZZER)
#include "buzzer.h"
#include "ultralcd.h"
#if HAS(BUZZER)
void buzz(long duration, uint16_t freq) {
if (freq > 0) {
#if ENABLED(LCD_USE_I2C_BUZZER)
lcd_buzz(duration, freq);
#elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
SET_OUTPUT(BEEPER_PIN);
#if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
//tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
unsigned int delay = 1000000 / freq / 2;
int i = duration * freq / 1000;
while (i--) {
WRITE(BEEPER_PIN, HIGH);
delayMicroseconds(delay);
WRITE(BEEPER_PIN, LOW);
delayMicroseconds(delay);
}
#else // buzzer has its own resonator - needs a DC
void buzz(long duration, uint16_t freq) {
if (freq > 0) {
#if ENABLED(LCD_USE_I2C_BUZZER)
lcd_buzz(duration, freq);
#elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
SET_OUTPUT(BEEPER_PIN);
#if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
//tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
unsigned int delay = 1000000 / freq / 2;
int i = duration * freq / 1000;
while (i--) {
WRITE(BEEPER_PIN, HIGH);
delay(duration);
delayMicroseconds(delay);
WRITE(BEEPER_PIN, LOW);
#endif
#else
delayMicroseconds(delay);
}
#else // buzzer has its own resonator - needs a DC
WRITE(BEEPER_PIN, HIGH);
delay(duration);
WRITE(BEEPER_PIN, LOW);
#endif
}
else {
#else
delay(duration);
}
#endif
}
else {
delay(duration);
}
#endif
}
#endif
\ No newline at end of file
#ifndef BUZZER_H
#define BUZZER_H
#define BUZZER_H
#if HAS(BUZZER)
void buzz(long duration, uint16_t freq);
#else
FORCE_INLINE void buzz(long duration, uint16_t freq) {}
#endif
void buzz(long duration, uint16_t freq);
#endif //BUZZER_H
#endif
#include "Marlin.h"
#include "cardreader.h"
#include "ultralcd.h"
#include "stepper.h"
#include "temperature.h"
#include "language.h"
#include "elements.h"
#if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "cardreader.h"
CardReader::CardReader() {
filesize = 0;
sdpos = 0;
......@@ -657,5 +664,4 @@ void CardReader::printingHasFinished() {
autotempShutdown();
}
}
#endif //SDSUPPORT
#endif
\ No newline at end of file
#ifndef CARDREADER_H
#define CARDREADER_H
#if ENABLED(SDSUPPORT)
#define MAX_DIR_DEPTH 10 // Maximum folder depth
#include "SdFile.h"
......@@ -99,6 +97,4 @@ extern CardReader card;
#define IS_SD_PRINTING (false)
#endif //SDSUPPORT
#endif //__CARDREADER_H
......@@ -16,13 +16,6 @@
#include "MarlinSerial.h"
#endif
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
#include "WString.h"
#ifdef USBCON
......@@ -57,7 +50,7 @@
FORCE_INLINE void PS_PGM(const char *str) {
char ch;
while ((ch = pgm_read_byte(str))) {
MYSERIAL.write(ch);
SERIAL_WRITE(ch);
str++;
}
}
......
......@@ -218,6 +218,7 @@
#endif
#endif
#include "pins.h"
/**
* SINGLENOZZLE
......@@ -242,9 +243,6 @@
#endif
#endif
#include "Arduino.h"
#include "pins.h"
/**
* ENDSTOPPULLUPS
*/
......@@ -656,14 +654,14 @@
#else
#define WRITE_HEATER_0(v) WRITE_HEATER_0P(v)
#endif
#if HAS_HEATER_BED
#if HAS(HEATER_BED)
#if ENABLED(INVERTED_BED_PINS)
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN,!v)
#else
#define WRITE_HEATER_BED(v) WRITE(HEATER_BED_PIN,v)
#endif
#endif
#if HAS_FAN
#if HAS(FAN)
#if ENABLED(INVERTED_HEATER_PINS)
#define WRITE_FAN(v) WRITE(FAN_PIN, !v)
#else
......@@ -679,11 +677,26 @@
/**
* Servos
*/
#if HAS_SERVOS
#if HAS(SERVOS)
#if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0
#define HAS_SERVO_ENDSTOPS true
#define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR }
#endif
#endif
/**
* The axis order in all axis related arrays is X, Y, Z, E
*/
#define NUM_AXIS 4
// Hotend offset
#if HOTENDS > 1
#if DISABLED(DUAL_X_CARRIAGE)
#define NUM_HOTEND_OFFSETS 2 // only in XY plane
#else
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
#endif
#endif // HOTENDS > 1
#endif //CONDITIONALS_H
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#include "macros.h"
#include "default_version.h"
#ifndef CONFIGURATION_BASIC_H
#define CONFIGURATION_BASIC_H
/*
* This configuration file contains basic settings.
*
......@@ -41,7 +37,7 @@
// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
// If you want test the firmware uncomment below. Use Serial arduino monitor...
//#define FIRMWARE_TEST // ONLY BAUDRATE 115200
......@@ -235,31 +231,4 @@
***********************************************************************/
#define LANGUAGE_CHOICE 1
/***********************************************************************/
/***********************************************************************
********************** Do not touch this section **********************
***********************************************************************/
#if MECH(CARTESIAN)
#include "Configuration_Cartesian.h"
#elif MECH(COREXY)
#include "Configuration_Core.h"
#elif MECH(COREXZ)
#include "Configuration_Core.h"
#elif MECH(DELTA)
#include "Configuration_Delta.h"
#elif MECH(SCARA)
#include "Configuration_Scara.h"
#endif
#include "Configuration_Feature.h"
#include "Configuration_Overall.h"
#include "conditionals.h"
#include "thermistortables.h"
#include "language.h"
#include "pins.h"
#include "dependencies.h"
#include "conflicts.h"
/***********************************************************************/
#endif //__CONFIGURATION_H
#include "elements.h"
#include "Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
#include "configuration_store.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#endif
/**
* configuration_store.cpp
*
......@@ -96,17 +109,6 @@
*
*/
#include "Marlin.h"
#include "language.h"
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
#include "configuration_store.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#endif
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
uint8_t c;
while(size--) {
......@@ -813,8 +815,6 @@ void Config_ResetDefault() {
}
}
ConfigSD_PrintSettings(forReplay);
}
void ConfigSD_PrintSettings(bool forReplay) {
......
#ifndef CONFIGURATION_STORE_H
#define CONFIGURATION_STORE_H
#include "Configuration_Basic.h"
#include "elements.h"
void Config_ResetDefault();
void ConfigSD_ResetDefault();
......
#ifndef CONFIGURATIONS_H
#define CONFIGURATIONS_H
#include "Configuration_Version.h"
#include "Configuration_Basic.h"
#if MECH(CARTESIAN)
#include "Configuration_Cartesian.h"
#elif MECH(COREXY)
#include "Configuration_Core.h"
#elif MECH(COREXZ)
#include "Configuration_Core.h"
#elif MECH(DELTA)
#include "Configuration_Delta.h"
#elif MECH(SCARA)
#include "Configuration_Scara.h"
#endif
#include "Configuration_Feature.h"
#include "Configuration_Overall.h"
#endif
\ No newline at end of file
......@@ -23,7 +23,7 @@
#endif
//Mechanism
#if NOTEXIST(MEACHANISM)
#if NOTEXIST(MECHANISM)
#error DEPENDENCY ERROR: Missing setting MECHANISM
#endif
......@@ -162,7 +162,7 @@
#endif
#endif
#if defined(PIDTEMP)
#if NOTEXIST(PID_OPENLOOP)
#if NOTEXIST(PID_OPENLOOP) && NOTEXIST(PID_FUNCTIONAL_RANGE)
#error DEPENDENCY ERROR: Missing setting PID_FUNCTIONAL_RANGE
#endif
#if NOTEXIST(PID_INTEGRAL_DRIVE_MAX)
......
#include "Configuration_Basic.h"
#include "elements.h"
#if ENABLED(DIGIPOT_I2C)
......@@ -6,14 +7,7 @@
#include "utility/twi.h"
#include "Wire.h"
// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
#if MB(5DPRINT)
#define DIGIPOT_I2C_FACTOR 117.96
#define DIGIPOT_I2C_MAX_CURRENT 1.736
#else
#define DIGIPOT_I2C_FACTOR 106.7
#define DIGIPOT_I2C_MAX_CURRENT 2.5
#endif
#include "digipot_mcp4451.h"
static byte current_to_wiper(float current) {
return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
......
#ifndef DIGIPOT_MCP4451_H
#define DIGIPOT_MCP4451_H
// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
#if MB(5DPRINT)
#define DIGIPOT_I2C_FACTOR 117.96
#define DIGIPOT_I2C_MAX_CURRENT 1.736
#else
#define DIGIPOT_I2C_FACTOR 106.7
#define DIGIPOT_I2C_MAX_CURRENT 2.5
#endif
static byte current_to_wiper(float current);
static void i2c_send(byte addr, byte a, byte b);
// This is for the MCP4451 I2C based digipot
void digipot_i2c_set_current(int channel, float current);
void digipot_i2c_init();
#endif
\ No newline at end of file
#ifndef ELEMENTS_H
#define ELEMENTS_H
#warning called
#include "Arduino.h"
#include "pins_arduino.h"
// Arduino < 1.0.0 does not define this, so we need to do it ourselves
#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p) + 0xA0)
#endif
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#ifdef __SAM3X8E__
#include "HAL.h"
#else
#include <util/delay.h>
#include <avr/eeprom.h>
#include "fastio.h"
#endif
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "macros.h"
#include "boards.h"
#include "mechanics.h"
#include "configurations.h"
#include "language.h"
#include "dependencies.h"
#include "conditionals.h"
#include "conflicts.h"
#include "comunication.h"
typedef unsigned long millis_t;
#endif
\ No newline at end of file
/***************************************************************
*
* Externa DAC for Alligator Board
*
****************************************************************/
#include "elements.h"
#if MB(ALLIGATOR)
#include "stepper.h"
#include "external_dac.h"
ExternalDac::ExternalDac() {
return ;
}
void ExternalDac::begin() {
uint8_t externalDac_buf[2] = {0x20,0x00};//all off
// All SPI chip-select HIGH
pinMode (DAC0_SYNC, OUTPUT);
digitalWrite( DAC0_SYNC , HIGH );
#if DRIVER_EXTRUDERS > 1
pinMode (DAC1_SYNC, OUTPUT);
digitalWrite( DAC1_SYNC , HIGH );
#endif
digitalWrite( SPI_EEPROM1_CS , HIGH );
digitalWrite( SPI_EEPROM2_CS , HIGH );
digitalWrite( SPI_FLASH_CS , HIGH );
digitalWrite( SDSS , HIGH );
spiBegin();
//init onboard DAC
delayMicroseconds(2U);
digitalWrite( DAC0_SYNC , LOW );
delayMicroseconds(2U);
digitalWrite( DAC0_SYNC , HIGH );
delayMicroseconds(2U);
digitalWrite( DAC0_SYNC , LOW );
spiSend(SPI_CHAN_DAC,externalDac_buf , 2);
digitalWrite( DAC0_SYNC , HIGH );
#if DRIVER_EXTRUDERS > 1
//init Piggy DAC
delayMicroseconds(2U);
digitalWrite( DAC1_SYNC , LOW );
delayMicroseconds(2U);
digitalWrite( DAC1_SYNC , HIGH );
delayMicroseconds(2U);
digitalWrite( DAC1_SYNC , LOW );
spiSend(SPI_CHAN_DAC,externalDac_buf , 2);
digitalWrite( DAC1_SYNC , HIGH );
#endif
return;
}
void ExternalDac::setValue(uint8_t channel, uint8_t value) {
if(channel >= 7) // max channel (X,Y,Z,E0,E1,E2,E3)
return;
if(value > 255) value = 255;
uint8_t externalDac_buf[2] = {0x10,0x00};
if(channel > 3)
externalDac_buf[0] |= (7 - channel << 6);
else
externalDac_buf[0] |= (3 - channel << 6);
externalDac_buf[0] |= (value>>4);
externalDac_buf[1] |= (value<<4);
// All SPI chip-select HIGH
digitalWrite( DAC0_SYNC , HIGH );
#if DRIVER_EXTRUDERS > 1
digitalWrite( DAC1_SYNC , HIGH );
#endif
digitalWrite( SPI_EEPROM1_CS , HIGH );
digitalWrite( SPI_EEPROM2_CS , HIGH );
digitalWrite( SPI_FLASH_CS , HIGH );
digitalWrite( SDSS , HIGH );
if(channel > 3) { // DAC Piggy E1,E2,E3
digitalWrite(DAC1_SYNC , LOW);
delayMicroseconds(2U);
digitalWrite(DAC1_SYNC , HIGH);
delayMicroseconds(2U);
digitalWrite(DAC1_SYNC , LOW);
}
else { // DAC onboard X,Y,Z,E0
digitalWrite(DAC0_SYNC , LOW);
delayMicroseconds(2U);
digitalWrite(DAC0_SYNC , HIGH);
delayMicroseconds(2U);
digitalWrite(DAC0_SYNC , LOW);
}
delayMicroseconds(2U);
spiSend(SPI_CHAN_DAC,externalDac_buf , 2);
return;
}
#endif
#ifndef _EXTERNAL_DAC_H
#define _EXTERNAL_DAC_H
class ExternalDac {
public:
ExternalDac();
static void begin(void);
static void setValue(uint8_t channel, uint8_t value);
};
#endif //_EXTERNAL_DAC_H
......@@ -3,12 +3,16 @@
Tools for firmware test
By MagoKimbra
*/
#include "Marlin.h"
#include "stepper.h"
#include "elements.h"
#include "Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "temperature.h"
#include "language.h"
static char serial_answer;
......
......@@ -27,8 +27,6 @@
#define LANGUAGE_CHOICE 7 // Pick your language from the list above
#endif
#include "default_version.h"
#define PROTOCOL_VERSION "1.0"
#if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
......
......@@ -13,10 +13,6 @@
#define SIN_60 0.8660254037844386
#define COS_60 0.5
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)
// Macros to support option testing
#define _CAT(a, ...) a ## __VA_ARGS__
#define SWITCH_ENABLED_0 0
......@@ -24,92 +20,20 @@
#define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
#define EXIST(b) defined(EXIST)
#define NOTEXIST(b) (!defined(EXIST))
#define COUNT(a) (sizeof(a)/sizeof(*a))
#define EXIST defined
#define NOTEXIST !defined
#define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0)
#define HAS(FE) (HAS_##FE)
#define HASNT(FE) (!(HAS_##FE))
// Macros for board type
#define BOARD_UNKNOWN -1
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
#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: Hotend, Fan, Bed)
#define BOARD_RAMPS_13_EEB 34 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Bed)
#define BOARD_RAMPS_13_EFF 35 // RAMPS 1.3 / 1.4 (Power outputs: Hotend, Fan, Fan)
#define BOARD_RAMPS_13_EEF 36 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Fan)
#define BOARD_RAMPS_13_EEE 37 // RAMPS 1.3 / 1.4 (Power outputs: Hotend0, Hotend1, Hotend2)
#define BOARD_RAMBO 301 // Rambo
#define BOARD_MINIRAMBO 302 // Mini-Rambo
#define BOARD_DUEMILANOVE_328P 4 // Duemilanove w/ ATMega328P pin assignments
#define BOARD_RADDS 402 // RADDS
#define BOARD_RAMPS_FDV1 403 // RAMPS-FD V1
#define BOARD_RAMPS_FDV2 404 // RAMPS-FD V2
#define BOARD_RAMPS4DUE 433 // RAMPS4DUE with AndrewBCN's RAMPS mods (http://forums.reprap.org/read.php?219,479626,page=1)
#define BOARD_GEN6 5 // Gen6
#define BOARD_GEN6_DELUXE 51 // Gen6 deluxe
#define BOARD_ALLIGATOR 502 // ALLIGATOR R2 ARM 32
#define BOARD_SANGUINOLOLU_11 6 // Sanguinololu < 1.2
#define BOARD_SANGUINOLOLU_12 62 // Sanguinololu 1.2 and above
#define BOARD_MELZI 63 // Melzi
#define BOARD_STB_11 64 // STB V1.1
#define BOARD_AZTEEG_X1 65 // Azteeg X1
#define BOARD_MELZI_MAKR3D 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_MINITRONICS 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)
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board
#define BOARD_GEN3_PLUS 9 // Gen3+
#define BOARD_OMCA_A 90 // Alpha OMCA board
#define BOARD_OMCA 91 // Final OMCA board
#define BOARD_LEAPFROG 999 // Leapfrog
#define BOARD_99 99 // This is in pins.h but...?
#define MB(board) (MOTHERBOARD==BOARD_##board)
//Macros for mechanics
#define MECH_UNKNOWN -1
#define MECH_CARTESIAN 0
#define MECH_COREXY 1
#define MECH_COREXZ 2
#define MECH_DELTA 3
#define MECH_SCARA 4
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)
#define COUNT(a) (sizeof(a)/sizeof(*a))
#define MECH(mechanism) (MEACHANISM == BOARD_##mechanism)
// Function macro
#define FORCE_INLINE __attribute__((always_inline)) inline
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();
#define CRITICAL_SECTION_END SREG = _sreg;
#endif //__MACROS_H
#ifndef MECHANICS_H
#define MECHANICS_H
// Macros for mechanics type
#define MECH_UNKNOWN -1
#define MECH_CARTESIAN 0
#define MECH_COREXY 1
#define MECH_COREXZ 2
#define MECH_DELTA 3
#define MECH_SCARA 4
#define MECH(mech) (MECHANISM == MECH_##mech)
#endif
\ No newline at end of file
#define M100_FREE_MEMORY_DUMPER // Comment out to remove Dump sub-command
#define M100_FREE_MEMORY_CORRUPTOR // Comment out to remove Corrupt sub-command
// M100 Free Memory Watcher
//
// This code watches the free memory block between the bottom of the heap and the top of the stack.
// This memory block is initialized and watched via the M100 command.
//
// M100 I Initializes the free memory block and prints vitals statistics about the area
// M100 F Identifies how much of the free memory block remains free and unused. It also
// detects and reports any corruption within the free memory block that may have
// happened due to errant firmware.
// M100 D Does a hex display of the free memory block along with a flag for any errant
// data that does not match the expected value.
// M100 C x Corrupts x locations within the free memory block. This is useful to check the
// correctness of the M100 F and M100 D commands.
//
// Initial version by Roxy-3DPrintBoard
//
//
#include "Marlin.h"
#if ENABLED(M100_FREE_MEMORY_WATCHER)
extern void *__brkval;
extern size_t __heap_start, __heap_end, __flp;
//
// Declare all the functions we need from Marlin_Main.cpp to do the work!
//
float code_value();
long code_value_long();
bool code_seen(char );
//
// Utility functions used by M100 to get its work done.
//
unsigned char *top_of_stack();
void prt_hex_nibble( unsigned int );
void prt_hex_byte(unsigned int );
void prt_hex_word(unsigned int );
int how_many_E5s_are_here( unsigned char *);
void gcode_M100() {
static int m100_not_initialized = 1;
unsigned char *sp, *ptr;
int i, j, n;
//
// M100 D dumps the free memory block from __brkval to the stack pointer.
// malloc() eats memory from the start of the block and the stack grows
// up from the bottom of the block. Solid 0xE5's indicate nothing has
// used that memory yet. There should not be anything but 0xE5's within
// the block of 0xE5's. If there is, that would indicate memory corruption
// probably caused by bad pointers. Any unexpected values will be flagged in
// the right hand column to help spotting them.
//
#if ENABLED(M100_FREE_MEMORY_DUMPER) // Comment out to remove Dump sub-command
if ( code_seen('D') ) {
ptr = (unsigned char *) __brkval;
//
// We want to start and end the dump on a nice 16 byte boundry even though
// the values we are using are not 16 byte aligned.
//
ECHO_M("\n__brkval : ");
prt_hex_word( (unsigned int) ptr );
ptr = (unsigned char *) ((unsigned long) ptr & 0xfff0);
sp = top_of_stack();
ECHO_M("\nStack Pointer : ");
prt_hex_word( (unsigned int) sp );
ECHO_M("\n");
sp = (unsigned char *) ((unsigned long) sp | 0x000f);
n = sp - ptr;
//
// This is the main loop of the Dump command.
//
while ( ptr < sp ) {
prt_hex_word( (unsigned int) ptr); // Print the address
ECHO_M(":");
for(i = 0; i < 16; i++) { // and 16 data bytes
prt_hex_byte( *(ptr+i));
ECHO_M(" ");
delay(2);
}
ECHO_M("|"); // now show where non 0xE5's are
for(i = 0; i < 16; i++) {
delay(2);
if ( *(ptr+i)==0xe5)
ECHO_M(" ");
else
ECHO_M("?");
}
ECHO_M("\n");
ptr += 16;
delay(2);
}
ECHO_M("Done.\n");
return;
}
#endif
//
// M100 F requests the code to return the number of free bytes in the memory pool along with
// other vital statistics that define the memory pool.
//
if ( code_seen('F') ) {
int max_addr = (int) __brkval;
int max_cnt = 0;
int block_cnt = 0;
ptr = (unsigned char *) __brkval;
sp = top_of_stack();
n = sp - ptr;
// Scan through the range looking for the biggest block of 0xE5's we can find
for(i = 0; i < n; i++) {
if ( *(ptr+i) == (unsigned char) 0xe5) {
j = how_many_E5s_are_here( (unsigned char *) ptr+i );
if ( j > 8) {
ECHO_MV("Found ", j );
ECHO_M(" bytes free at 0x");
prt_hex_word( (int) ptr+i );
ECHO_M("\n");
i += j;
block_cnt++;
}
if ( j>max_cnt) { // We don't do anything with this information yet
max_cnt = j; // but we do know where the biggest free memory block is.
max_addr = (int) ptr+i;
}
}
}
if (block_cnt>1)
ECHO_EM("\nMemory Corruption detected in free memory area.\n");
ECHO_M("\nDone.\n");
return;
}
//
// M100 C x Corrupts x locations in the free memory pool and reports the locations of the corruption.
// This is useful to check the correctness of the M100 D and the M100 F commands.
//
#if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
if ( code_seen('C') ) {
int x; // x gets the # of locations to corrupt within the memory pool
x = code_value();
ECHO_EM("Corrupting free memory block.\n");
ptr = (unsigned char *) __brkval;
ECHO_MV("\n__brkval : ",(long) ptr );
ptr += 8;
sp = top_of_stack();
ECHO_MV("\nStack Pointer : ",(long) sp );
ECHO_EM("\n");
n = sp - ptr - 64; // -64 just to keep us from finding interrupt activity that
// has altered the stack.
j = n / (x+1);
for(i = 1; i <= x; i++) {
*(ptr+(i*j)) = i;
ECHO_M("\nCorrupting address: 0x");
prt_hex_word( (unsigned int) (ptr+(i*j)) );
}
ECHO_EM("\n");
return;
}
#endif
//
// M100 I Initializes the free memory pool so it can be watched and prints vital
// statistics that define the free memory pool.
//
if (m100_not_initialized || code_seen('I') ) { // If no sub-command is specified, the first time
ECHO_EM("Initializing free memory block.\n"); // this happens, it will Initialize.
ptr = (unsigned char *) __brkval; // Repeated M100 with no sub-command will not destroy the
ECHO_MV("\n__brkval : ",(long) ptr ); // state of the initialized free memory pool.
ptr += 8;
sp = top_of_stack();
ECHO_MV("\nStack Pointer : ",(long) sp );
ECHO_EM("\n");
n = sp - ptr - 64; // -64 just to keep us from finding interrupt activity that
// has altered the stack.
ECHO_V( n );
ECHO_EM(" bytes of memory initialized.\n");
for(i = 0; i < n; i++)
*(ptr+i) = (unsigned char) 0xe5;
for(i = 0; i < n; i++) {
if ( *(ptr+i) != (unsigned char) 0xe5 ) {
ECHO_MV("? address : ", (unsigned long) ptr+i );
ECHO_MV("=", *(ptr+i) );
ECHO_EM("\n");
}
}
m100_not_initialized = 0;
ECHO_EM("Done.\n");
return;
}
return;
}
// top_of_stack() returns the location of a variable on its stack frame. The value returned is above
// the stack once the function returns to the caller.
unsigned char *top_of_stack() {
unsigned char x;
return &x + 1; // x is pulled on return;
}
//
// 3 support routines to print hex numbers. We can print a nibble, byte and word
//
void prt_hex_nibble( unsigned int n ) {
if ( n <= 9 )
ECHO_V(n);
else
ECHO_V( (char) ('A'+n-10) );
delay(2);
}
void prt_hex_byte(unsigned int b) {
prt_hex_nibble( ( b & 0xf0 ) >> 4 );
prt_hex_nibble( b & 0x0f );
}
void prt_hex_word(unsigned int w) {
prt_hex_byte( ( w & 0xff00 ) >> 8 );
prt_hex_byte( w & 0x0ff );
}
// how_many_E5s_are_here() is a utility function to easily find out how many 0xE5's are
// at the specified location. Having this logic as a function simplifies the search code.
//
int how_many_E5s_are_here( unsigned char *p) {
int n;
for(n = 0; n < 32000; n++) {
if ( *(p+n) != (unsigned char) 0xe5)
return n-1;
}
return -1;
}
#endif
......@@ -48,12 +48,17 @@
*
*/
#include "Marlin.h"
#include "elements.h"
#include "Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "language.h"
//===========================================================================
//============================= public variables ============================
......
......@@ -24,11 +24,9 @@
#ifndef PLANNER_H
#define PLANNER_H
#include "Marlin.h"
// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in
// the source g-code and may never actually be reached if acceleration management is active.
typedef struct {
struct beffering{
// Fields used by the bresenham algorithm for tracing the line
long steps[NUM_AXIS]; // Step count along each axis
unsigned long step_event_count; // The number of step events required to complete this block
......@@ -68,8 +66,8 @@ typedef struct {
unsigned long laser_ttlmodulation;
#endif
volatile char busy;
} block_t;
};
typedef struct beffering block_t;
#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
// Initialize the motion plan subsystem
......@@ -84,8 +82,6 @@ FORCE_INLINE uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
// Transform required to compensate for bed level
extern matrix_3x3 plan_bed_level_matrix;
......
#include "qr_solve.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
#include <stdlib.h>
#include <math.h>
#include "elements.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE) && ENABLED(AUTO_BED_LEVELING_GRID)
#include "qr_solve.h"
//# include "r8lib.h"
int i4_min ( int i1, int i2 )
......
#include "Configuration_Basic.h"
#if ENABLED(AUTO_BED_LEVELING_GRID)
#ifndef QR_SOLVE_H
#define QR_SOLVE_H
void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy );
double ddot ( int n, double dx[], int incx, double dy[], int incy );
......
......@@ -43,13 +43,10 @@
detach() - Stops an attached servos from pulsing its i/o pin.
*/
#include "Configuration_Basic.h"
#if HAS(SERVOS)
#include <avr/interrupt.h>
#include <Arduino.h>
#include "elements.h"
#if HAS(SERVOS)
#include "servo.h"
#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009
......
......@@ -44,10 +44,8 @@
With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY and detach.
*/
#ifndef servo_h
#define servo_h
#include <inttypes.h>
#ifndef SERVO_H
#define SERVO_H
/*
* Defines for 16 bit timers used with Servo library
......
#ifndef SPEED_LOOKUPTABLE_H
#define SPEED_LOOKUPTABLE_H
#include "Marlin.h"
#if F_CPU == 16000000
const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {\
......
......@@ -22,18 +22,28 @@
/* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith
and Philipp Tiefenbacher. */
#include "Marlin.h"
#include "stepper.h"
#include "elements.h"
#include "Marlin_main.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#if MB(ALLIGATOR)
#include "external_dac.h"
#endif
#include "stepper.h"
#include "temperature.h"
#include "ultralcd.h"
#include "language.h"
#include "cardreader.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#endif
#include "speed_lookuptable.h"
#if HAS(DIGIPOTSS)
#include <SPI.h>
#endif
//===========================================================================
//============================= public variables ============================
//===========================================================================
......@@ -603,7 +613,7 @@ ISR(TIMER1_COMPA_vect) {
if (cleaning_buffer_counter) {
current_block = NULL;
plan_discard_current_block();
#if ENABLED(SD_FINISHED_RELEASECOMMAND)
#if EXIST(SD_FINISHED_RELEASECOMMAND)
if ((cleaning_buffer_counter == 1) && (SD_FINISHED_STEPPERRELEASE)) enqueuecommands_P(PSTR(SD_FINISHED_RELEASECOMMAND));
#endif
cleaning_buffer_counter--;
......
......@@ -18,15 +18,8 @@
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef stepper_h
#define stepper_h
#include "planner.h"
#include "stepper_indirection.h"
#if MB(ALLIGATOR)
#include "external_dac.h"
#endif
#ifndef STEPPER_H
#define STEPPER_H
#if DRIVER_EXTRUDERS > 3
#define E_STEP_WRITE(v) { if(current_block->active_driver == 3) { E3_STEP_WRITE(v); } else { if(current_block->active_driver == 2) { E2_STEP_WRITE(v); } else { if(current_block->active_driver == 1) { E1_STEP_WRITE(v); } else { E0_STEP_WRITE(v); }}}}
......@@ -112,4 +105,4 @@ void microstep_readings();
void colorstep(long csteps,const bool direction);
#endif
#endif // stepper_h
#endif // STEPPER_H
......@@ -19,14 +19,13 @@
along with Marlin. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stepper_indirection.h"
#include "Configuration_Basic.h"
#include "elements.h"
#include "stepper_indirection.h"
#if ENABLED(HAVE_TMCDRIVER)
#include <SPI.h>
#include <TMC26XStepper.h>
#endif
// Stepper objects of TMC steppers used
#if ENABLED(X_IS_TMC)
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR);
......
......@@ -22,8 +22,6 @@
#ifndef STEPPER_INDIRECTION_H
#define STEPPER_INDIRECTION_H
#include "macros.h"
// X motor
#define X_STEP_INIT SET_OUTPUT(X_STEP_PIN)
#define X_STEP_WRITE(STATE) WRITE(X_STEP_PIN,STATE)
......
......@@ -18,19 +18,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Marlin.h"
#include "elements.h"
#include "Marlin_main.h"
#include "ultralcd.h"
#include "planner.h"
#include "stepper_indirection.h"
#if MB(ALLIGATOR)
#include "external_dac.h"
#endif
#include "stepper.h"
#include "temperature.h"
#include "watchdog.h"
#include "language.h"
#include "Sd2PinMap.h"
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
#endif
#if ENABLED(SDSUPPORT)
#include "Sd2PinMap.h"
#endif
#include "temperature.h"
#include "thermistortables.h"
//===========================================================================
//================================== macros =================================
//===========================================================================
#if ENABLED(K1) // Defined in Configuration.h in the PID settings
#if EXIST(K1) // Defined in Configuration.h in the PID settings
#define K2 (1.0 - K1)
#endif
......@@ -190,6 +201,16 @@ static void updateTemperaturesFromRawValues();
//================================ Functions ================================
//===========================================================================
void autotempShutdown() {
#if ENABLED(AUTOTEMP)
if (autotemp_enabled) {
autotemp_enabled = false;
if (degTargetHotend(active_extruder) > autotemp_min)
setTargetHotend(0, active_extruder);
}
#endif
}
#if ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)
void PID_autotune(float temp, int hotend, int ncycles) {
float input = 0.0;
......@@ -836,10 +857,10 @@ static void updateTemperaturesFromRawValues() {
second_overflow -= 1000;
}
last_update = temp_last_update;
// Reset the watchdog after we know we have a temperature measurement.
watchdog_reset();
#if ENABLED(USE_WATCHDOG)
// Reset the watchdog after we know we have a temperature measurement.
watchdog_reset();
#endif
CRITICAL_SECTION_START;
temp_meas_ready = false;
CRITICAL_SECTION_END;
......
......@@ -21,10 +21,6 @@
#ifndef TEMPERATURE_H
#define TEMPERATURE_H
#include "Marlin.h"
#include "planner.h"
#include "stepper.h"
// public functions
void tp_init(); //initialize the heating
void manage_heater(); //it is critical that this is called periodically.
......@@ -154,15 +150,7 @@ void PID_autotune(float temp, int hotend, int ncycles);
void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans();
extern void autotempShutdown();
FORCE_INLINE void autotempShutdown() {
#if ENABLED(AUTOTEMP)
if (autotemp_enabled) {
autotemp_enabled = false;
if (degTargetHotend(active_extruder) > autotemp_min)
setTargetHotend(0, active_extruder);
}
#endif
}
#endif // TEMPERATURE_H
#ifndef THERMISTORTABLES_H_
#define THERMISTORTABLES_H_
#include "Marlin.h"
#include "macros.h"
#define OVERSAMPLENR 16
#if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORHEATER_3 == 1) || (THERMISTORBED == 1) //100k bed thermistor
......@@ -1083,116 +1080,116 @@ const short temptable_1047[][2] PROGMEM = {
#define _TT_NAME(_N) temptable_ ## _N
#define TT_NAME(_N) _TT_NAME(_N)
#if ENABLED(THERMISTORHEATER_0)
#if EXIST(THERMISTORHEATER_0)
#define HEATER_0_TEMPTABLE TT_NAME(THERMISTORHEATER_0)
#define HEATER_0_TEMPTABLE_LEN COUNT(HEATER_0_TEMPTABLE)
#else
#if ENABLED(HEATER_0_USES_THERMISTOR)
#error No heater 0 thermistor table specified
#else // HEATER_0_USES_THERMISTOR
#define HEATER_0_TEMPTABLE NULL
#define HEATER_0_TEMPTABLE_LEN 0
#endif // HEATER_0_USES_THERMISTOR
#if ENABLED(HEATER_0_USES_THERMISTOR)
#error No heater 0 thermistor table specified
#else // HEATER_0_USES_THERMISTOR
#define HEATER_0_TEMPTABLE NULL
#define HEATER_0_TEMPTABLE_LEN 0
#endif // HEATER_0_USES_THERMISTOR
#endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if DISABLED(HEATER_0_RAW_HI_TEMP)
#if ENABLED(HEATER_0_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_0_RAW_HI_TEMP 0
#define HEATER_0_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_0_RAW_HI_TEMP 16383
#define HEATER_0_RAW_LO_TEMP 0
#endif
#if NOTEXIST(HEATER_0_RAW_HI_TEMP)
#if ENABLED(HEATER_0_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_0_RAW_HI_TEMP 0
#define HEATER_0_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_0_RAW_HI_TEMP 16383
#define HEATER_0_RAW_LO_TEMP 0
#endif
#endif
#if ENABLED(THERMISTORHEATER_1)
#if EXIST(THERMISTORHEATER_1)
#define HEATER_1_TEMPTABLE TT_NAME(THERMISTORHEATER_1)
#define HEATER_1_TEMPTABLE_LEN COUNT(HEATER_1_TEMPTABLE)
#else
#if ENABLED(HEATER_1_USES_THERMISTOR)
#error No heater 1 thermistor table specified
#else // HEATER_1_USES_THERMISTOR
#define HEATER_1_TEMPTABLE NULL
#define HEATER_1_TEMPTABLE_LEN 0
#endif // HEATER_1_USES_THERMISTOR
#if ENABLED(HEATER_1_USES_THERMISTOR)
#error No heater 1 thermistor table specified
#else // HEATER_1_USES_THERMISTOR
#define HEATER_1_TEMPTABLE NULL
#define HEATER_1_TEMPTABLE_LEN 0
#endif // HEATER_1_USES_THERMISTOR
#endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if DISABLED(HEATER_1_RAW_HI_TEMP)
#if ENABLED(HEATER_1_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_1_RAW_HI_TEMP 0
#define HEATER_1_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_1_RAW_HI_TEMP 16383
#define HEATER_1_RAW_LO_TEMP 0
#endif
#if NOTEXIST(HEATER_1_RAW_HI_TEMP)
#if ENABLED(HEATER_1_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_1_RAW_HI_TEMP 0
#define HEATER_1_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_1_RAW_HI_TEMP 16383
#define HEATER_1_RAW_LO_TEMP 0
#endif
#endif
#if ENABLED(THERMISTORHEATER_2)
#if EXIST(THERMISTORHEATER_2)
#define HEATER_2_TEMPTABLE TT_NAME(THERMISTORHEATER_2)
#define HEATER_2_TEMPTABLE_LEN COUNT(HEATER_2_TEMPTABLE)
#else
#if ENABLED(HEATER_2_USES_THERMISTOR)
#error No heater 2 thermistor table specified
#else // HEATER_2_USES_THERMISTOR
#define HEATER_2_TEMPTABLE NULL
#define HEATER_2_TEMPTABLE_LEN 0
#endif // HEATER_2_USES_THERMISTOR
#if ENABLED(HEATER_2_USES_THERMISTOR)
#error No heater 2 thermistor table specified
#else // HEATER_2_USES_THERMISTOR
#define HEATER_2_TEMPTABLE NULL
#define HEATER_2_TEMPTABLE_LEN 0
#endif // HEATER_2_USES_THERMISTOR
#endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if DISABLED(HEATER_2_RAW_HI_TEMP)
#if ENABLED(HEATER_2_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_2_RAW_HI_TEMP 0
#define HEATER_2_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_2_RAW_HI_TEMP 16383
#define HEATER_2_RAW_LO_TEMP 0
#endif
#if NOTEXIST(HEATER_2_RAW_HI_TEMP)
#if ENABLED(HEATER_2_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_2_RAW_HI_TEMP 0
#define HEATER_2_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_2_RAW_HI_TEMP 16383
#define HEATER_2_RAW_LO_TEMP 0
#endif
#endif
#if ENABLED(THERMISTORHEATER_3)
#if EXIST(THERMISTORHEATER_3)
#define HEATER_3_TEMPTABLE TT_NAME(THERMISTORHEATER_3)
#define HEATER_3_TEMPTABLE_LEN COUNT(HEATER_3_TEMPTABLE)
#else
#if ENABLED(HEATER_3_USES_THERMISTOR)
#error No heater 3 thermistor table specified
#else // HEATER_3_USES_THERMISTOR
#define HEATER_3_TEMPTABLE NULL
#define HEATER_3_TEMPTABLE_LEN 0
#endif // HEATER_3_USES_THERMISTOR
#if ENABLED(HEATER_3_USES_THERMISTOR)
#error No heater 3 thermistor table specified
#else // HEATER_3_USES_THERMISTOR
#define HEATER_3_TEMPTABLE NULL
#define HEATER_3_TEMPTABLE_LEN 0
#endif // HEATER_3_USES_THERMISTOR
#endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if DISABLED(HEATER_3_RAW_HI_TEMP)
#if ENABLED(HEATER_3_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_3_RAW_HI_TEMP 0
#define HEATER_3_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_3_RAW_HI_TEMP 16383
#define HEATER_3_RAW_LO_TEMP 0
#endif
#if NOTEXIST(HEATER_3_RAW_HI_TEMP)
#if ENABLED(HEATER_3_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_3_RAW_HI_TEMP 0
#define HEATER_3_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_3_RAW_HI_TEMP 16383
#define HEATER_3_RAW_LO_TEMP 0
#endif
#endif
#if ENABLED(THERMISTORBED)
#if EXIST(THERMISTORBED)
#define BEDTEMPTABLE TT_NAME(THERMISTORBED)
#define BEDTEMPTABLE_LEN COUNT(BEDTEMPTABLE)
#else
#if ENABLED(BED_USES_THERMISTOR)
#error No bed thermistor table specified
#endif // BED_USES_THERMISTOR
#if ENABLED(BED_USES_THERMISTOR)
#error No bed thermistor table specified
#endif // BED_USES_THERMISTOR
#endif
//Set the high and low raw values for the heater,this indicates which raw value is a high or low temperature
#if DISABLED(HEATER_BED_RAW_HI_TEMP)
#if ENABLED(BED_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_BED_RAW_HI_TEMP 0
#define HEATER_BED_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_BED_RAW_HI_TEMP 16383
#define HEATER_BED_RAW_LO_TEMP 0
#endif
#if NOTEXIST(HEATER_BED_RAW_HI_TEMP)
#if ENABLED(BED_USES_THERMISTOR) //In case of a thermistor the highest temperature results in the lowest ADC value
#define HEATER_BED_RAW_HI_TEMP 0
#define HEATER_BED_RAW_LO_TEMP 16383
#else //In case of an thermocouple the highest temperature results in the highest ADC value
#define HEATER_BED_RAW_HI_TEMP 16383
#define HEATER_BED_RAW_LO_TEMP 0
#endif
#endif
#endif //THERMISTORTABLES_H_
#include "ultralcd.h"
#include "elements.h"
#if ENABLED(ULTRA_LCD)
#include "Marlin.h"
#include "language.h"
#include "cardreader.h"
#include "Marlin_main.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#endif
#include "temperature.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "configuration_store.h"
#include "ultralcd.h"
#if HAS(BUZZER)
#include "buzzer.h"
#endif
int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
......@@ -139,7 +151,7 @@ static void lcd_status_screen();
/**
* START_MENU generates the init code for a menu function
*/
#if ENABLED(BTN_BACK) && BTN_BACK > 0
#if EXIST(BTN_BACK) && BTN_BACK > 0
#define START_MENU(last_menu) do { \
encoderRateMultiplierEnabled = false; \
if (encoderPosition > 0x8000) encoderPosition = 0; \
......@@ -1566,8 +1578,9 @@ void lcd_quick_feedback() {
#if DISABLED(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6)
#endif
lcd.buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#elif PIN_EXISTS(BEEPER)
#elif HAS(BUZZER)
#if DISABLED(LCD_FEEDBACK_FREQUENCY_HZ)
#define LCD_FEEDBACK_FREQUENCY_HZ 5000
#endif
......@@ -1829,7 +1842,7 @@ void lcd_update() {
(*currentMenu)();
#endif
#if ENABLED(LCD_HAS_STATUS_INDICATORS))
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
lcd_implementation_update_indicators();
#endif
......@@ -1928,7 +1941,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
* 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 ENABLED(EN_A) && ENABLED(EN_B)
#if EXIST(EN_A) && EXIST(EN_B)
#define encrot0 0
#define encrot1 2
#define encrot2 3
......@@ -1952,7 +1965,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#if BTN_ENC > 0
millis_t ms = millis();
if (ms > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
#if ENABLED(BTN_BACK) && BTN_BACK > 0
#if EXIST(BTN_BACK) && BTN_BACK > 0
if (ms > next_button_update_ms && READ(BTN_BACK) == 0) newbutton |= EN_D;
#endif
#endif
......@@ -2366,10 +2379,16 @@ char *ftostr52(const float &x) {
#elif ENABLED(NEXTION)
#include "Marlin.h"
#include "language.h"
#include "cardreader.h"
#include "Marlin_main.h"
#if ENABLED(SDSUPPORT)
#include "cardreader.h"
#endif
#include "temperature.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
#endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "configuration_store.h"
#include "Nextion.h"
......
#ifndef ULTRALCD_H
#define ULTRALCD_H
#include "Marlin.h"
#include "buzzer.h"
#if ENABLED(ULTRA_LCD)
int lcd_strlen(char *s);
int lcd_strlen_P(const char *s);
......@@ -80,7 +77,7 @@
#define EN_A BIT(BLEN_A)
#define LCD_CLICKED (buttons&EN_C)
#if ENABLED(BTN_BACK) && BTN_BACK > 0
#if EXIST(BTN_BACK) && BTN_BACK > 0
#define EN_D BIT(BLEN_D)
#define LCD_BACK_CLICKED (buttons&EN_D)
#endif
......
#ifndef ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
#define ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
/**
* Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
* When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
......@@ -27,7 +26,7 @@
#define EN_B BIT(BLEN_B) // The two encoder pins are connected through BTN_EN1 and BTN_EN2
#define EN_A BIT(BLEN_A)
#if ENABLED(BTN_ENC) && BTN_ENC > -1
#if EXIST(BTN_ENC) && BTN_ENC > -1
// encoder click is directly connected
#define BLEN_C 2
#define EN_C BIT(BLEN_C)
......@@ -51,7 +50,7 @@
#define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET)
#define B_RI (BUTTON_RIGHT<<B_I2C_BTN_OFFSET)
#if ENABLED(BTN_ENC) && BTN_ENC > -1
#if EXIST(BTN_ENC) && BTN_ENC > -1
// the pause/stop/restart button is connected to BTN_ENC when used
#define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name
#define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
......
#ifndef ULCDST7920_H
#define ULCDST7920_H
#include "Marlin.h"
#if ENABLED(U8GLIB_ST7920)
//set optimization so ARDUINO optimizes this file
......
#ifndef UTF_MAPPER_H
#define UTF_MAPPER_H
#include "language.h"
#if ENABLED(DOGLCD)
#define HARDWARE_CHAR_OUT u8g.print
#else
......
......@@ -16,8 +16,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <math.h>
#include "Marlin.h"
#include "elements.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h"
......@@ -130,5 +130,4 @@ void matrix_3x3::debug(const char title[]) {
ECHO_E;
}
}
#endif // AUTO_BED_LEVELING_FEATURE
#endif
\ No newline at end of file
......@@ -19,7 +19,6 @@
#ifndef VECTOR_3_H
#define VECTOR_3_H
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
class matrix_3x3;
struct vector_3
......@@ -57,6 +56,4 @@ struct matrix_3x3
void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float& y, float& z);
#endif // AUTO_BED_LEVELING_FEATURE
#endif // VECTOR_3_H
#endif // AUTO_BED_LEVELING_FEATURE
\ No newline at end of file
#include "Marlin.h"
#include "elements.h"
#if ENABLED(USE_WATCHDOG)
#include <avr/wdt.h>
#include "watchdog.h"
#include "ultralcd.h"
#include "whatchdog.h"
//===========================================================================
//============================ private variables ============================
......@@ -48,4 +45,4 @@ ISR(WDT_vect) {
}
#endif // RESET_MANUAL
#endif // USE_WATCHDOG
#endif
#ifndef WATCHDOG_H
#define WATCHDOG_H
#include "Marlin.h"
#if ENABLED(USE_WATCHDOG)
// initialize watch dog with a 1 sec interrupt time
void watchdog_init();
// pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures..
void watchdog_reset();
#else
//If we do not have a watchdog, then we can have empty functions which are optimized away.
FORCE_INLINE void watchdog_init() {};
FORCE_INLINE void watchdog_reset() {};
#endif
// initialize watch dog with a 1 sec interrupt time
void watchdog_init();
// pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures..
void watchdog_reset();
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment