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.
I have a project which started as an empty_bitfield_project, but which I later added driverlib support to (via the steps recommended by Santosh in this thread).
I'm doing simple GPIO access via functions like GPIO_WritePin() and GPIO_ReadPin(), but I've noticed that they execute very slowly, even with optimization. If I right click on the function call in my source code and choose Declarations > Project, it takes me to f28004x_gpio.c, a local source file which was in the original empty_bitfield_project. It seems to be a copy taken from {C2000ware_root}/device_support/f28004x/common/source. The declaration is in {C2000ware_root}/device_support/f28004x/common/include. These functions are not inlined, which is why they're executing so slowly. Driverlib has its own versions of these functions which are inlined, defined in {C2000ware_root}/driverlib/f28004x/driverlib/gpio.h.
How to I tell the compiler/linker to use the inlined versions in driverlib? I've tried adding #include "driverlib.h" to the source files with the calls to GPIO_WritePin(), but it still uses the non-inlined versions. I even excluded f28004x_gpio.c from my build, but the linker returns "unresolved symbol" errors for all those functions. And when checking the declaration of GPIO_WritePin() in my source, it still takes me to the excluded f28004x_gpio.c!
Any help is appreciated
Hi,
In f28004x_gpio.c , the function is "GPIO_WritePin" whereas in the driverlib (gpio.h) , the function is "GPIO_writePin". Please note the case sensitivity in the name of these two functions.
Probably you are using "GPIO_WritePin" which is causing the error that you are seeing. You can add "#include driverlib.h" to your source file and then use "GPIO_writePin" function.
Best Regards
Siddharth
Oh wow, didn't notice that... yes if I make that change then it seems to use the inlined versions in driverlib. Need to be very careful, I suppose....
Thanks!