Page 1 of 1

Libraries with external .h files (especially Wiegand)

Posted: 26 Oct 2020 04:43
by hperk01
Has anyone been able to ever get a Wiegand library (such as the one that shows up in "Manage Libraries", but another would be fine) to compile for this board in Arduino IDE? In fact, I can't get any external .h files to work properly when set to the Z-Uno board and programmer. When set to another board, it works fine.

I'm using the latest build. If I grab sample code that doesn't use any libraries, it works. If I have a library, I'll get "whatever.h" not found - putting it into the local directory then will give errors for "wprogram.h" and so on until I put every conceivably .h file in the local directory, regardless of what I set for the library include path. Even then, it still won't compile because of other call issues, such as "digitalPinToInterrupt".

I'm beyond frustrated - I was super excited to get started programming this chip, but the IDE doesn't seem to support it well at all. As I said before, compiling for other boards/programmers works fine. If I'm missing something, I'd really appreciate understanding what it is.

Re: Libraries with external .h files (especially Wiegand)

Posted: 28 Oct 2020 15:35
by p0lyg0n1
Hi,
1) There is no direct way to add any library from LibraryManager to Z-Uno without "porting". You have to port it first. ZUno has some restrictions in language, in hardware and stack usage.
2) You can find some libraries already ported to Z-Uno inside its cores directory. ZUNO_DHT, ZUNO_DS18B20 etc. Use them as examples, as "how to".
3) About wprogram.h. Seems your library uses some precompiler flags to detect the platform and it wants AVR-only boards. You have to setup these flags right way. Of course, it's very important to understand the code of library to port it.
4) Z-Uno uses another architecture i8051. It's not AVR. It's not a RISC too, so some hardware functions like digitalPinToInterrupt doesn't work, because Z-uno supports only STATIC interrupt initialization(You can use only 3 pins for interrupts).
5) If you post an example of code which you want to port we will be able to give you more information and advices.
6) Finally. We have some good news for those who was frustrated with ancient Z-Uno chips (i8051), now we are working on the second generation which is based on modern architecture CortexM4F(Thanks to SiLabs). It has modern gcc compiler and large stack. Follow us in our RSS and twitter.

Wish you good luck.

Alex.