gcode_process.c: show endstop status in clear text.

This costs 40 bytes, but should be a significant enhancement on
usability.
This commit is contained in:
Markus Hitter 2013-11-09 14:26:15 +01:00
parent fa1a7d4ef7
commit c5871d0303
1 changed files with 34 additions and 23 deletions

View File

@ -633,29 +633,40 @@ void process_gcode_command() {
power_on();
endstops_on();
delay_ms(10); // allow the signal to stabilize
#if defined(X_MIN_PIN)
sersendf_P(PSTR("x_min:%d "), x_min());
#endif
#if defined(X_MAX_PIN)
sersendf_P(PSTR("x_max:%d "), x_max());
#endif
#if defined(Y_MIN_PIN)
sersendf_P(PSTR("y_min:%d "), y_min());
#endif
#if defined(Y_MAX_PIN)
sersendf_P(PSTR("y_max:%d "), y_max());
#endif
#if defined(Z_MIN_PIN)
sersendf_P(PSTR("z_min:%d "), z_min());
#endif
#if defined(Z_MAX_PIN)
sersendf_P(PSTR("z_max:%d "), z_max());
#endif
#if ! (defined(X_MIN_PIN) || defined(X_MAX_PIN) || \
defined(Y_MIN_PIN) || defined(Y_MAX_PIN) || \
defined(Z_MIN_PIN) || defined(Z_MAX_PIN))
sersendf_P(PSTR("no endstops defined"));
#endif
{
const char* const open = PSTR("open ");
const char* const triggered = PSTR("triggered ");
#if defined(X_MIN_PIN)
sersendf_P(PSTR("x_min:"));
x_min() ? sersendf_P(triggered) : sersendf_P(open);
#endif
#if defined(X_MAX_PIN)
sersendf_P(PSTR("x_max:"));
x_max() ? sersendf_P(triggered) : sersendf_P(open);
#endif
#if defined(Y_MIN_PIN)
sersendf_P(PSTR("y_min:"));
y_min() ? sersendf_P(triggered) : sersendf_P(open);
#endif
#if defined(Y_MAX_PIN)
sersendf_P(PSTR("y_max:"));
y_max() ? sersendf_P(triggered) : sersendf_P(open);
#endif
#if defined(Z_MIN_PIN)
sersendf_P(PSTR("z_min:"));
z_min() ? sersendf_P(triggered) : sersendf_P(open);
#endif
#if defined(Z_MAX_PIN)
sersendf_P(PSTR("z_max:"));
z_max() ? sersendf_P(triggered) : sersendf_P(open);
#endif
#if ! (defined(X_MIN_PIN) || defined(X_MAX_PIN) || \
defined(Y_MIN_PIN) || defined(Y_MAX_PIN) || \
defined(Z_MIN_PIN) || defined(Z_MAX_PIN))
sersendf_P(PSTR("no endstops defined"));
#endif
}
endstops_off();
break;