             digitalWrite(shaft_hardware[shaft].pin_step, LOW);
             delayMicroseconds(MIN_STEP_uSEC);
             steps += stepadj; }
-         int hundredthinches = (int)(((long)steps * HUNDRETHINCHES_PER_ROTATION) / STEPS_PER_ROTATION);
-         if (hundredthinches < 0) // show the distance the frame moved up or down, in inches
-            sprintf(str, "-%d.%02d\"", (-hundredthinches) / 100, -hundredthinches % 100);
-         else sprintf(str, "+%d.%02d\"", hundredthinches / 100, hundredthinches % 100);
-         center_message(2, str); }
-      if (allow_abort && event == ePBH) {
-         steps = 999;
+         if (!centering) {
+            char old_distance[8], distance[8];
+            format_distance(old_distance, old_steps);
+            format_distance(distance, steps);
+            sprintf(str, "%s -> %s", old_distance, distance);
+            center_message(2, str); } }
+      if (centering && event == ePBH) {
+         steps = CALIB_SKIP;
          goto do_exit; }
       if (event == ePBV) {
 do_exit:


   See https://github.com/LenShustek/loom for more information about this project.

   ------------------------------------------------------------------------------------------------------
   Copyright (c) 2017, Len Shustek


                                  - allow abort from load/save/erase menu
   23 Mar 2017, L. Shustek, V1.5  - increase max treadle sequence to 99
                                  - fix bug when editing the filename extends its length
                                  - temporarily disable motors during weaving if there is no activity for a few minutes
   27 Mar 2017, L. Shustek, V1.6  - display filename on top-level screen, or "unsaved" if pgmg changes are made
                                  - default to current file in load/save menu
                                  - exit from program mode if any other button is pushed
   15 Jun 2017, L. Shustek, V1.7  - fix bug: exiting weaving mode after motors had timed out didn't return
                                    the shafts to the neutral position
    8 Jan 2018, L. Shustek, V1.8  - change "zero" button to "backup" button in weave mode
                                  - display frame numbers instead of X on the tieup screen
                                  - display treadle numbers instead of X on the treadle sequence screen
                                  - fix bug: backing up weave at the first treadle position failed
   28 Oct 2018, L. Shustek, V1.9  - add an option to do "Tabby" between each step of a treadle sequence
                                    if the first two treadles are otherwise unused
    3 Jan 2019, L. Shustek, V1.10 - during calibration, show the distance the frame moves
                                  - add a file option to reverse the fabric by inverting the tieups
   13 Jun 2020, L. Shustek, V1.11 - fix bug: "alternate tabby" wasn't working for shafts other than 0 and 1
                                  - fix bug: always set FILE_TABBY one way or the other when changing programming
   10 Oct 2020, L. Shustek, V1.12 - allow "weave" button to abort the calibration process
                                  - during calibration, show the previously set calibration point
                                  - increase debounce delay because our switches are really noisy

*/
#define VERSION "1.12"

/***** Enhancement ideas:

