+
+ uint8_t lo = ICR3L;
+ uint8_t hi = ICR3H;
+ uint16_t ao_icp3_this = (hi <<8) | lo;
+
+ /* handling counter rollovers */
+ if (ao_icp3_this >= ao_icp3_last)
+ ao_icp3_count = ao_icp3_this - ao_icp3_last;
+ else
+ ao_icp3_count = ao_icp3_this + (65536 - ao_icp3_last);
+ ao_icp3_last = ao_icp3_this;