/* Attempt to get a coherent snapshot of stepper positions across axes NOTE: suspending  */
static void sample_stepper_positions(int32_t *pos, const uint8_t cnt)
/* Attempt to get a coherent snapshot of stepper positions across axes NOTE: suspending  */
static void sample_stepper_positions(int32_t *pos, const uint8_t cnt)
{
    for (uint8_t i = 0; i != cnt; ++i)
      buf[i] = stepper.position((AxisEnum)i);
    bool unchanged = true;
    for (uint8_t i = 0; i != cnt; ++i) {
      if (pos[i] != buf[i]) {
        pos[i] = buf[i];
        unchanged = false;
      }
    }
    if (unchanged)
      break;
  }
}