Pin state reporting of all pins. Flash optimization.

- New pin state realtime reporting feature. Instead of `Lim:000` for
limit state reports, the new feature shows `Pin:000|0|0000`, or
something similar. The `|` delimited fields indicate xyz limits, probe,
and control pin states, where 0 is always not triggered, and 1 is
triggered. Invert masks ARE accounted for.
  Each field may be enabled or disabled via the `$10` status report
setting. The probe and control pin flags are bits 5 and 6, respectively.

- Remove the now deprecated `REPORT_CONTROL_PIN_STATE` option in
config.h

- The old limit pin reports `Lim:000` may be re-enabled by commenting
out `REPORT_ALL_PIN_STATES` in config.h.

- Incremented the version letter (v1.0c) to indicate the change in
reporting style.

- Replaced all bit_true_atomic and bit_false_atomic macros with
function calls. This saved a couple hundred bytes of flash.
This commit is contained in:
Sonny Jeon
2015-11-09 21:54:26 -07:00
parent b9c3461932
commit 5eee10845b
16 changed files with 182 additions and 63 deletions

View File

@ -502,14 +502,28 @@ void report_realtime_status()
printFloat_RateValue(st_get_realtime_rate());
#endif
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_LIMIT_PINS)) {
printPgmString(PSTR(",Lim:"));
print_unsigned_int8(limits_get_state(),2,N_AXIS);
}
#ifdef REPORT_CONTROL_PIN_STATE
printPgmString(PSTR(",Ctl:"));
print_uint8_base2(CONTROL_PIN & CONTROL_MASK);
#ifdef REPORT_ALL_PIN_STATES
if (bit_istrue(settings.status_report_mask,
( BITFLAG_RT_STATUS_LIMIT_PINS| BITFLAG_RT_STATUS_PROBE_PIN | BITFLAG_RT_STATUS_CONTROL_PINS ))) {
printPgmString(PSTR(",Pin:"));
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_LIMIT_PINS)) {
print_unsigned_int8(limits_get_state(),2,N_AXIS);
}
printPgmString(PSTR("|"));
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_PROBE_PIN)) {
if (probe_get_state()) { printPgmString(PSTR("1")); }
else { printPgmString(PSTR("0")); }
}
printPgmString(PSTR("|"));
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_CONTROL_PINS)) {
print_unsigned_int8(system_control_get_state(),2,N_CONTROL_PIN);
}
}
#else
if (bit_istrue(settings.status_report_mask,BITFLAG_RT_STATUS_LIMIT_PINS)) {
printPgmString(PSTR(",Lim:"));
print_unsigned_int8(limits_get_state(),2,N_AXIS);
}
#endif
printPgmString(PSTR(">\r\n"));