InstaSPIN-FOC使用面向对象的方法,由于是第一次接触,所以不是很熟悉,想请教一下,init方法为什么要定义一个对象大小的参数 size_t numBytes?
直接将指针指向对象不就可以了么,这是为了防止将错误的指针指向对象么? (如下图)
谢谢!
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.
Void * 是泛义指针,通过验证大小可以很大程度检查错误的传参,这种传参一但出错有时对外设是致命的。