Merge pull request #4893 from thinkyhead/rc_stat_led_check

Define status LED pins without condition
This commit is contained in:
Scott Lahteine
2016-09-25 18:50:47 -05:00
committed by GitHub
21 changed files with 1011 additions and 980 deletions

View File

@ -781,7 +781,7 @@ void setup_killpin() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
void setup_filrunoutpin() {
pinMode(FIL_RUNOUT_PIN, INPUT);
SET_INPUT(FIL_RUNOUT_PIN);
#if ENABLED(ENDSTOPPULLUP_FIL_RUNOUT)
WRITE(FIL_RUNOUT_PIN, HIGH);
#endif
@ -859,10 +859,9 @@ void servo_init() {
*/
#if HAS_STEPPER_RESET
void disableStepperDrivers() {
pinMode(STEPPER_RESET_PIN, OUTPUT);
digitalWrite(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips
OUT_WRITE(STEPPER_RESET_PIN, LOW); // drive it down to hold in reset motor driver chips
}
void enableStepperDrivers() { pinMode(STEPPER_RESET_PIN, INPUT); } // set to input, which allows it to be pulled high by pullups
void enableStepperDrivers() { SET_INPUT(STEPPER_RESET_PIN); } // set to input, which allows it to be pulled high by pullups
#endif
#if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
@ -6514,18 +6513,19 @@ inline void gcode_M503() {
inline void gcode_M907() {
#if HAS_DIGIPOTSS
LOOP_XYZE(i)
if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value_int());
if (code_seen('B')) stepper.digipot_current(4, code_value_int());
if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
if (code_seen('X')) stepper.digipot_current(0, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
if (code_seen('Z')) stepper.digipot_current(1, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
if (code_seen('E')) stepper.digipot_current(2, code_value_int());
#elif HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
if (code_seen('X')) stepper.digipot_current(0, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
if (code_seen('Z')) stepper.digipot_current(1, code_value_int());
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
if (code_seen('E')) stepper.digipot_current(2, code_value_int());
#endif
#endif
#if ENABLED(DIGIPOT_I2C)
// this one uses actual amps in floating point
@ -8718,8 +8718,8 @@ void prepare_move_to_destination() {
bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led;
if (new_led != red_led) {
red_led = new_led;
digitalWrite(STAT_LED_RED, new_led ? HIGH : LOW);
digitalWrite(STAT_LED_BLUE, new_led ? LOW : HIGH);
WRITE(STAT_LED_RED_PIN, new_led ? HIGH : LOW);
WRITE(STAT_LED_BLUE_PIN, new_led ? LOW : HIGH);
}
}
}
@ -9193,20 +9193,17 @@ void setup() {
#endif
#if ENABLED(Z_PROBE_SLED) && PIN_EXISTS(SLED)
pinMode(SLED_PIN, OUTPUT);
digitalWrite(SLED_PIN, LOW); // turn it off
OUT_WRITE(SLED_PIN, LOW); // turn it off
#endif // Z_PROBE_SLED
setup_homepin();
#ifdef STAT_LED_RED
pinMode(STAT_LED_RED, OUTPUT);
digitalWrite(STAT_LED_RED, LOW); // turn it off
#if PIN_EXISTS(STAT_LED_RED)
OUT_WRITE(STAT_LED_RED_PIN, LOW); // turn it off
#endif
#ifdef STAT_LED_BLUE
pinMode(STAT_LED_BLUE, OUTPUT);
digitalWrite(STAT_LED_BLUE, LOW); // turn it off
#if PIN_EXISTS(STAT_LED_BLUE)
OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off
#endif
lcd_init();