Change type of tick to uint8_t to ensure atomic operation