Skip to content

Commit

Permalink
Merge pull request #2704 from thinkyhead/compare_to_dev
Browse files Browse the repository at this point in the history
Parity with MarlinDev/master PRs
  • Loading branch information
AnHardt committed Oct 26, 2015
2 parents 98adb9f + 594fb5f commit 50a5117
Show file tree
Hide file tree
Showing 47 changed files with 778 additions and 892 deletions.
5 changes: 0 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -853,11 +853,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
//#define FILAMENT_LCD_DISPLAY






#include "Configuration_adv.h"
#include "thermistortables.h"

Expand Down
3 changes: 2 additions & 1 deletion Marlin/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ void MarlinSerial::begin(long baud) {
if (useU2X) {
M_UCSRxA = BIT(M_U2Xx);
baud_setting = (F_CPU / 4 / baud - 1) / 2;
} else {
}
else {
M_UCSRxA = 0;
baud_setting = (F_CPU / 8 / baud - 1) / 2;
}
Expand Down
50 changes: 31 additions & 19 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@
#include "stepper.h"
#include "temperature.h"
#include "cardreader.h"
#include "watchdog.h"
#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 ENABLED(BLINKM)
#include "blinkm.h"
#include "Wire.h"
Expand Down Expand Up @@ -681,7 +684,11 @@ 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();
servo_init();
Expand Down Expand Up @@ -827,8 +834,10 @@ void get_command() {
fromsd[cmd_queue_index_w] = false;
#endif

char *npos = strchr(command, 'N');
char *apos = strchr(command, '*');
while (*command == ' ') command++; // skip any leading spaces
char* npos = (*command == 'N') ? command : NULL; // Require the N parameter to start the line
char* apos = strchr(command, '*');

if (npos) {

boolean M110 = strstr_P(command, PSTR("M110")) != NULL;
Expand Down Expand Up @@ -1688,7 +1697,8 @@ static void setup_for_endstop_move() {
if (a < b) {
if (b < c) median = b;
if (c < a) median = a;
} else { // b <= a
}
else { // b <= a
if (c < b) median = b;
if (a < c) median = a;
}
Expand Down Expand Up @@ -1783,7 +1793,8 @@ static void setup_for_endstop_move() {
#endif
do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1); // Dock sled a bit closer to ensure proper capturing
digitalWrite(SLED_PIN, LOW); // turn off magnet
} else {
}
else {
float z_loc = current_position[Z_AXIS];
if (z_loc < Z_RAISE_BEFORE_PROBING + 5) z_loc = Z_RAISE_BEFORE_PROBING;
do_blocking_move_to(X_MAX_POS + SLED_DOCKING_OFFSET + offset, current_position[Y_AXIS], z_loc); // this also updates current_position
Expand Down Expand Up @@ -2696,7 +2707,8 @@ inline void gcode_G28() {
SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n");
return;
}
} else {
}
else {
SERIAL_PROTOCOLPGM("X not entered.\n");
return;
}
Expand All @@ -2706,7 +2718,8 @@ inline void gcode_G28() {
SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n");
return;
}
} else {
}
else {
SERIAL_PROTOCOLPGM("Y not entered.\n");
return;
}
Expand Down Expand Up @@ -4653,13 +4666,8 @@ inline void gcode_M220() {
inline void gcode_M221() {
if (code_seen('S')) {
int sval = code_value();
if (code_seen('T')) {
if (setTargetedHotend(221)) return;
extruder_multiplier[target_extruder] = sval;
}
else {
extruder_multiplier[active_extruder] = sval;
}
if (setTargetedHotend(221)) return;
extruder_multiplier[target_extruder] = sval;
}
}

Expand Down Expand Up @@ -6381,25 +6389,29 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist;
ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
x_splits ^= BIT(ix);
} else if (ix < pix && (x_splits) & BIT(pix)) {
}
else if (ix < pix && (x_splits) & BIT(pix)) {
nx = mbl.get_x(pix);
normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]);
ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist;
ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
x_splits ^= BIT(pix);
} else if (iy > piy && (y_splits) & BIT(iy)) {
}
else if (iy > piy && (y_splits) & BIT(iy)) {
ny = mbl.get_y(iy);
normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]);
nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist;
ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
y_splits ^= BIT(iy);
} else if (iy < piy && (y_splits) & BIT(piy)) {
}
else if (iy < piy && (y_splits) & BIT(piy)) {
ny = mbl.get_y(piy);
normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]);
nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist;
ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
y_splits ^= BIT(piy);
} else {
}
else {
// Already split on a border
plan_buffer_line(x, y, z, e, feed_rate, extruder);
set_current_to_destination();
Expand Down
6 changes: 4 additions & 2 deletions Marlin/Sd2Card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,13 @@ uint32_t Sd2Card::cardSize() {
uint8_t c_size_mult = (csd.v1.c_size_mult_high << 1)
| csd.v1.c_size_mult_low;
return (uint32_t)(c_size + 1) << (c_size_mult + read_bl_len - 7);
} else if (csd.v2.csd_ver == 1) {
}
else if (csd.v2.csd_ver == 1) {
uint32_t c_size = ((uint32_t)csd.v2.c_size_high << 16)
| (csd.v2.c_size_mid << 8) | csd.v2.c_size_low;
return (c_size + 1) << 10;
} else {
}
else {
error(SD_CARD_ERROR_BAD_CSD);
return 0;
}
Expand Down
18 changes: 12 additions & 6 deletions Marlin/Sd2PinMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ static inline __attribute__((always_inline))
bool getPinMode(uint8_t pin) {
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
return (*digitalPinMap[pin].ddr >> digitalPinMap[pin].bit) & 1;
} else {
}
else {
return badPinNumber();
}
}
Expand All @@ -405,18 +406,21 @@ static inline __attribute__((always_inline))
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
if (mode) {
*digitalPinMap[pin].ddr |= BIT(digitalPinMap[pin].bit);
} else {
}
else {
*digitalPinMap[pin].ddr &= ~BIT(digitalPinMap[pin].bit);
}
} else {
}
else {
badPinNumber();
}
}
static inline __attribute__((always_inline))
bool fastDigitalRead(uint8_t pin) {
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
return (*digitalPinMap[pin].pin >> digitalPinMap[pin].bit) & 1;
} else {
}
else {
return badPinNumber();
}
}
Expand All @@ -425,10 +429,12 @@ static inline __attribute__((always_inline))
if (__builtin_constant_p(pin) && pin < digitalPinCount) {
if (value) {
*digitalPinMap[pin].port |= BIT(digitalPinMap[pin].bit);
} else {
}
else {
*digitalPinMap[pin].port &= ~BIT(digitalPinMap[pin].bit);
}
} else {
}
else {
badPinNumber();
}
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void Config_RetrieveSettings() {

EEPROM_READ_VAR(i, dummy); // bedKp
if (dummy != DUMMY_PID_VALUE) {
bedKp = dummy;
bedKp = dummy; UNUSED(bedKp);
EEPROM_READ_VAR(i, bedKi);
EEPROM_READ_VAR(i, bedKd);
}
Expand Down Expand Up @@ -540,7 +540,7 @@ void Config_ResetDefault() {
#if ENABLED(PID_PARAMS_PER_EXTRUDER)
for (int e = 0; e < EXTRUDERS; e++)
#else
int e = 0; // only need to write once
int e = 0; UNUSED(e); // only need to write once
#endif
{
PID_PARAM(Kp, e) = DEFAULT_Kp;
Expand Down
5 changes: 0 additions & 5 deletions Marlin/configurator/config/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
//#define FILAMENT_LCD_DISPLAY






#include "Configuration_adv.h"
#include "thermistortables.h"

Expand Down
6 changes: 4 additions & 2 deletions Marlin/dogm_lcd_implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,20 @@ char lcd_printPGM(const char* str) {
/* Warning: This function is called from interrupt context */
static void lcd_implementation_init() {

#if ENABLED(LCD_PIN_BL) // Enable LCD backlight
#if defined(LCD_PIN_BL) && LCD_PIN_BL > -1 // Enable LCD backlight
pinMode(LCD_PIN_BL, OUTPUT);
digitalWrite(LCD_PIN_BL, HIGH);
#endif

#if ENABLED(LCD_PIN_RESET)
#if defined(LCD_PIN_RESET) && LCD_PIN_RESET > -1
pinMode(LCD_PIN_RESET, OUTPUT);
digitalWrite(LCD_PIN_RESET, HIGH);
#endif

#if DISABLED(MINIPANEL) // setContrast not working for Mini Panel
u8g.setContrast(lcd_contrast);
#endif

// FIXME: remove this workaround
// Uncomment this if you have the first generation (V1.10) of STBs board
// pinMode(17, OUTPUT); // Enable LCD backlight
Expand Down
7 changes: 1 addition & 6 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
//#define LCD_I2C_VIKI

// SSD1306 OLED generic display support
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
//#define U8GLIB_SSD1306
Expand Down Expand Up @@ -835,11 +835,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
//#define FILAMENT_LCD_DISPLAY






#include "Configuration_adv.h"
#include "thermistortables.h"

Expand Down
9 changes: 2 additions & 7 deletions Marlin/example_configurations/Felix/Configuration_DUAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
#define FILAMENT_RUNOUT_SCRIPT "M600"
#endif

//===========================================================================
//=========================== Manual Bed Leveling ===========================
//===========================================================================
Expand Down Expand Up @@ -459,7 +459,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l

//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" // These commands will be executed in the end of G29 routine.
// Useful to retract a deployable Z probe.

//#define Z_PROBE_SLED // Turn on if you have a Z probe mounted on a sled like those designed by Charles Bell.
//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

Expand Down Expand Up @@ -799,11 +799,6 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
//#define FILAMENT_LCD_DISPLAY






#include "Configuration_adv.h"
#include "thermistortables.h"

Expand Down
Loading

0 comments on commit 50a5117

Please sign in to comment.