Why Two Parameters for vPendableFunction instead of One


I might be missing something, but in the Mastering the FreeRTOS Pre-Release, is there a reason why the prototype in Listing 101 (vPendableFunction) needs two parameters instead of one?
It seems that ulParameter2 can be covered by pvParameter1, since pvParameter1 is a void pointer type?

Thank you again for your time.

This is done purely for convenience. The void * parameter allows anything to be passed into the function, but in the majority of cases the user just wants to pass in a value. The value can be cast to a void *, although that is quite messy, but often on smaller architectures (especially 8-bit architectures, or architectures with 24 or 30 bit address spaces) there is a mismatch between the number of bits in the value and the pointer anyway. Having the separate 32-bit value that can be used in place of the pointer is therefore cleaner and portable across all architectures.

I will say that it also is handy to be able to use the void* pointer to indicate some ‘object’ you want to talk to, and the integer becomes the message being sent to it.