Commit ef15427e authored by Simone Primarosa's avatar Simone Primarosa

Merge pull request #66 from simonepri/master

Update 4.2.0 dev
parents 6f27b4e0 051dcc00
### Version 4.2.0
* New configuration systems (Now you can create a separate file with all configuration and use it in you FW update)
* New namings for file
* Added more documentation inside configuration file
* More checks for feature incompatibility during compilation
* Codeclean
* General bugfix
* Removed legacy support for old configuration (Do not use your old configuration files, namings and position for configuration has changed)
### Version 4.1.5 ### Version 4.1.5
* Added dot for SD write operation * Added dot for SD write operation
* Added statistics menu * Added statistics menu
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//============================================================================ #ifndef CONFIGURATION_PINS_H
//==================== Change PIN width Configurator Tool ==================== #define CONFIGURATION_PINS_H
//============================================================================
//=========================== BASIC ==============================
//X axis pins //X axis pins
#define X_STEP_PIN ORIG_X_STEP_PIN #define X_STEP_PIN ORIG_X_STEP_PIN
...@@ -59,10 +60,66 @@ ...@@ -59,10 +60,66 @@
//FAN pin //FAN pin
#define FAN_PIN ORIG_FAN_PIN #define FAN_PIN ORIG_FAN_PIN
//=========================== START YOUR CHANGE ============================== //============================================================================
// Example for change X_MIN_PIN
// #undef X_MIN_PIN //=========================== FEATURE ==============================
// #define X_MIN_PIN newpin
#if ENABLED(MKR4)
#define E0E1_CHOICE_PIN -1
#define E0E2_CHOICE_PIN -1
#define E0E3_CHOICE_PIN -1
#define E1E3_CHOICE_PIN -1
#endif //MKR4
#if ENABLED(NPR2)
#define E_MIN_PIN -1
#endif
#if ENABLED(LASERBEAM)
#define LASER_PWR_PIN -1
#define LASER_TTL_PIN -1
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FILRUNOUT_PIN -1
#endif
#if ENABLED(FILAMENT_SENSOR)
#define FILWIDTH_PIN -1 // ANALOG NUMBERING
#endif
#if ENABLED(POWER_CONSUMPTION)
#define POWER_CONSUMPTION_PIN -1 // ANALOG NUMBERING
#endif
#if ENABLED(PHOTOGRAPH)
#define PHOTOGRAPH_PIN -1
#endif
#if ENABLED(CHDK)
#define CHDK_PIN -1
#endif
#if ENABLED(CONTROLLERFAN)
#define CONTROLLERFAN_PIN -1
#endif
#if ENABLED(EXTRUDER_AUTO_FAN)
#define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#endif
#if ENABLED(X2_IS_TMC)
#define X2_ENABLE_PIN -1
#define X2_STEP_PIN -1
#define X2_DIR_PIN -1
#endif
#if ENABLED(Z_PROBE_SLED)
#define SLED_PIN -1
#endif
//============================================================================ //============================================================================
#endif
\ No newline at end of file
This diff is collapsed.
#ifndef CONFIGURATION_VERSION_H
#define CONFIGURATION_VERSION_H
/* /*
* This file is a placeholder for a file which could be distributed in an archive * 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
...@@ -10,4 +12,5 @@ ...@@ -10,4 +12,5 @@
#define STRING_DISTRIBUTION_DATE __DATE__ " " __TIME__ // build date and time #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 // It might also be appropriate to define a location where additional information can be found
#define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra" #define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#endif
#endif #endif
\ No newline at end of file
This diff is collapsed.
#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"
#ifdef 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.
//
#ifdef 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.
//
#ifdef 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
...@@ -30,27 +30,24 @@ ...@@ -30,27 +30,24 @@
/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */ /* 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 */ /* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */
#include "Configuration.h" #include "base.h"
#include "pins.h"
#ifdef ULTRA_LCD #if ENABLED(DIGIPOT_I2C) || ENABLED(BLINKM)
#if defined(LCD_I2C_TYPE_PCF8575) #include <Wire.h>
#endif
#if ENABLED(ULTRA_LCD)
#if ENABLED(LCD_I2C_TYPE_PCF8575)
#include <Wire.h> #include <Wire.h>
#include <LiquidCrystal_I2C.h> #include <LiquidCrystal_I2C.h>
#elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008) #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)
#include <Wire.h> #include <Wire.h>
#include <LiquidTWI2.h> #include <LiquidTWI2.h>
#elif defined(DOGLCD) #elif ENABLED(DOGLCD)
#include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/) #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
#else #else
#include <LiquidCrystal.h> // library for character LCD #include <LiquidCrystal.h> // library for character LCD
#endif #endif
#endif #endif
#if HAS(DIGIPOTSS)
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 #include <SPI.h>
#include <SPI.h>
#endif
#if defined(DIGIPOT_I2C)
#include <Wire.h>
#endif #endif
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
Modified 28 September 2010 by Mark Sproul Modified 28 September 2010 by Mark Sproul
*/ */
#include "Marlin.h" #include "base.h"
#include "MarlinSerial.h" #include "MarlinSerial.h"
#ifndef USBCON #ifndef USBCON
...@@ -280,7 +281,6 @@ void MarlinSerial::printFloat(double number, uint8_t digits) { ...@@ -280,7 +281,6 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
} }
// Preinstantiate Objects ////////////////////////////////////////////////////// // Preinstantiate Objects //////////////////////////////////////////////////////
MarlinSerial customizedSerial; MarlinSerial customizedSerial;
#endif // whole file #endif // whole file
......
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
Modified 28 September 2010 by Mark Sproul Modified 28 September 2010 by Mark Sproul
*/ */
#ifndef MarlinSerial_h #ifndef MARLINSERIAL_H
#define MarlinSerial_h #define MARLINSERIAL_H
#include "Marlin.h"
#ifndef SERIAL_PORT #ifndef cbi
#define SERIAL_PORT 0 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif #endif
// The presence of the UBRRH register is used to detect a UART. // The presence of the UBRRH register is used to detect a UART.
......
This diff is collapsed.
...@@ -4,141 +4,17 @@ ...@@ -4,141 +4,17 @@
#ifndef MARLIN_H #ifndef MARLIN_H
#define 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.h"
#include "pins.h"
#ifndef SANITYCHECK_H
#error Your Configuration.h and Configuration_adv.h files are outdated!
#endif
#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 get_command();
void idle(bool ignore_stepper_queue = false); void idle(bool ignore_stepper_queue = false);
void manage_inactivity(bool ignore_stepper_queue=false); void manage_inactivity(bool ignore_stepper_queue=false);
#if ENABLED(DUAL_X_CARRIAGE) && HAS_X_ENABLE && HAS_X2_ENABLE
#define enable_x() do { X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); } while (0)
#define disable_x() do { X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; } while (0)
#elif HAS_X_ENABLE
#define enable_x() X_ENABLE_WRITE( X_ENABLE_ON)
#define disable_x() { X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }
#else
#define enable_x() ;
#define disable_x() ;
#endif
#if HAS_Y_ENABLE
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#define enable_y() { Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#else
#define enable_y() Y_ENABLE_WRITE( Y_ENABLE_ON)
#define disable_y() { Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }
#endif
#else
#define enable_y() ;
#define disable_y() ;
#endif
#if HAS_Z_ENABLE
#if ENABLED(Z_DUAL_STEPPER_DRIVERS)
#define enable_z() { Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#else
#define enable_z() Z_ENABLE_WRITE( Z_ENABLE_ON)
#define disable_z() { Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }
#endif
#else
#define enable_z() ;
#define disable_z() ;
#endif
#if HAS_E0_ENABLE
#define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define enable_e0() /* nothing */
#define disable_e0() /* nothing */
#endif
#if (DRIVER_EXTRUDERS > 1) && HAS_E1_ENABLE
#define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define enable_e1() /* nothing */
#define disable_e1() /* nothing */
#endif
#if (DRIVER_EXTRUDERS > 2) && HAS_E2_ENABLE
#define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define enable_e2() /* nothing */
#define disable_e2() /* nothing */
#endif
#if (DRIVER_EXTRUDERS > 3) && HAS_E3_ENABLE
#define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON)
#define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
#else
#define enable_e3() /* nothing */
#define disable_e3() /* nothing */
#endif
#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
*
* A_AXIS and B_AXIS are used by COREXY printers
* X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
*/
enum AxisEnum {X_AXIS=0, A_AXIS=0, Y_AXIS=1, B_AXIS=1, Z_AXIS=2, C_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5, Z_HEAD=5};
enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=6, Z2_MIN=7, Z2_MAX=8};
void enable_all_steppers();
void disable_all_steppers();
void FlushSerialRequestResend(); void FlushSerialRequestResend();
void ok_to_send(); void ok_to_send();
#if ENABLED(DELTA) #if MECH(DELTA)
float probe_bed(float x, float y); float probe_bed(float x, float y);
void set_delta_constants(); void set_delta_constants();
void adj_tower_delta(int tower); void adj_tower_delta(int tower);
...@@ -166,7 +42,7 @@ void ok_to_send(); ...@@ -166,7 +42,7 @@ void ok_to_send();
extern float delta_radius; extern float delta_radius;
extern float delta_diagonal_rod; extern float delta_diagonal_rod;
#endif #endif
#if ENABLED(SCARA) #if MECH(SCARA)
void calculate_delta(float cartesian[3]); void calculate_delta(float cartesian[3]);
void calculate_SCARA_forward_Transform(float f_scara[3]); void calculate_SCARA_forward_Transform(float f_scara[3]);
#endif #endif
...@@ -188,6 +64,9 @@ enum DebugFlags { ...@@ -188,6 +64,9 @@ enum DebugFlags {
DEBUG_DRYRUN = BIT(3), DEBUG_DRYRUN = BIT(3),
DEBUG_COMMUNICATION = BIT(4) DEBUG_COMMUNICATION = BIT(4)
}; };
void clamp_to_software_endstops(float target[3]);
extern uint8_t debugLevel; extern uint8_t debugLevel;
extern bool Running; extern bool Running;
...@@ -201,17 +80,12 @@ void prepare_arc_move(char isclockwise); ...@@ -201,17 +80,12 @@ void prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]); void clamp_to_software_endstops(float target[3]);
extern millis_t previous_cmd_ms; extern millis_t previous_cmd_ms;
inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } inline void refresh_cmd_timeout();
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN)
void setPwmFrequency(uint8_t pin, int val); void setPwmFrequency(uint8_t pin, int val);
#endif #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 float homing_feedrate[];
extern bool axis_relative_modes[]; extern bool axis_relative_modes[];
extern int feedrate_multiplier; extern int feedrate_multiplier;
...@@ -225,11 +99,6 @@ extern float home_offset[3]; ...@@ -225,11 +99,6 @@ extern float home_offset[3];
// Hotend offset // Hotend offset
#if HOTENDS > 1 #if HOTENDS > 1
#ifndef 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]; extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS];
#endif // HOTENDS > 1 #endif // HOTENDS > 1
...@@ -237,7 +106,7 @@ extern float home_offset[3]; ...@@ -237,7 +106,7 @@ extern float home_offset[3];
extern int old_color; // old color for system NPR2 extern int old_color; // old color for system NPR2
#endif #endif
#if ENABLED(DELTA) #if MECH(DELTA)
extern float z_probe_offset[3]; extern float z_probe_offset[3];
extern float endstop_adj[3]; extern float endstop_adj[3];
extern float tower_adj[6]; extern float tower_adj[6];
...@@ -248,7 +117,7 @@ extern float home_offset[3]; ...@@ -248,7 +117,7 @@ extern float home_offset[3];
extern float z_endstop_adj; extern float z_endstop_adj;
#endif #endif
#if ENABLED(SCARA) #if MECH(SCARA)
extern float axis_scaling[3]; // Build size scaling extern float axis_scaling[3]; // Build size scaling
#endif #endif
...@@ -273,7 +142,7 @@ extern int fanSpeed; ...@@ -273,7 +142,7 @@ extern int fanSpeed;
#if ENABLED(FAN_SOFT_PWM) #if ENABLED(FAN_SOFT_PWM)
extern unsigned char fanSpeedSoftPwm; extern unsigned char fanSpeedSoftPwm;
#if HAS_CONTROLLERFAN #if HAS(CONTROLLERFAN)
extern unsigned char fanSpeedSoftPwm_controller; extern unsigned char fanSpeedSoftPwm_controller;
#endif #endif
#endif #endif
...@@ -288,7 +157,7 @@ extern int fanSpeed; ...@@ -288,7 +157,7 @@ extern int fanSpeed;
extern int meas_delay_cm; //delay distance extern int meas_delay_cm; //delay distance
#endif #endif
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
extern float power_consumption_meas; //holds the power consumption as accurately measured extern float power_consumption_meas; //holds the power consumption as accurately measured
extern unsigned long power_consumption_hour; //holds the power consumption per hour as accurately measured extern unsigned long power_consumption_hour; //holds the power consumption per hour as accurately measured
extern unsigned long startpower; extern unsigned long startpower;
...@@ -341,4 +210,26 @@ extern uint8_t active_driver; ...@@ -341,4 +210,26 @@ extern uint8_t active_driver;
extern void calculate_volumetric_multipliers(); extern void calculate_volumetric_multipliers();
#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 *);
#endif
#endif //MARLIN_H #endif //MARLIN_H
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with the Arduino Sd2Card Library. If not, see * along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "base.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "Sd2Card.h" #include "Sd2Card.h"
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef Sd2Card_h #ifndef Sd2Card_h
#define Sd2Card_h #define Sd2Card_h
#include "base.h"
#if ENABLED(SDSUPPORT)
/** /**
* \file * \file
* \brief Sd2Card class for V2 SD/SDHC cards * \brief Sd2Card class for V2 SD/SDHC cards
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
// Warning this file was generated by a program. // Warning this file was generated by a program.
#include "Marlin.h"
#include "macros.h"
#if ENABLED(SDSUPPORT)
#ifndef Sd2PinMap_h #ifndef Sd2PinMap_h
#define Sd2PinMap_h #define Sd2PinMap_h
...@@ -434,5 +430,3 @@ static inline __attribute__((always_inline)) ...@@ -434,5 +430,3 @@ static inline __attribute__((always_inline))
} }
#endif // Sd2PinMap_h #endif // Sd2PinMap_h
#endif
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "base.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include <stdint.h>
#include "SdBaseFile.h" #include "SdBaseFile.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// pointer to cwd directory // pointer to cwd directory
...@@ -1806,7 +1807,7 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) { ...@@ -1806,7 +1807,7 @@ int16_t SdBaseFile::write(const void* buf, uint16_t nbyte) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// suppress cpplint warnings with NOLINT comment // suppress cpplint warnings with NOLINT comment
#if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN) #if ALLOW_DEPRECATED_FUNCTIONS && DISABLED(DOXYGEN)
void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0; // NOLINT void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0; // NOLINT
#endif // ALLOW_DEPRECATED_FUNCTIONS #endif // ALLOW_DEPRECATED_FUNCTIONS
......
...@@ -17,16 +17,12 @@ ...@@ -17,16 +17,12 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdBaseFile_h #ifndef SdBaseFile_h
#define SdBaseFile_h #define SdBaseFile_h
/** /**
* \file * \file
* \brief SdBaseFile class * \brief SdBaseFile class
*/ */
#include "Marlin.h"
#include "SdFatConfig.h" #include "SdFatConfig.h"
#include "SdVolume.h" #include "SdVolume.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -364,7 +360,7 @@ class SdBaseFile { ...@@ -364,7 +360,7 @@ class SdBaseFile {
uint8_t width, bool printSlash); uint8_t width, bool printSlash);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Deprecated functions - suppress cpplint warnings with NOLINT comment // Deprecated functions - suppress cpplint warnings with NOLINT comment
#if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN) #if ALLOW_DEPRECATED_FUNCTIONS && DISABLED(DOXYGEN)
public: public:
/** \deprecated Use: /** \deprecated Use:
* bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock); * bool contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock);
...@@ -479,5 +475,4 @@ class SdBaseFile { ...@@ -479,5 +475,4 @@ class SdBaseFile {
#endif // ALLOW_DEPRECATED_FUNCTIONS #endif // ALLOW_DEPRECATED_FUNCTIONS
}; };
#endif // SdBaseFile_h
#endif #endif
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
* \file * \file
* \brief configuration definitions * \brief configuration definitions
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdFatConfig_h #ifndef SdFatConfig_h
#define SdFatConfig_h #define SdFatConfig_h
#include <stdint.h> #include <stdint.h>
...@@ -120,6 +117,3 @@ uint8_t const SOFT_SPI_SCK_PIN = 13; ...@@ -120,6 +117,3 @@ uint8_t const SOFT_SPI_SCK_PIN = 13;
/** Total size of the buffer used to store the long filenames */ /** Total size of the buffer used to store the long filenames */
#define LONG_FILENAME_LENGTH (FILENAME_LENGTH*MAX_VFAT_ENTRIES+1) #define LONG_FILENAME_LENGTH (FILENAME_LENGTH*MAX_VFAT_ENTRIES+1)
#endif // SdFatConfig_h #endif // SdFatConfig_h
#endif
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdFatStructs_h #ifndef SdFatStructs_h
#define SdFatStructs_h #define SdFatStructs_h
...@@ -641,6 +638,3 @@ static inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) { ...@@ -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; return (dir->attributes & DIR_ATT_VOLUME_ID) == 0;
} }
#endif // SdFatStructs_h #endif // SdFatStructs_h
#endif
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#include "SdFatUtil.h" #include "SdFatUtil.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -78,5 +75,4 @@ void SdFatUtil::SerialPrint_P(PGM_P str) { ...@@ -78,5 +75,4 @@ void SdFatUtil::SerialPrint_P(PGM_P str) {
*/ */
void SdFatUtil::SerialPrintln_P(PGM_P str) { void SdFatUtil::SerialPrintln_P(PGM_P str) {
println_P( str); println_P( str);
} }
#endif \ No newline at end of file
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdFatUtil_h #ifndef SdFatUtil_h
#define SdFatUtil_h #define SdFatUtil_h
...@@ -26,7 +24,7 @@ ...@@ -26,7 +24,7 @@
* \file * \file
* \brief Useful utility functions. * \brief Useful utility functions.
*/ */
#include "Marlin.h" #include "base.h"
#include "MarlinSerial.h" #include "MarlinSerial.h"
/** Store and print a string in flash memory.*/ /** Store and print a string in flash memory.*/
#define PgmPrint(x) SerialPrint_P(PSTR(x)) #define PgmPrint(x) SerialPrint_P(PSTR(x))
...@@ -43,6 +41,3 @@ namespace SdFatUtil { ...@@ -43,6 +41,3 @@ namespace SdFatUtil {
using namespace SdFatUtil; // NOLINT using namespace SdFatUtil; // NOLINT
#endif // #define SdFatUtil_h #endif // #define SdFatUtil_h
#endif
\ No newline at end of file
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "base.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "Marlin_main.h"
#include "SdFile.h" #include "SdFile.h"
/** Create a file object and open it in the current working directory. /** Create a file object and open it in the current working directory.
* *
...@@ -90,6 +90,4 @@ void SdFile::writeln_P(PGM_P str) { ...@@ -90,6 +90,4 @@ void SdFile::writeln_P(PGM_P str) {
write_P(str); write_P(str);
write_P(PSTR("\r\n")); write_P(PSTR("\r\n"));
} }
#endif
\ No newline at end of file
#endif
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
* \file * \file
* \brief SdFile class * \brief SdFile class
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#include "SdBaseFile.h" #include "SdBaseFile.h"
#include <Print.h> #include <Print.h>
#ifndef SdFile_h #ifndef SdFile_h
...@@ -49,6 +46,3 @@ class SdFile : public SdBaseFile, public Print { ...@@ -49,6 +46,3 @@ class SdFile : public SdBaseFile, public Print {
void writeln_P(PGM_P str); void writeln_P(PGM_P str);
}; };
#endif // SdFile_h #endif // SdFile_h
#endif
\ No newline at end of file
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
* along with the Arduino Sd2Card Library. If not, see * along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdInfo_h #ifndef SdInfo_h
#define SdInfo_h #define SdInfo_h
#include <stdint.h> #include <stdint.h>
...@@ -275,6 +272,4 @@ union csd_t { ...@@ -275,6 +272,4 @@ union csd_t {
csd1_t v1; csd1_t v1;
csd2_t v2; csd2_t v2;
}; };
#endif // SdInfo_h #endif // SdInfo_h
\ No newline at end of file
#endif
\ No newline at end of file
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h" #include "base.h"
#include "Marlin_main.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "SdVolume.h" #include "SdVolume.h"
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#if ENABLED(SDSUPPORT)
#ifndef SdVolume_h #ifndef SdVolume_h
#define SdVolume_h #define SdVolume_h
/** /**
...@@ -193,7 +191,7 @@ class SdVolume { ...@@ -193,7 +191,7 @@ class SdVolume {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Deprecated functions - suppress cpplint warnings with NOLINT comment // Deprecated functions - suppress cpplint warnings with NOLINT comment
#if ALLOW_DEPRECATED_FUNCTIONS && !defined(DOXYGEN) #if ALLOW_DEPRECATED_FUNCTIONS && DISABLED(DOXYGEN)
public: public:
/** \deprecated Use: bool SdVolume::init(Sd2Card* dev); /** \deprecated Use: bool SdVolume::init(Sd2Card* dev);
* \param[in] dev The SD card where the volume is located. * \param[in] dev The SD card where the volume is located.
...@@ -210,5 +208,4 @@ class SdVolume { ...@@ -210,5 +208,4 @@ class SdVolume {
} }
#endif // ALLOW_DEPRECATED_FUNCTIONS #endif // ALLOW_DEPRECATED_FUNCTIONS
}; };
#endif // SdVolume #endif // SdVolume
#endif \ No newline at end of file
\ No newline at end of file
#ifndef BASE_H
#define BASE_H
#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 "Configuration_Version.h"
#include "Configuration_Basic.h"
#include "Configuration_Overall.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"
#include "language.h"
#include "conditionals.h"
#include "sanitycheck.h"
#include "comunication.h"
typedef unsigned long millis_t;
#endif
\ No newline at end of file
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
blinkm.cpp - Library for controlling a BlinkM over i2c blinkm.cpp - Library for controlling a BlinkM over i2c
Created by Tim Koster, August 21 2013. Created by Tim Koster, August 21 2013.
*/ */
#include "Marlin.h"
#if ENABLED(BLINKM) #include "base.h"
#if ENABLED(BLINKM)
#include "blinkm.h" #include "blinkm.h"
void SendColors(byte red, byte grn, byte blu) { void SendColors(byte red, byte grn, byte blu) {
...@@ -19,5 +19,4 @@ void SendColors(byte red, byte grn, byte blu) { ...@@ -19,5 +19,4 @@ void SendColors(byte red, byte grn, byte blu) {
Wire.endTransmission(); Wire.endTransmission();
} }
#endif //BLINKM #endif
\ No newline at end of file
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
Library header file for BlinkM library Library header file for BlinkM library
*/ */
#include "Arduino.h" #ifndef BLINKM_H
#include "Wire.h" #define BLINKM_H
void SendColors(byte red, byte grn, byte blu); void SendColors(byte red, byte grn, byte blu);
#endif
\ No newline at end of file
#ifndef BOARDS_H #ifndef BOARD_H
#define BOARDS_H #define BOARD_H
// Macros for board type
#define BOARD_UNKNOWN -1 #define BOARD_UNKNOWN -1
#define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics" #define BOARD_GEN7_CUSTOM 10 // Gen7 custom (Alfons3 Version) "https://github.com/Alfons3/Generation_7_Electronics"
...@@ -68,4 +69,4 @@ ...@@ -68,4 +69,4 @@
#define MB(board) (MOTHERBOARD==BOARD_##board) #define MB(board) (MOTHERBOARD==BOARD_##board)
#endif //__BOARDS_H #endif
\ No newline at end of file
#include "Marlin.h"
#include "base.h"
#if HAS(BUZZER)
#include "buzzer.h" #include "buzzer.h"
#include "ultralcd.h" #include "ultralcd.h"
#if HAS_BUZZER void buzz(long duration, uint16_t freq) {
void buzz(long duration, uint16_t freq) { if (freq > 0) {
if (freq > 0) { #if ENABLED(LCD_USE_I2C_BUZZER)
#if ENABLED(LCD_USE_I2C_BUZZER) lcd_buzz(duration, freq);
lcd_buzz(duration, freq); #elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
#elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition SET_OUTPUT(BEEPER_PIN);
SET_OUTPUT(BEEPER_PIN); #if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
#if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC //tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
//tone(BEEPER_PIN, freq, duration); // needs a PWMable pin unsigned int delay = 1000000 / freq / 2;
unsigned int delay = 1000000 / freq / 2; int i = duration * freq / 1000;
int i = duration * freq / 1000; while (i--) {
while (i--) {
WRITE(BEEPER_PIN, HIGH);
delayMicroseconds(delay);
WRITE(BEEPER_PIN, LOW);
delayMicroseconds(delay);
}
#else // buzzer has its own resonator - needs a DC
WRITE(BEEPER_PIN, HIGH); WRITE(BEEPER_PIN, HIGH);
delay(duration); delayMicroseconds(delay);
WRITE(BEEPER_PIN, LOW); WRITE(BEEPER_PIN, LOW);
#endif delayMicroseconds(delay);
#else }
#else // buzzer has its own resonator - needs a DC
WRITE(BEEPER_PIN, HIGH);
delay(duration); delay(duration);
WRITE(BEEPER_PIN, LOW);
#endif #endif
} #else
else {
delay(duration); delay(duration);
} #endif
}
else {
delay(duration);
} }
#endif }
#endif
\ No newline at end of file
#ifndef BUZZER_H #ifndef BUZZER_H
#define BUZZER_H #define BUZZER_H
#if HAS_BUZZER void buzz(long duration, uint16_t freq);
void buzz(long duration, uint16_t freq);
#else
FORCE_INLINE void buzz(long duration, uint16_t freq) {}
#endif
#endif //BUZZER_H #endif
#include "Marlin.h"
#include "cardreader.h" #include "base.h"
#include "ultralcd.h"
#include "stepper.h"
#include "temperature.h"
#include "language.h"
#if ENABLED(SDSUPPORT) #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() { CardReader::CardReader() {
filesize = 0; filesize = 0;
sdpos = 0; sdpos = 0;
...@@ -657,5 +664,4 @@ void CardReader::printingHasFinished() { ...@@ -657,5 +664,4 @@ void CardReader::printingHasFinished() {
autotempShutdown(); autotempShutdown();
} }
} }
#endif
#endif //SDSUPPORT \ No newline at end of file
#ifndef CARDREADER_H #ifndef CARDREADER_H
#define CARDREADER_H #define CARDREADER_H
#if ENABLED(SDSUPPORT)
#define MAX_DIR_DEPTH 10 // Maximum folder depth #define MAX_DIR_DEPTH 10 // Maximum folder depth
#include "SdFile.h" #include "SdFile.h"
...@@ -99,6 +97,4 @@ extern CardReader card; ...@@ -99,6 +97,4 @@ extern CardReader card;
#define IS_SD_PRINTING (false) #define IS_SD_PRINTING (false)
#endif //SDSUPPORT
#endif //__CARDREADER_H #endif //__CARDREADER_H
...@@ -16,13 +16,6 @@ ...@@ -16,13 +16,6 @@
#include "MarlinSerial.h" #include "MarlinSerial.h"
#endif #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" #include "WString.h"
#ifdef USBCON #ifdef USBCON
...@@ -57,7 +50,7 @@ ...@@ -57,7 +50,7 @@
FORCE_INLINE void PS_PGM(const char *str) { FORCE_INLINE void PS_PGM(const char *str) {
char ch; char ch;
while ((ch = pgm_read_byte(str))) { while ((ch = pgm_read_byte(str))) {
MYSERIAL.write(ch); SERIAL_WRITE(ch);
str++; str++;
} }
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef CONFIGURATION_STORE_H #ifndef CONFIGURATION_STORE_H
#define CONFIGURATION_STORE_H #define CONFIGURATION_STORE_H
#include "Configuration.h" #include "base.h"
void Config_ResetDefault(); void Config_ResetDefault();
void ConfigSD_ResetDefault(); void ConfigSD_ResetDefault();
...@@ -24,14 +24,14 @@ void ConfigSD_ResetDefault(); ...@@ -24,14 +24,14 @@ void ConfigSD_ResetDefault();
#if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS) #if ENABLED(SDSUPPORT) && ENABLED(SD_SETTINGS)
static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.) static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
"PWR", "PWR",
#endif #endif
"TME", "TME",
}; };
enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS(POWER_CONSUMPTION_SENSOR)
SD_CFG_PWR, SD_CFG_PWR,
#endif #endif
SD_CFG_TME, SD_CFG_TME,
......
#include "Configuration.h"
#include "base.h"
#if ENABLED(DIGIPOT_I2C) #if ENABLED(DIGIPOT_I2C)
...@@ -6,14 +7,7 @@ ...@@ -6,14 +7,7 @@
#include "utility/twi.h" #include "utility/twi.h"
#include "Wire.h" #include "Wire.h"
// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro #include "digipot_mcp4451.h"
#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 byte current_to_wiper(float current) {
return byte(ceil(float((DIGIPOT_I2C_FACTOR*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
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "ultralcd.h" #include "ultralcd.h"
#include "ultralcd_st7920_u8glib_rrd.h" #include "ultralcd_st7920_u8glib_rrd.h"
#include "Configuration.h" #include "Configuration_Basic.h"
#if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT) #if DISABLED(MAPPER_C2C3) && DISABLED(MAPPER_NON) && ENABLED(USE_BIG_EDIT_FONT)
#undef USE_BIG_EDIT_FONT #undef USE_BIG_EDIT_FONT
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
#define LCD_WIDTH_EDIT 22 #define LCD_WIDTH_EDIT 22
#endif #endif
#ifndef TALL_FONT_CORRECTION #if DISABLED(TALL_FONT_CORRECTION)
#define TALL_FONT_CORRECTION 0 #define TALL_FONT_CORRECTION 0
#endif #endif
...@@ -137,10 +137,10 @@ ...@@ -137,10 +137,10 @@
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
#endif #endif
#ifndef LCD_PIXEL_WIDTH #if DISABLED(LCD_PIXEL_WIDTH)
#define LCD_PIXEL_WIDTH 128 #define LCD_PIXEL_WIDTH 128
#endif #endif
#ifndef LCD_PIXEL_HEIGHT #if DISABLED(LCD_PIXEL_HEIGHT)
#define LCD_PIXEL_HEIGHT 64 #define LCD_PIXEL_HEIGHT 64
#endif #endif
...@@ -238,7 +238,7 @@ static void lcd_implementation_init() { ...@@ -238,7 +238,7 @@ static void lcd_implementation_init() {
if (show_bootscreen) { if (show_bootscreen) {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
lcd_setFont(FONT_MENU); lcd_setFont(FONT_MENU);
#ifndef STRING_SPLASH_LINE2 #if DISABLED(STRING_SPLASH_LINE2)
u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1); u8g.drawStr(txt1X, u8g.getHeight() - DOG_CHAR_HEIGHT, STRING_SPLASH_LINE1);
#else #else
int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2; int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1)*DOG_CHAR_WIDTH) / 2;
...@@ -305,7 +305,7 @@ static void lcd_implementation_status_screen() { ...@@ -305,7 +305,7 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(80,48); u8g.setPrintPos(80,48);
if (print_job_start_ms != 0) { if (print_job_start_ms != 0) {
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) { if (millis() < print_millis + 1000) {
uint16_t time = (millis() - print_job_start_ms) / 60000; uint16_t time = (millis() - print_job_start_ms) / 60000;
lcd_print(itostr2(time/60)); lcd_print(itostr2(time/60));
...@@ -337,7 +337,7 @@ static void lcd_implementation_status_screen() { ...@@ -337,7 +337,7 @@ static void lcd_implementation_status_screen() {
// Fan // Fan
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
u8g.setPrintPos(104,27); u8g.setPrintPos(104,27);
#if HAS_FAN #if HAS(FAN)
int per = ((fanSpeed + 1) * 100) / 256; int per = ((fanSpeed + 1) * 100) / 256;
if (per) { if (per) {
lcd_print(itostr3(per)); lcd_print(itostr3(per));
...@@ -405,12 +405,12 @@ static void lcd_implementation_status_screen() { ...@@ -405,12 +405,12 @@ static void lcd_implementation_status_screen() {
u8g.setPrintPos(0,63); u8g.setPrintPos(0,63);
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS(LCD_FILAMENT_SENSOR) || HAS(LCD_POWER_SENSOR)
if (millis() < previous_lcd_status_ms + 5000) { //Display both Status message line and Filament display on the last line if (millis() < previous_lcd_status_ms + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message); lcd_print(lcd_status_message);
} }
#if HAS_LCD_POWER_SENSOR #if HAS(LCD_POWER_SENSOR)
#if HAS_LCD_FILAMENT_SENSOR #if HAS(LCD_FILAMENT_SENSOR)
else if (millis() < previous_lcd_status_ms + 10000) else if (millis() < previous_lcd_status_ms + 10000)
#else #else
else else
...@@ -423,7 +423,7 @@ static void lcd_implementation_status_screen() { ...@@ -423,7 +423,7 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR("Wh")); lcd_printPGM(PSTR("Wh"));
} }
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR #if HAS(LCD_FILAMENT_SENSOR)
else { else {
lcd_printPGM(PSTR("dia:")); lcd_printPGM(PSTR("dia:"));
lcd_print(ftostr12ns(filament_width_meas)); lcd_print(ftostr12ns(filament_width_meas));
......
This diff is collapsed.
#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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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