Thank you very much @Owen_Williams for the platfromio tutorial. I’m relatively new to pio and I didn’tt know the lib_deps = "git_url" trick
I do have a very weird issue when I’m using simpleFoc as a library, as opposed to including it in my source tree and compiling it there.
I use a MagneticSensorSPI which I configure with a custom SPIClass instance.
I also use another SPIClass instance for another purpose.
When I’m compiling as a lib, the frequency of the sck clock is much slower, and the communication with my devices fails. I can measure it with my logic analyser.
It is so weird…
disclaimer, to make things work I had to edit a few things in variant.cpp. I’m using the samd21 with the sparkfun bootloader.
I tried many many things to overcome this but I’m clueless as to why it happens.
I’m pretty much certain it has nothing to do with the MagneticSensor class. I have another instance of SPIClass and it behaves just the same. I was measuring a slowdown of around 3x…
120000000/48000000 = 2.5
so I think F_CPU is missdefined when compiled as a lib. I’ll dig later
Right now I need to get something else (SimpleFOC-related) done, I haven’t debugged yet since I found the defines, but yeah I will printout the divider and all once I return to it.
Thanks