在motorware的例程中,看到的子函数都将传递的指针形参进行了Copy,不知是何用意。
bool GPIO_getData(GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
{
GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
如红色字体的内容,这么做的目的是什么?有什么好处?如果直接使用gpioHandle有什么风险?
期待大神予以解答。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在motorware的例程中,看到的子函数都将传递的指针形参进行了Copy,不知是何用意。
bool GPIO_getData(GPIO_Handle gpioHandle, const GPIO_Number_e gpioNumber)
{
GPIO_Obj *gpio = (GPIO_Obj *)gpioHandle;
如红色字体的内容,这么做的目的是什么?有什么好处?如果直接使用gpioHandle有什么风险?
期待大神予以解答。