Change clock_time_t from a fixed unsigned long to portTickType so it works ok when configUSE_16_BIT_TICKS is set to 1.