crteensy Posted May 28, 2015 Report Share Posted May 28, 2015 I see arduino is now supported as an OS, but how are we supposed to use it? As far as I can tell it's not possible to add ugfx (in its current form) as an arduino library. Has anyone done this, or even packaged it in an arduino-friendly form? Link to comment Share on other sites More sharing options...
inmarket Posted May 28, 2015 Report Share Posted May 28, 2015 Other people have avoided the wierd and wonderful arduino build system and have created makefile based builds for their arduino project into which ugfx fits natively.It is possible though to use ugfx as a standard arduino library (that is how I did it for my project) however the bits of glue and documentation on it is not yet ready for the main repository. The arduino library structure is a bit strange the way it determines dependencies etc and so there was a fair amount of kludging involved.The basic process is to create a library called ugfx, then create a subdirectory within the library called ugfx that contains the real ugfx repository. Into the top level library directory create a ugfx.c and a ugfx.h and of course a config.h suitable for your project.In ugfx.c then #include all the relevant source files from the real repository subdirectory.In ugfx.h just #include the real ugfx.h from the real ugfx subdirectory. There are a few additional bits to making it work, the details of which I can't remember without firing the project up again But the above should get you most of the way there.When I get more time I will look at what is required to put the necessary bits into the master repository and write a wiki article on how to use it. Unfortunately that will not be in the next couple of weeks as I just have too much on currently. Link to comment Share on other sites More sharing options...
crteensy Posted May 28, 2015 Author Report Share Posted May 28, 2015 In ugfx.c then #include all the relevant source files from the real repository subdirectory.In ugfx.h just #include the real ugfx.h from the real ugfx subdirectory. Regarding including all source files in a single one: Doesn't that result in one huge compilation unit for ugfx and cause optimization problems?I already tried wrapping gfx.h in ugfx.h so that arduino can find the library header, but didn't get any further because I couldn't think of a convenient way to guide arduino to gfxconf.h. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted May 28, 2015 Report Share Posted May 28, 2015 I sadly don't have a working Arduino myself. However, if you two figure out how to build the required library without too much hassle I'd be happy if we could write a guide about that for the wiki.~ Tectu Link to comment Share on other sites More sharing options...
inmarket Posted May 28, 2015 Report Share Posted May 28, 2015 The gfxconf.h must be put in the library directory due to the include path arduino uses when it is compiling the library.With regard to it making one big file which "reduces optimisation", it actually increases optimisation as it increases the size of the compilation unit. Gcc link optimizer is also almost never used anyway due to bugs in the optimizer.This combining of source files is what the arduino build platform seems to do anyway for libraries - it combines all the source in the directory and then compiles it as a single unit. Link to comment Share on other sites More sharing options...
crteensy Posted June 1, 2015 Author Report Share Posted June 1, 2015 Yes indeed, the optimization concerns were a brain fart on my end. I'll try to use it with arduino as you described and come back with whatever I find. Link to comment Share on other sites More sharing options...
inmarket Posted June 1, 2015 Report Share Posted June 1, 2015 I am also cleaning up some code inclusion issues that should make it all a lot easier.Start with the gdisp/basics demo. That was about as far as I got with my proof of concept with ugfx as an arduino library. Link to comment Share on other sites More sharing options...
inmarket Posted July 8, 2015 Report Share Posted July 8, 2015 I don't know if you noticed but I recently made this http://forum.ugfx.org/viewtopic.php?f=9&t=228 change.This should make incorporating ugfx as an arduino library MUCH simpler. When I get more time I will spend some more time on getting the arduino library tested and in the main repository.Note I also found and fixed an issue with the scheduler which should improve stability of ports like this. Link to comment Share on other sites More sharing options...
VioletGiraffe Posted January 10, 2018 Report Share Posted January 10, 2018 Any news on this topic? Any further improvements on Arduino integration since 2015? Link to comment Share on other sites More sharing options...
inmarket Posted January 10, 2018 Report Share Posted January 10, 2018 Arduino is now well supported using the single file make mechanism. There is a wiki article on the best way to use it across multiple Arduino projects. Link to comment Share on other sites More sharing options...
VioletGiraffe Posted January 10, 2018 Report Share Posted January 10, 2018 1 hour ago, inmarket said: Arduino is now well supported using the single file make mechanism. There is a wiki article on the best way to use it across multiple Arduino projects. Thanks. It's definitely nowhere on the main Wiki page (I did check!), but searching for "Arduino" inside the Wiki leads to what looks like an actual manual: https://wiki.ugfx.io/index.php/Teensy Seems a bit convoluted, though. The project-specific library part. Link to comment Share on other sites More sharing options...
inmarket Posted January 10, 2018 Report Share Posted January 10, 2018 The method described in the wiki is not the only way of doing it, it is just a good way if you are intending to use uGFX in multiple projects with different hardware/configurations. If you look in the board/arduino directory (I think) of uGFX there is described the most basic way of doing it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now