chipKIT® Development Platform

Inspired by Arduino™

Need some pointer on writing a library

Created Sat, 31 Oct 2015 14:03:23 +0000 by linuxha


linuxha

Sat, 31 Oct 2015 14:03:23 +0000

Hi folks, I'm working on some home automation controllers that are working with MQTT and I'm starting to work on the SSL part. So far I have all the basic stuff down and I've ported over the needed libraries to the MPIDE/UECIDE. But I find that often a little change really messed up the compile and I'm lost as to why. Sometimes it's my lack of knowledge with C++ but often its the odd Arduino type environment of the sketch. I'm very much used to Makefiles but only just started working with UECIDE (yea, a make file).

Getting to the point. I'd like to rewrite the W550io Ethernet library to use the DSPI instead of the SPI interface. But when I start off with a simple change such as switching the SPI.h to DSPI.h the compile fails with can't find the DSPI.h file. Any pointers on how to include libraries in libraries? Or perhaps I'm missing something else.


majenko

Sat, 31 Oct 2015 20:02:44 +0000

One of the things with UECIDE is that it scans the libraries for required sub-libraries at startup. If you change includes within a library while the IDE is running it doesn't know about it, and still tries to compile in the old required libraries.

There is an option in the Help menu which can re-scan the whole system, including libraries, without having to restart the whole IDE: Help -> Debug

Also it can help to purge the old library cache out when recompiling. In later version of UECIDE that is as simple as holding shift while clicking the compile button. You can also find the library in the project tree and right click it for options to purge and recompile it. Again there is also an entry in Help -> Debug to purge the whole system.