Added thread period decrement to systick handler