yes, as you can see in the official example, the first argument to task_delay_until (or vTaskDelayUntil) is a pointer to the “previous wake time.” in this case, the & (ampersand) operator is not giving a reference, but is instead passing the address of now in memory. it’s just quicker than having to do something like
Now the students are too strong. I can’t answer all the questions . I don’t feel like a qualified teacher.
Students prefer to use “okapi”
Students don’t like my “ncrapi”
Is much more readable. Using non-const reference in APIs is generally quite a poor taste. It obfuscates the fact that the “now” is an “output argument”, something possibly written to by the function, while explicitly requiring a naked pointer makes that quite obvious.
The OP question just shows why…
Also, one thing to note is that you should keep the definition of now outside the loop.
From the documentation you linked:
pxPreviousWakeTime
Pointer to a variable that holds the time at which the task was last unblocked. The variable must be initialised with the current time prior to its first use (see the example below). Following this the variable is automatically updated within vTaskDelayUntil().