- DEAD_BEGIN = 1500, /* 10-bit degree value; about 120 degrees */
- DEAD_END = 2500, /* About 220 degrees */
- DEAD_THRESH = 14472, /* > when checking means in dead zone */
+ DEAD_BEGIN = 1500 * count, /* About 132 degrees */
+ DEAD_END = 2500 * count, /* About 220 degrees */
+ DEAD_THRESH = 3618 * count, /* > when checking means in dead zone */
+
+ /* If we assume the greatest angular velocity of the wind vane is 4 full
+ * rotations in a second, then in the 460us it takes to read the vane 4
+ * times, it could move over 6 degrees. This means that the vane could
+ * cross into, out of, or over the dead band, causing readings that can
+ * not be averaged. If we see a delta from min reading to max reading
+ * suggesting a large enough deflection, we can assume the reading is
+ * invalid.
+ */
+ MAX_DEFLECT = 1024, /* 90 degrees */