a fast slew */
static double delta_total_tick;
+/* Maximum length of one fast slew */
+#define MAX_FASTSLEW_TIMEOUT (3600 * 24 * 7)
+
/* Max amount of time that we wish to slew by using adjtime (or its
equivalent). If more than this is outstanding, we alter the value
of tick instead, for a set period. Set this according to the
dseconds = -offset_register * (current_total_tick + delta_total_tick) / delta_total_tick;
- if (dseconds > 3600 * 24 * 7)
- dseconds = 3600 * 24 * 7;
+ if (dseconds > MAX_FASTSLEW_TIMEOUT)
+ dseconds = MAX_FASTSLEW_TIMEOUT;
UTI_AddDoubleToTimeval(&tv, dseconds, &end_of_slew);
slew_start_tv = tv;
fast_slewing = 1;
slew_start_tv = T0;
- /* Set up timeout for end of slew, limit to one week */
- if (dseconds > 3600 * 24 * 7)
- dseconds = 3600 * 24 * 7;
+ if (dseconds > MAX_FASTSLEW_TIMEOUT)
+ dseconds = MAX_FASTSLEW_TIMEOUT;
UTI_AddDoubleToTimeval(&T0, dseconds, &end_of_slew);
slew_timeout_id = SCH_AddTimeout(&end_of_slew, handle_end_of_slew, NULL);