I started to port MPTimer tests to QTest that allows precise VM clock control.
It helped to find out that the last period of the periodic timer is getting
lost, i.e. when counter = 0 (before wrap around). So the counter should be
loaded with limit + 1 after wrapping around. This worked before
Due to rounding down performed by ptimer_get_count, it returns counter - 1 for
the active timer. That's incorrect because counter should decrement only after
period been expired, not before. I.e. if running timer has been loaded with
value X, then timer counter should stay with X until period