- ao_lco_set_pad(ao_lco_pad);
-}
-
-#define MASK_SIZE(n) (((n) + 7) >> 3)
-#define MASK_ID(n) ((n) >> 3)
-#define MASK_SHIFT(n) ((n) & 7)
-
-static uint8_t ao_lco_box_mask[MASK_SIZE(AO_PAD_MAX_BOXES)];
-
-static uint8_t
-ao_lco_box_present(uint8_t box)
-{
- if (box >= AO_PAD_MAX_BOXES)
- return 0;
- return (ao_lco_box_mask[MASK_ID(box)] >> MASK_SHIFT(box)) & 1;
-}
-
-static uint8_t
-ao_lco_pad_present(uint8_t box, uint8_t pad)
-{
- /* voltage measurement is always valid */
- if (pad == 0)
- return 1;
- if (!ao_lco_channels[box])
- return 0;
- if (pad > AO_PAD_MAX_CHANNELS)
- return 0;
- return (ao_lco_channels[box] >> (pad - 1)) & 1;
-}
-
-static uint8_t
-ao_lco_pad_first(uint8_t box)
-{
- uint8_t pad;
-
- for (pad = 1; pad <= AO_PAD_MAX_CHANNELS; pad++)
- if (ao_lco_pad_present(box, pad))
- return pad;
- return 0;
-}
-
-static struct ao_task ao_lco_drag_task;
-static uint8_t ao_lco_drag_active;
-static uint8_t ao_lco_drag_beep_count;
-static uint8_t ao_lco_drag_beep_on;
-static uint16_t ao_lco_drag_beep_time;
-static uint16_t ao_lco_drag_warn_time;
-static uint16_t ao_lco_drag_display_time;
-static uint8_t ao_lco_drag_display_on;
-
-#define AO_LCO_DRAG_BEEP_TIME AO_MS_TO_TICKS(50)
-#define AO_LCO_DRAG_WARN_TIME AO_SEC_TO_TICKS(5)
-
-static void
-ao_lco_drag_beep_start(void)
-{
- ao_beep(AO_BEEP_HIGH);
- PRINTD("beep start\n");
- ao_lco_drag_beep_on = 1;
- ao_lco_drag_beep_time = ao_time() + AO_LCO_DRAG_BEEP_TIME;